Conny likes to fall asleep with some light on. I dislike having to wait until she's gone late at night, just to switch off her bedside light. I dislike having an energy-wasting halogene 25W burning all night long even more, not to mention the temperature problems with the transformer base buried in stuffed animals.

The solution: teach her something! So we repurposed an old broken desk lamp carcass, I taught her how to solder, programmed a 12f629 PIC and we combined the above with sufficiently many white LEDs and some recycled laptop Li-Ion cells into an auto-off bed light: Press the button when off, and you get 18 min of light. Press the button when the light is on, and the light goes off. Simple, neat, efficient. As a bonus the lamp body is black, Just Like It Should Be.

The circuit is trivially simple, the diagram follows and the PIC code (also boringly simple) is here (plus the auxiliary delay library).

nightlight

The diagram is not complete in two particulars: I used a 4.5mm plug with a builtin bypass switch to isolate the battery when charging (don't want to blow the LEDs and/or PIC when my intelligent charger feeds the LiIon), and I repurposed the original lamp switch as an extra "general disconnect". BSTS.

Great care should be taken to avoid shorting or annoying the three 2000+mAh cells in any way - unless you like to play with fire extinguishers.

 2008_02_14-nachtlicht-brain.jpg  2008_02_14-nachtlicht-leds.jpg  2008_02_14-nachtlicht-löterei.jpg 2008_02_14-conny-nachtlicht-löten.jpg 2008_02_14-nachtlicht-fertig.jpg  2008_02_14-nachtlicht-in-action.jpg

Conny did all the soldering apart from one or two small fixes and the LED interconnections. Well done.

[ published on Mon 18.02.2008 00:00 | filed in interests/tinkering | ]
Debian Silver Server
© Alexander Zangerl