Hi guys,
if you enjoyed the previous post solar-powered Arduino board, you should keep reading this one as well to improve your solar power generator. In fact, with that setup the 9V battery would decay too soon: A NiMh (Nichel – metal hydroxide) battery must be recharged with a constant current generator, a solar panel alone is not.
In order to do so, we can assemble a quite simple circuit using the following components:
- LM317M or LM317LZ
- A 200Ohm trimmer
- 10Ohm resistance
- A LED to check if the current is actually flowing
The core of this circuit is the integrated three-terminal adjustable linear voltage regulator LM317. The ‘adj’ pin is a control terminal that is used to adjust the output current. So, the trick is to use a variable resistor (in our case, a trimmer with a small resistance put in front of it) to set the current at a definite value.

Constant current generator with a LM317
With an input DC voltage of max 24V, and the resistances shown in the diagram, one can obtain an output current of:
I_out = 1.2/(10 + R_trim) [A]
This current must be less than 1/10 of the battery output, e.g. for a 750mAh battery the output current must be less than 75mA. As usual, it is customary to insert a capacitor (100uF should be ok) in parallel at the input node to smooth out fast-varying voltages.

Pin diagram of a LM317LZ