5 ms·
I have a dark corner near the entrance door and I made a battery-run light (2 LEDs - to light up the key hole) with very simple logic: when you press the button
by ay 14y ago
I have a dark corner near the entrance door and I made a battery-run light (2 LEDs - to light up the key hole) with very simple logic: when you press the button, it lights up for 2 minutes, then blinks for another 2 minutes; then blinks faster for another minute; then goes dark.
The button is wired to "reset" pin of an attiny45, the LEDs are connected to two pins of the chip, and the code, predictably, ends with a low-power sleep instruction.
Two 2100mAh AA-sized accumulators provide the power.
I "launched" it into use about 4 months ago (I forgot the exact date), still did not have to recharge.
- chimi 14y agoJust out of curiosity, why have it blink for 2 minutes, then faster for 1 minute?
- theatrus2 14y agoThat would be annoying to me too. I'd have it PWM dim.
- ay 14y agoUnhelpful when you are putting in the keys - better strobed full-light than dim - the latter sounds cool but is impractical. The human vision is much more effective at flash-like lighting than at a constant near-zero one. At least, mine and my cohabitants :-) Try it IRL and then tell me your opinion, I'm curious to know your opinion.
- jevinskie 14y agoSo you aren't left in the dark without notice?
- ay 14y agoexactly. This is to say "soon it will be dark, press the reset if you are sure you need a lot more time and just hurry up if you do not". Most of the time it really is no-op though.
- ay 14y agoPower savings as well as signalling where we are in the cycle. One interval is 1:3 the other minute 1:4. Feel free to press the button to reset to the beginning of the cycle if you feel it is not enough.