Who don’t need a connected button???
Immagine a button who automatically send a message via WiFi to your server and start your heating, or trigger the start of your favorite film on your TV. It’s time to build one!
- the button enclosure plus a switch and battery holder – I found out a low cost push light in a elegant white enclosure perfect for realize this button (and big enough to not loose in a messy environment)
- the WiFi board – I chosen a very simple and low cost ESP8266
- the light – I used a 8 element NeoPixel bar
- connection wires
- an MQTT broker for
- optionally an IoT platform like Node-Red
- Arduino IDE for compile and program the ESP8266
When the button is pressed the ESP turn on and try to connect to the WiFi, if the board can not connect automatically switch on access point mode and ask to choose the WiFi and insert the password.
- Once the WiFi is connected the board immediately connect to an MQTT server and the light become blue.
- After the subscription to the confirmation message queue the board send a message on the queue:
- When the message is sent the board wait for an answer on the queue
- If this message contain the string “OK” the light become green, otherwise red.
When you can see the feedback light (green or red) you can turn off the board clicking the button once again.