Day 13: Smart Switch for Soundboard
Today we will find again a 1 kOhm resistor hidden behind the door of the Advent calendar. But we are not going to use it today. Instead I would like to show you how you can build a smart touch switch. We will use a simple setup that is made up of four loose hanging wires as touch buttons and a wire jumper to pin 23.
Our experiment today is special for its program, which you should activate now on the configuration page. Once enabled, you will notice that the status LED flashes briefly and then turns off, because the board is again running in the power-saving deep-sleep mode. It will not wake up after certain time however. It will wake up only, when you touch one of the touch buttons. The board then sends information via the touch button to the broker who triggered the wakeup. It will look something like this:
While the connection is being established, you can see that the status LED is flashing green. Once the data is sent, the LED is lit green, which indicates that sending was successful. If the LED is red, sending did not work. The board goes back into deep-sleep mode immediately after that. The system is very energy efficient so that you could power the board by batteries and place the smart switch anywhere in your flat.
Note: Simply pull out the wire jumper from pin 23 and reset the board to leave deep-sleep mode and switch to normal mode.
The smart switch itself is something special. We are going to connect the switch with Node-RED and an application. We will use the audio-out node once more in today’s Node-RED flow, but this time we need it to play audio files, too. First of all, import today’s flow; and, do not forget, disable previous flows and enter your personal ID instead of the [PID] placeholder.
Check out and discover the functionalities of the individual buttons. But before that, turn down the volume of your speakers.