Intro
Simple request from a friend: change a remote-controled light bulb into a sound activated light bulb.What you need for this project:
What | img | price in 2020 |
---|---|---|
Esp32 | 7€ | |
Nano | 4€ | |
IR Sender | 5€ | |
Sound sensor | 5€ |
Links are not an endorsement of the product and just provided for convenience sake. I get not cut.
I bought a lot of ESP32 for other projects, but it is a bit of overkill, in the sense that you don't need any of the wifi or bluetooth capabilities, so a Nano would do just as well. It was also an opportunity for me to code for the Nano. That's why I listed both prices. You don't need both, any of the two will do. For sound sensor, you can use a KY-0037 or KY-0038, or anything else :-)
Putting it together
The design is rather simple: An IR sender is connected to a board, and the board connected to sound sensor.
The sound triggers the lightbulb on and off.
The problem was of course to know which code the remote was sending to switch the lightbulb on and off.
One solution was to use my previous project but after a bit of research, the bulb was identified as a Livarno Lux.
I further found that it was using the NEC-AIWA1 set, and the codes found here.
The wiring looks like this:
From a programming point of view, all the information needed is here: IR library, ESP8266 example. Adaptation for an ESP32 or Nano is straightforward.
(C) Thunus F. 2020.