donderdag 29 mei 2014

Motion Detection for 12V ledbar

On an electronic flea market I bought two 50cm 12V (700ma) ledbars. They were quite bright and only cost 6 euro a piece. I still needed a proper lighting solution for my work bench and thought these could perfectly serve that purpose.

With some two components conductive glue I glued them on a aluminum strip for thermal conductivity. A wooden frame prevents to look right into the leds when you enter the room. It definitely gives a nice bright even illuminated work bench.

 
I didn't want to use a switch to turn the lights on and off. It is just not cool! Recently I bought 10 PIR motion detection sensor modules (HC-SR501) on ebay for only 10 euro (How can they even make that for one euro?). I thought one of these can do the job for me when I approach my bench.

The PIR sensor module outputs 3V3 when motion is detected. Sensitivity and ON time can be adjusted on the module. It operates on supply voltages between 4.5 and 20V so the 12V (1.5A) adapter I need to power the ledbars can also power the PIR sensor. I wanted to use an IRF540 NFET to switch the leds, but this NFET doesn't open up completely with a Vgs of 3V3 which limits the current flowing through the leds. That is why I used a smaller BS170 NFET that can be triggered with 3V3. R1 is a 10K resistor to prevent a floating gate signal. Due to another 10K resistor (R2) at the drain of the BS170 an inverted signal of the PIR sensor is available, so a PFET (IRF9540) can invert back that signal to switch on the ledbars. For troubleshooting purposes I added a jumper to  put 12V directly on the ledbars and a test led (always add a test led!) to see the circuit works properly even if the ledbars are not connected.


 I stuffed everything into a small plastic storage box that I found in the kitchen and made it possible to rotate the whole box to be able to point the PIR sensor towards the workbench. It turned out to be a very nice local lighting solution. I doesn't turn on when I enter the room or walk around, only when I enter the work bench it turns on. Altogether it didn't cost me more then 15 euros, I don't believe you can buy something like this for so little money.