So there was this spot in our living room that was just perfect for an Ikea lamp. The only problem was that we didn’t want to pay an electrician to put in a new electrical line, or a sheetrock/painter type to repair the damage that would be done by the electrician.
Instead, we mounted the body of the lamp where it was supposed to go, and I got busy with the soldering iron and the 3D printer. I printed a piece that screws into the lamp’s light socket and holds
- a big honking 14.4V lithium battery,
- a couple feet of 12-volt “warm white” LED tape and
- a perma-proto board with a latching rf switch, a mosfet and two voltage regulators, to feed the switch and the light string.
A battery that fits in roughly the same space as an incandescent bulb turns out to hold enough energy for about 20 hours of light (at 410 milliamps for the LEDs and maybe 50 for the regulators and everything else). So swapping in a new battery every three or four nights should be fine, right? Unless you have holiday guests who stay up all night reading and forget to turn the light off…
After the second time I had to nurse a battery back to life by lying to the charger about what kind it was (there’s this thing called an undervoltage warning, which basically means “your battery is too deeply discharged to recharge safely using a standard charging cycle”) and spending a couple days in really low trickle charge, I decided that my circuit needed some kind of low-battery warning.
Well, that seems pretty easy: wire up a Tiny85, put in a voltage divider to read the battery voltage with the analog-to-digital converter, write some code to blink a warning LED when it goes too low, or maybe even use a pin from the Tiny to power the rf switch and hold it high only so long as the battery is good, or maybe a big power transistor to turn the whole circuit off, because even the voltage regulators will eventually drain the battery dead. If there’s not enough space on the protoboard I can just solder on a daughtercard.
Or maybe I’ll do that on the next lamp I build. This time I just coughed up the three bucks to add a low-battery-warning board to an order of servos and stuff from Hobby King. Yes, those piezo buzzers are incredibly loud, but not so much when you squirt a dollop of household caulk into them.