Home » Battery Charger » Simple Solar Battery Charger Circuit

Have a Question?

Please feel free to ask any circuit related question and get a quick solution from me.

Simple Solar Battery Charger Circuit

The post explains a simple solar battery charger circuit using the IC LM338 which can be built and installed by even a layman for achieving the intended results.

Solar panels are not new to us and today it’s being employed extensively in all sectors. The main property of this device to convert solar energy to electrical energy has made it very popular and now it’s being strongly considered as the future solution for all electrical power crisis or shortages.

Solar energy may be used directly for powering an electrical equipment or simply stored in an appropriate storage device for later use.

Normally there’s only one efficient way of storing electrical power, and it’s by using rechargeable batteries.

Rechargeable batteries are probably the best and the most efficient way of collecting or storing electrical energy for later usage.

The energy from a solar cell or a solar panel can also be effectively stored so that it can be used as per ones own preference, normally after the sun has set or when it’s dark and when the stored power becomes much needed for operating the lights.

Though it might look quite simple, charging a battery from a solar panel is never easy, because of two reasons:

The voltage from a solar panel can vary hugely, depending upon the incident sun rays, and
The current also varies due to the same above reasons.

The above two reason can make the charging parameters of a typical rechargeable battery very unpredictable and dangerous.

But thanks to the modern highly versatile chips like the LM 338 and LM 317, which can handle the above situations very effectively, making the charging process of all rechargeable batteries through a solar panel very safe and desirable.

The circuit of a simple solar battery charger is shown below, using the IC LM338:

Simple solar charger circuit using IC LM338 with current control feature

The circuit diagram shows a simple set up using the IC LM 338 which has been configured in its standard regulated power supply mode.

The specialty of the design is that it incorporates a current control feature also.

It means that, if the current tends to increase at the input, which might normally take place when the sun ray intensity increases proportionately, the voltage of the charger drops proportionately, pulling down the current back to the specified rating.

As we can see in the diagram, the collector/emitter of the  transistor BC547 is connected across the ADJ and the ground, it becomes responsible for initiating the current control actions.

As the input current rises, the battery starts drawing more current, this build up a voltage across R3 which is translated into a corresponding base drive for the transistor.

The transistor conducts and corrects the voltage via the C LM338, so that the current rate gets adjusted as per the safe requirements of the battery.


  1. Hi, Your blog is very cool. I'd like to contact you privately about a possible opportunity and can't seem to find a way to message you on this site. Do you have an email I could use or another way I can message you. Thanks!

  2. Swagstram,
    Is the emmitter "floating", or is the solar panel negative not commoned with the battery negative. If they are commoned then the transistor will not do it's job.



    • Richard,

      As shown in the figure the solar panel negative is connected with the negative of the circuit which includes the emitter of the transistor also.

      The battery negative is taken after the current sensing resistor so that the required over current is detected by the transistor.


  3. Sir, if battery is not disconnected manually after full charge , whether battery becomes over charged or charging stops after full charge?
    Sir, as R3 =0.7/ charging current , how can i get some non standard value of resistors? Could i use variable resistors?

    • Battery will get overcharged, you will have to remove it manually when the meter reads zero volts.

      You can adjust the value by adding a few resistors together in parallel or in series to reach the approximate value.

  4. When the ammeter reads zero at the full charge of battery, then how it further charges to get over charged ? As the ampmeter reads zero means no current i.e. No charging am i right sir?

    • The battery is not consuming any current because it's trying to obstruct the charging process, but the voltage from the charger is forcing the battery to get charged and therefore slowly after many hours the battery voltage will keep rising, crossing the danger mark and dangerous chemical reactions will start taking place inside the battery, reducing its life and efficiency.

  5. SIR, What happens if i charge 12 volt 3 ah lead acid battery by giving exact 13.7 volt dc through LM 317 continuously i.e. unattended for more than 2 days? Charging current is 0.3 amps
    1. Whether the 12 volt battery charges or not ?
    2. Whether the battery over charges i.e. Whether the battery voltage raises more than 13.7 volt ?
    3. Whether Charging stops after the battery will attain 13.7 volt ?

    • 1) Battery will get charged within 14 hours.
      2)Battery will slowly get overcharged and its life will deteriorate. Battery voltage will not reach above 13.7V but harmful chemical reactions will start taking place inside the battery.
      3) Charging process will not stop and the battery plates will start getting damaged slowly.

    • Unless battery voltage will not reach above 13.7 volt, how the harm full chemical reaction starts to deteriorate the cell? Because normally 13.8 or above up to 14 volt is taken as full charge for 12 volt battery , under charging

  6. Sir, as the battery voltage does not reach above 13.7 ( as you replied), then no chance of harmfull reaction. Isn't it? Ok, if it starts in 13.7 itself, what happens if i decrease the charging voltage as , say 13.5 volt. And even charging current also i.e. Say 200 mili amps. I know the charging is very slow. My aim is to find out whether battery become over chargied or not , in certain charging voltage and current condition, even in absence of auto cut off. Give your opinion

    • If you reduce the voltage, the battery will attain only 75% charge but yes the battery will not get over charged.

      The right process is to charge the battery with high current up to 14.4 volts then switch the charging to very low current and continue for another few hours and then shut off the power, in this way the battery will reach at least 90% of its capacity.

  7. A series diode at output is needed to avoid battery discharging or LM damage when no input voltage at regulator..the only thing that was missed here.

  8. Hello Sir,

    In most of the panels, the Open circuit voltage, Voltage at maximum power and voltage at rated load are given. But I want to know whether the panel voltage drops to 10 volts, 9 volts or below which, I think can not be used to charge a 12V battery.

    I want to know whether a circuit can be designed to upscale the voltage in that situation to charge the battery however with small current. Or, is the circuit you have given here capable to do that?

    Incorporating the feature in the charger circuit would be best to use the maximum possible energy produced from the panel.



    • Hello Gyanendra,

      As far as I know, as the voltage drops, current also drops in solar panels with decreasing sunlight…..though there are ways to step up or boost the voltage using boost converter circuits, the current will decrease proportionately and will be adequate may be just for trickle charging purpose of the battery.


  9. good day sir! i dnt understand R3=2R3. can you please explain sir. please. i have no idea. hope you understand. im carrem from the philippines.

    • Good day Carrem, actually R4 is not required according to me. R3 is sufficient, however in the datasheet both these resistors are included so I have provided exactly what's given in the datasheet of the IC338.

  10. hi sir i want to clear one thing i am looking for this type of batter charging ckt but i need auto cut-off ckt for this can u help me. are any reference

    i want develop my self but i dont have any guidance i hope u can help me

  11. Good evening Sir
    I'm trying out your circuit which was previously posted and that circuit resembled the same like the above but 'dint have a diode' at the pin out of LM338 to the battery negative? so what diode should I place here?
    Then Sir I'm using LM317 , so please tell how to preset adjust to 7v at output? Please help me as I'm doing my undergraduate project in 'construction of solar panel regulator'.
    Thank You Sir

    • Hello Sasikala,

      The diode prevents the battery from getting discharged in the absence of voltage from the IC or from the solar panel, so it is a must.

      LM317 and LM338 are similar with their operations, for 317 also you would have to adjust the given preset P1 to get the required voltage at the output.

    • The diode current value will depend on the specified charging current at the output, same for the values of the resistors, calculate it using the given formula.

  12. Hello Sir,

    I am a bit confusing in selecting the right solar cell.
    I have a small 12v 18AH battery. Please tell me the specs of solar panels, like volts and watts.
    Also please give me the formula to calculate it with different ratings of batteries.

    Thank you so much.


  13. THANK YOU SO MUCH SIR .. I got the output and as you have already said that using LM317 will limit the output to 1 Amp. How can I utilize this 1 Amp current Sir?

    I'm so happy the I have completed the circuit Sir. Thank you so much and all the conversations helped me gather information. Thank you users for giving your views… Thank you once again Sir.

    • You are welcome sasikala!

      you may use it for any circuit application like for driving LEDs, for charging a battery etc.

      to be precise the IC will limit anything above 1.5amps, but you can set R3 for any desired current of your choice.

  14. sir i did this circuit and using for 100watts panel the voltage is regulated and output is ok but the LM338,TIP36 and all other components including resistors were getting too hot with in a minute. why? will this affect circuit components.

  15. hello sir,

    can i use this cct for a small scale wind turbine which gives an output ranges from 5V to 15V?… i need to charge a battery using that. so please help me on this sir.

    • hello Rizmy,

      you may use it to get a fixed maximum voltage output as per the setting of the preset, but you won't get any voltage boost from this circuit.

  16. sir,how can we increase the current at the output if the output voltage is 6.52 but in my case current is too low?

  17. sir,
    I want to design a solar battery charger,all components should be SMD type and my aim is to reduce PCB size as much as possible…pls help me…

    • Erns, R4 is not needed, you can remove it.
      the ideal charging current of a 12V 7ah battery is around 1amp.
      the diode is for preventing accidental polarity reverse conditions at the input.

  18. Thanks sir i have assembled all the components except this resistor…. taking your suggestion i will progress the circuit and tell you about the output ….
    Sir do you have a of DC 12v to 18v or 24v DC converter circuit i am not not getting this in your site…can you please help me…once again thank u …

  19. Sir, i have 70Ah 12volt battary and i'm about to buy 100Ah solar panel to charge it. there need to be solar charging system(circuit)? could i connect battary directlly from solar panel for charging? it will harmfull for battary?

    • Dev, solar panel current is not rated with AH, its rated with amps….a controller can be avoided by selecting a correctly rated solar panel for the battery.

      for a 12V 70ah battery use a 18 V, 10amp solar panel….18v is the peak rating of the panel and 10amp is the short circuit current of the panel

  20. actually i want to make charging my 24 volt 1.5 Ah battery to supply 24 volt, 600 mA STEPPER MOTOR…..
    is this possible from 12 volt 250 mA solar panel using 12-24 volt boost converter???

  21. Hi sir,
    I realised the circuit of this article but I can manage only the voltage at the output with the potentiometer, not the current. What could it be wrong? I didn't put the R4 and I switched the multimeter as ammeter and connected it in series the output of circuit with the battery.

    • Thanks, I really appreciate your help, the circuit works, finally! 😉 I have just one more question: there is any ways to evaluate the charging current? I have two batteries in parallel, one is 10Ah e another one 4.5Ah. The solar panel produce 1,7A and the R3 is 0.47ohm. I guess I made the correct calculation but I would check the real current that pass on the circuit. Any suggestions? Thanks in advance for any answer 🙂

    • Thanks Daniele,

      Usually it's AH/10 for lead acid batteries and AH/1 for Li-ion batts, but if you have two batts in parallel with different AH rating in that in case you may have incorporate separate current limiting circuits for each batts.

      You may have to make two of the above circuits, and calculate R3 separately in order to feed the respective batts…the ground will be common for both the circuits.

  22. Hi sir
    I wanna ask if i can use this circuit to charge a 12v 40W lead acid battery ti powerup an LED lamp during the night. I'm planning to use this for a streetlight.

  23. sir can you explain the role of each component in the circuit? i wanna understand how each of them function.. and how did you come up with the computation R3=0.7/chg. current? thank you so much sir!

    • The upper resistors are as per the IC datasheet…the BC547 is responsible for grounding ADJ pin of the IC and disabling it when an over current is sensed, and this happens when the potential across R3 exceeds 0.7V which is the switch ON (saturation) voltage of the transistor

  24. sir what is the maximum Ah that this circuit can handle? and can you teach me how to add an overcharge protection circuit to this one because i need the circuit to automatically stop the charging when battery is full.. thank you

  25. correct me if I'm wrong sir, but you're assuming that the battery is rated @10 hr. I will be using a battery that will be rated @20 hr, so i can use a maximum of 100Ah because 100/20= 5A, which is the maximum output current of LM338..

    • I don't know if a lead acid battery can be charged at AH/20 or C/20 rate, so I can't say much about this calculation…C/10 is considered as the minimum optimal range for charging lead acid batts.

  26. ok sir i'll research more on that.. anyways can I use a 24V 50W panel to charge a 55Ah 22V battery, by the way the battery will supply a 12V 45W LED Lamp.. what's your opinion about this sir?

    • for a 12V battery a 50 watt panel can be used, but the panel peak voltage should not be above 15/16V for an optimal response,

      yes the above circuit will just fit in.

  27. sir this is the current setup of the project..
    12V 50W solar panel to charge a 12V 40Ah lead acid battery, the load will be 12V 24W LED lamp
    what are your thoughts about these adjustments? and can the circuit above can charge a deep cycle battery? thank you so much sir for answering my questions

    • yes a 12V 50 watt panel can be used for charging a 12V 40AH deep cycle battery, but will require around 10 hours to get fully charged.

      a 12V panel during peak should be producing 15 to 16V, so according to me you can connect it directly with the battery through a 6A4 diode…the above circuit may not be required.

  28. for the current rating of the solar panel (12V 50W), what do you suggest I use sir? a 12V 40Ah lead acid battery or a deep cycle battery?

    note: the battery should be able to supply enough power to the LED lamp for the whole night (12 hours at most). thank you sir

    • deep cycle batteries are also lead acid batteries, so you can use a 40AH lead acid battery for the said purpose.

      The mentioned 24W lamp can be operated for not more than 6/7 hours at stretch with a fully charged 40AH batt.

    • input voltage is 32 max, current doesn't matter it can be anything as long as volatge is within 32V.

      the max output current can be set anywhere from 0 to 5amps by selecting different values for R3 as per the calculations

  29. Hello sir. I would like to use the above circuit to charge a 3.7V 1500mAh mobile phone battery, with a 12V 5W panel. Can you please let me know the changes needed to be done to the circuit?

  30. sir i'm having problems with the circuit.. I tried. to construct this circuit in smaller scale so I bought a 12V 10W solar panel to charge s 6V 4.5ah battery. I used lm317 and I eliminated the transistor part because I want to see the output voltage first. But then the output voltage i'm getting is only up to 1volt. I checked the output voltage from the solar panel alone and its 7V. sir what am I doing wrong here? I haven't tried to put the panel under sunlight because it is cloudy here so i'm just testing it under indoor light.

  31. it's okay sir.. I just tried to put the panel under outdoor light even if it's cloudy.. now i'm getting up to 12V from the circuit.. I guess it makes a huge difference when you're testing it indoor.. now the problem is the output voltage keeps changing whenever I move the panel from different locations.. I adjusted the circuit to produce 7V but it keeps changing when I move the panel.. I thought this circuit will produce constant voltage once I adjusted the potentiometer regardless of the varying input voltage from the panel.. sir what is wrong here?

    • Yes the IC must produce a perfectly constant voltage regardless of a changing input.

      Check and confirm the circuit first with a variable DC power supply and see the response.

  32. sir what should be the minimum input voltage from the panel so I can constantly produce 7V from the circuit using lm317? and what should be the minimum input voltage from the panel so I can achieve 14V from the circuit once I used the lm338?

  33. then it makes sense when the output voltage changes because the input voltage gets lower from the solar panel.. sir do you have any more circuit that can produce constant output regardless of the changes in the input?

  34. ok now I understand thank you sir.. anyways sir can I request for your insight on how to calculate the approriate battery and solar panel for our 12V 24W LED Lamp that should stay on for a whole night.. I just wanna have a concrete basis for picking the battery and panel..

  35. sir i'm a bit confused.. i followed all the calculations and it said I need at least a solar panel of 30W and a battery of 20Ah.. but you said before for a 24W lamp I will need a panel of greater than 50W and a battery of more than 40Ah.. sir please explain thank you

    • you might have calculated wrongly….a simple way is to divide 30 by 12, it gives 2,5A, how can a 2.5A charge a 40AH battery within 6 hours, it would take about 18 hours at that rate.

      a 24 watt lamp will consume 24/12 = 2amps…so with a 40AH batt we get 40/2 = 20hours ideally but it would be just approx 12 hours practically

      so you will have to charge a 40AH battery fully for sustaining a 24watt lamp for about 12hours

  36. hello again sir! i finally implemented the above circuit. I used a 100W solar panel to charge the 40Ah battery. First I used the battery to power the lamp and it dropped to 8V. I think the charging works fine because from 8V, the circuit was able to charge the battery to 13V. The problem now is that the battery is quickly draining, dropping to 8V after 2 hrs of supplying power to the 24W led lamp. The lamp still stays on but I think that should not happen to the battery dropping off too quickly. What would be the problem here?

  37. sir is that why the battery is dropping so quickly? also we also connected a regulator ic which is 7805 to bring down the voltage to 5V for our microcontroller, is 7805 also a factor why the battery is dropping? thank you sir

  38. also sir is it ok if I connected a dark sensor circuit parallel to the battery so the led lamp will automatically switch on at dusk? If yes, will it affect the charging process because the output current from the above circuit will be divided for the battery and sensor circuit?

  39. sir i'm still thinking if I should remove the relay in the circuit.. the setup now is that the relay serves as a switch for the sensor circuit, if the battery is in charging process the relay trips and the sensor is disconnected from the circuit so the charging current is divided to the battery amd relay.. if I do remove the relay the charging current will be divided to the battery and sensor circuit, however, the sensor circuit is composed of a voltage regulator, ATtiny mmicrocontroller, op amp, and a power mosfet for the LED.. I know the sensor circuit is quite large so it will really require a sufficient amount of current than the relay I think.. what would you do here sir?

    • Nine, the sensor circuit is not supposed to consume more than 5 to 7mA and the relay not more than 30mA….so it's your wish now whether to use the circuit or not as per the application needs.

  40. sir do you know any current amplifier circuit that i can use because the output current from the circuit is very low, i recorded 200mA as the highest current that the circuit can supply so far which is not enought to fully charge the 40Ah battery. The panel is rated 100W and current peak is at 5.61A but it only supplies about 400mA input current to the LM338.

    • Nine, a current amplifier is out of question here….if your 100 watt panel is producing 400mA simply means it's faulty or something may be wrong with the connections….or if this happening after the LM338 IC stage would indicate a faulty or incorrectly wired LM338 IC….please check all these individually to confirm the results.

  41. Sir Swagatam can this circuit charge a lithium ion battery? Im looking for a solar charger that can charge a lithium ion battery pack with overcharge protection .. thank you very much for your help sir..


  42. Hello Sir,
    I have to charge 12v 2.2Ah Li-Ion battery using Solar pannel, will u suggest me what type of solar pannel should i use and what is the power, voltage, and current rating of pannel…

Leave a comment

Your email address will not be published. Required fields are marked *