When going to Maker Faire Paris end of April, I brought an unfinished project along and asked children for ideas. What I brought was a wooden enclosure with a gigantic red button on top. The most popular idea was to make a kind of panic button that would temporarily turn on a light in their bedroom, should they become scared of the dark or have a nightmare.
The project makes use of a remote controlled socket. Using an Arduino compatible board and a RF transmitter of the correct frequency (433MHz in this case), it is possible to reproduce the signals sent by the remote control. For the board, I picked the Qduino Mini from Sparkfun, which I have obtained via Kickstarter a while back. The Qduino has a switch and onboard LiPo charger, which are useful for a battery powered project like this one.
The circuit is not complicated. An arcade button with built-in LED is connected to the board as follows:
- Button to D0 for interrupt
- LED to D9 for PWM
The RF module’s data pin can be connected to any digital input, I picked D5.
For the enclosure, I used my CNC to make a little box capable of housing all the components. I experimented with milling box joints, and everything fit quite well!
The code makes use of the following library: https://github.com/jccprj/RemoteSwitch-arduino-library. It is a bit outdated though, but works for my sockets. An alternative (and more recent) library is: https://github.com/sui77/rc-switch. Give it a try and see which one works best for your sockets.
After that, it was just a matter of having the button send the ON or OFF signal and pulse the button’s LED. Because the Qduino has an onboard LiPo charger, the battery state can also be visualised by one of the onboard RGB LEDs.
The full code looks like this:
That’s it, I hope you enjoyed this project! Till next time 🙂