Panic Button Night Light


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.

Hardware

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.

IMG_1494

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.

Screen Shot 2016-05-16 at 23.32.25

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!

IMG_1230 FullSizeRender (1)

Code

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 🙂

5 thoughts on “Panic Button Night Light”

  1. Nice work.
    I was wondering what it would turn into, and now I have an idea for a Digispark Oak, or one ot the other boards I have.

    Cheers
    Mark

  2. Stage 2 of this project would be collecting the triggers so you can receive weekly reports on nightmare patterns.
    Stage 3: Correlate it to the movies/series watched via kodi

    Plenty of room left to grow, maybe for the next maker faire? 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *