Electronic – Building a Battery Charger with an LM317


I was told that i could make a simple battery charger from a LM317 and a resistor to charge some Ni-MH Batteries. Can someone just expand on this a little such as how it works as I don't really understand it. Some more information is that there are 12 AAA batteries that hold a charge of 1000mAh and 1.2v per cell.

Best Answer

This page apparently describes a LM317-based charger with auto-shutoff, though it has a few more parts than a resistor.

At the most crude, you can use an LM317 and resistor to form a regulated current source, which is how NiMH/NiCd's should be charged. See "Precision Current Limiter" (p. 19) on the LM317 datasheet. The regulator functions as a current source by attempting to supply as much current as possible to have Vout - Vadj be 1.25 V.

Note that there is nothing inherent in the LM317 to shut off a charge, so if the batteries are fast-charged (~C/2 or higher), they will fail if you do not terminate the charge at the appropriate time. With a trickle-charge (C/20), you "can" leave them alone with no ill-effect.

So in your specific case, the 2-part charger would be a LM317 and a resistor to charge the pack at C/20.

  • Charge rate: 1000 mA·h @ C/20 => 50 mA
  • Resistor value: 1.25 V / 50 mA = 25 Ω

You need to provide a voltage to Vin at least 2.0 V (dropout voltage) + 1.25 V (reference voltage) = 3.25 V greater than the maximum charging voltage. The resistor would be connected between Vout and Adj, and your load is connected to Adj (not Vout)