The Jedi Light Trick

img_1353

I have grand schemes on setting up a solar powered LED lighting system in the camper, but until the money and motivation magically align, i’m just making it up as I go. All of the light fixtures in my camper are old and cracked and falling apart. The central most light fixture died completely recently, and I made do without it until now. Years ago (January 2012) I built an infrared light switch (programmed with Arduino and housed in an Altoids tin) to control some halogens I no longer use. I stumbled across that old circuit today and decided to repurpose it. I wrote about the original build back then, if you care to read the details. It has the schematic (EagleCAD) and Arduino code attached if you want to build your own. My dad (who is obsessed with LED lighting) had just given me a neat 12V LED array to check out. He is always finding cool lights like this on eBay.

The circuit is powered with 12v because it uses a 12V relay, which was all I had on hand the day I built it. I’d like to redo it with a 5V relayimg_1346 since that is all the Atmel chip needs to operate. 12V poses a couple of problems. First, since the chip requires 5V, I have to step the voltage down (with a 7805 in this case) which is not very efficient. Second, the Atmel chip cannot switch the relay on its own. The voltage/current is just too much. So I had to use an NPN transistor to switch to relay on. The chip switches the transistor, which in turn energizes the relay. I wasn’t really in the mood to re-solder a different relay in, and then have to re-write any code, so I left it as is for now.

img_1354It’s all programmed with Arduino. Its quite simple code wise, with about 40 lines of actual code. It really just monitors the iR detector for light reflected from the emitter (from a hand for example), and toggles the relay on and off when it sees it. The lights ground is switched via the relay. It was tricky to get the sensitivity right, as I recall. I thought I was going to build a ton of things into Altoids tins, but as yet, this is the only one.

The switch is located near the entry door. When I come home in the dark, it just takes a Jedi style hand gesture and the centrally located light will illuminate. I may be up to some solar and lighting projects in the near future, so stay tuned. Enjoy the included video, and see the link above for the circuit details from the original build post.