Feed on
Posts

## Simple LM317 Solar Charger for 12V batteries

I’ve had a small solar panel now with a voltage of up to 18V (up to 83mA current) for a little while so it’s now time to make a small solar power charger to recharge 12V batteries. Previously I had a solar panel with a voltage of up to 14V which didn’t cut it when the sun was shinning on it for a few minutes; I found the voltage dropped and it wasn’t enough to recharge my 12V batteries.

I chose to use the LM317 regulator as it seems to be a common regulator to use for small current devices. With the LM317 you can adjust the output voltage ranging from 1.2V to 37V by using 2 resistors on the adjust pin.

The primary use of this charger is to keep my 12V batteries topped up. From Wikipedia we find that voltage to keep batteries topped up is called the Continuous-preservation charge which is 13.2V.

Before we go and set the LM317 output voltage to 13.2V we need to include a diode on the output to protect the battery from supplying voltage to the LM317 when the sun isn’t shinning and it will also protect us against a short circuit between input and ground. Now because we have a diode on the output, we could easily add more batteries to keep topped up by adding a diode to each battery.

I chose a schottky BAT42 diode and you see a 0.15V drop at 3uA (tested) and then it increases to 0.7V at 100mA.

The output voltage of the LM317 will be 13.2V + 0.7V (worst case) = 13.9V. The LM317 has a drop out voltage of 1.75V @ 100mA so we require minimum input of 15.75V but we’ll round that up to 16V.

To calculate which resistors to use there is a LM317 Voltage Calculator website that can help us out.

The R1 common resistor value to use is 240ohms and the R2 value is 2429ohms which we can round up to a 2.43K resistor.

Now we just need to calculate the power dissipation, let’s say 20V is our maximum input, we drop to 13.2V. The drop on the regulator is 6.8V and say my solar panel outputs 80mA so it’s 0.544mW which is lower than the 625mW of the TO-92 package so we are all good.

After leaving a 12V car battery and a 12V sealed battery on for a 2-3days, it recharged the battery voltage to 12.35V which gives us about 75% capacity according to Wikipedia, so it seems to work good enough.

### 12 Responses to “Simple LM317 Solar Charger for 12V batteries”

1. bernard says:

am interested in a voltage regulator for my car battery being charged from a solar panel. i like the circuit here but will it disconnect in the event of full charge

• Alex says:

Hi, it won’t disconnect but if your battery is fully charged it will just keep your battery topped up.

2. […] decided to build a solar charger for his car battery. He had an 18V solar panel able to provide up to 83mA. You cannot connect panel […]

3. Danny says:

Hi I need to charge a single 1.5v cell I have a 3v powerfilm solar panel @ 12ma will this blow the batt on continuous charging?

• Danny says:

or i can use 2 in series if i need more voltage for the lm317 because of dropout

• Danny says:

have managed to do it thanks, I wonder if you can help me put my project down in eagle ready for boards to be made from the makers. I will pay you for your time and my project isnt very hard at all just I am no good using eagle Please let me know dlowe5150@gmail.com

• Alex says:

Hi Danny,

The single 3V solar power may just be enough to charge the battery but only when the sun is directly shining on it. Otherwise as you suggest you may need to wire 2x solar panels in series. Wikipedia states that the charge voltage should be 1.4 to 1.6V and you should be fine if your charge current is less than mAh / 40, according to Energizer. E.g 2200mAh / 40 gives 55mA charge current.

hello. i have 35 watt solar module .it gives 20v Voc and 1.8 amp max current Isc on brightest sun light can i use lm317 for this circuit.
i hope lm 317 withstands upto 2.2 amp max output current .thanks for any suggetions

• Alex says:

Hi Kasi,

It depends on the LM317 you buy, the one I had is a TO-92 which can only do 100mA. You definitely want a TO220 package with a small to medium heatsink but still some LM317 can only do 1.5A or 2A, so I would buy 2 of them and have them running in parallel if you really want 2.2A.

You could also look into the LM338 which can do 5A in TO220 package.

5. david says:

I built this to charge a battery unattended with 980ohm and 9800ohm resistors. This ends up at ~13.7 volts. Can I leave this on forever? It’s a 12v 7ah battery and a “12v” (18-20v when open circuit) 10 watt solar panel.

• Alex says:

Hi David,

Yep that voltage is fine, for charging the voltage range is 13.2 to 14.4 V

6. […] decided to build a solar charger for his car battery. He had an 18V solar panel able to provide up to 83mA. You cannot connect panel […]