Continuation of previously published articles, first , second . This article will focus on a programmable light switch with a remote control. Like past projects for debugging and prototyping, I use Carduino Nano V.7
Required functionality
The ability to control the switch with any household IR remote control. Program the switch to any button of the household IR remote control. Turn on / off the light, both from the switch key and from the remote, regardless of each other.
At first we add the code of the button of the control panel to the memory of the switch. To do this, we take the most suitable remote control for us (the remote control from the air conditioner will not work) and select a free button on it that you never use (usually the colored teletext buttons). We enter the switch programming mode, for this you need to press the on / off key and hold for 5 seconds, a long beep will sound, then it remains to press the previously selected remote control button and your switch is ready for operation. Now the light switch will understand the command of your IR remote control added to it. The button code is stored in the non-volatile memory of the controller and will be stored in memory even after the power supply to the circuit is turned off.
The operation of the prototype switch, see the video
To compile the code you need to add the library IRemote . The library is different from the original, as I added several protocols to it, including the new protocol of Samsung LED TVs
Circuit Breaker
After debugging the device on the arduino, I drew the final circuit of the future switch. Since I already wrote earlier that Arduino is a convenient tool for debugging and writing code, but it will not work for the final circuit.
Hex file for Atmega168 controller firmware The power supply can be used from a mobile phone charger. Power supply circuits.
If you have questions, ask, I will answer them with pleasure.