Wednesday, December 24, 2008
arduino Battery Charger
I was a bit disappointed when I found out my new $150 bike light could not charge itself. Apparently you are supposed to unplug it when it gets warm to the touch, but not to leave it plugged into long because this will ruin the battery! This seemed like a problem for the arduino!
The plan was to use the power from charger itself to power the arduino. This caused a voltage drop of 3 volts, meaning longer charging times. Since I need this daily for my commute, this would not do.
The next version used two power supplies, one for the arduino, one for the charger. This is a bit ugly, but works fine. Both wall warts are plugged into a three way to make it easier to unplug.
The real hurdle was controlling the higher charging voltage with the 3V arduino. The opto-isolator I used initially would not allow enough current to charge the battery. Next was a home-brew isolator that consisted of a photo-resistor and a led taped together. Still not enough current. I finally picked up a 1 A relay from RadioShack. This worked!
The final design uses two LM35 temperature sensors I found on ebay, to compare ambient temperature to the battery temperature. When the temperature delta exceeds 15 degrees F for 10 minutes the charge is considered complete. If at any time the battery temperature exceeds 95 degrees F, power is removed from the battery and no restart occurs.
Here is the schematic and source code. Be sure to wire up the LM35 temperature sensors according to their documentation; if they heat up you have it backwards!