This is my little LightBox, a night light. Basically what it does: When you switch off lights, it lights up for a minute for you to reach your bed without accidents :D
What is it built from:
Transparent candy box, "frosted" with thin sandpaper
Picaxe 08M chip
LDR
4 Blue LEDs
3 AA Batteries and battery holder
NPN transistor
few resistors
How does it work:
So, firstly as it has no power switch - it runs continiously. Not runs actually, I uses “nap” picaxe command to minimize power consumption when idle. So, it sleeps, wakes up every second to take LDR measurement. Then it compares it to last obtained one, and if previously it was"light" and now it is “dark”, LEDs faded in using PWM, kept on for a minute and finally faded out.