In this article we study a simple 3.7V li-ion battery charger circuit with auto-cut off, which can be charged from your computer USB port or any other 5 V regulated source.
How it Works
The circuit can be understood with the help of the following description:
The IC LM358 is configured as a comparator. The IC LM741 is not used since it is not specified to work with voltages lower than 4.5V.
Pin#2 which is the inverting input of the IC is used as the sensing pin and is attached with a preset for the required adjustments and setting.
Pin#3 which is the non-inverting input of the opamps is reference at 3V by clamping it with a 3V zener diode.
A couple of LEDs can be seen wired across the output pin of the opamp, for detecting and indicating the charging condition of the circuit. Green LED indicates the battery is being charged while the red illuminates as soon as the battery is fully charged, and supply is cut off to the battery.
How to Charge using USB Port
Please remember that the charging process can be quite slow and may take many hours, because the current from USB of a computer is normally very low and may range between 200 mA to 500 mA depending on which number port is used for the purpose.
Once the circuit is assembled and set up, the below shown design can be used for charging any spare Li-Ion Battery through the USB port.
First connect the battery across the indicated points, and then plug in the USB connector with your computer's USB socket. The green LED should instant become ON indicating the battery is being charged.
You can attach a voltmeter across the battery to monitor its charging, and check whether the circuit cuts off the supply correctly or not at the specified limit.
Since the current from a computer USB can be quite less, the current control stage can be ignored and the above design can be much simplified as shown below:
Video Clip showing the automatic cut off action, when the Li-Ion cell is charged upto 4.11V:
Please note that the circuit will not initiate charging unless a battery is connected prior to power switch ON, therefore please connect the battery first before connecting it to a 5 V supply source.
An LM358 has two opamps which means one opamp is wasted here and remains unused, therefore LM321 may be tried instead to avoid the presence of an idle unused opamp.
How to Set up the above 3.7 V Li-ion Charger Circuit:
That's extremely easy to implement.
- First, make sure the preset is moved at the ground side fully. Meaning, the pin#2 should be at ground level through the preset initially.
- Next, without any battery connected, apply an exact 4.2 V across the +/- supply lines of the circuit, through an accurate adjustable power supply.
- You will see the green LED coming ON instantly.
- Now, slowly rotate the preset, until the green LED just shuts OFF, and the RED LED switches ON.
- That's all! The circuit is now all set to cut off at 4.2 V when the actual Li-Ion cell reaches this level.
- For the final testing, connect a discharged battery to the shown position, plug-in the input power through a 5 V source, and have fun watching the cell getting charged and cut-off at the stipulated 4.2 V threshold.
Constant Current CC Feature Added
As can be seen , a constant current feature has been added by integrating the BC547 stage with base of the main BJT.
Here the Rx resistor determines the current sensing resistor, and in case the maximum current limit is reached, the potential drop developed across this resistor quickly triggers the BC547, which grounds the base of the driver BJT, shutting down its conduction and charging of the battery.
Now, this action keeps oscillating at the current limit threshold, enabling the required constant current, CC controlled charging for the connected Li-ion battery.
Current Limiting not Required for USB Power
Although a current limiting facility is shown, this may not be required when the circuit is used with an USB since the USB already is quite low with current and adding a limiter may be useless.
The current limiter should be used only when the source current is substantially high, such as from a solar anel or from another battery
Improving the Circuit Further
After some testing it appeared that the Darlington transistor was unable to switch sufficient current to a Li-Ion cells, especially which were deeply discharged. This resulted in a difference in voltage levels across the cell, and across the supply rails of the circuit.
To combat this issue, I tried to improve the design further, by replacing the single Darlington BJT with a pair of NPN/PNP network, as given below:
This design improved the current delivery significantly, and resulted in a reduction in the margin of difference between the battery terminal voltage level and the actual supply voltage level, and therefore false cut-off switching.
The following video, shows the test result using the above circuit:
Adding Current Control to the above Design
Using a 5V Relay
The above designs can be also built using a 5V, which will ensure the best possible current delivery to the cell and faster charging. The circuit diagram can be seen below:
Please Note:
This article was substantially changed recently and therefore the older comment discussions may not match with the circuit diagram shown in this present updated design and explanation.
Another Ideal 3.7 V Battery Charger Circuit with Auto Cut-off
Here's a 3.7 V Battery charger circuit which looks perfect in for the automatic cut-off and a self-monitoring of the 3.7 V battery.
In the relay based circuit previous to the above design, there seems to a serious drawback.
In the previous design the battery needs to be connected first, before applying the input power. This is crucial, otherwise the relay can start chattering, if the power is switched ON first without a battery connected.
But in the above new design where the battery can be seen connected on the left side, the chattering of relay problem is completely eliminated.
Moreover, this design has an added advantage. The circuit will be able to continuously monitor the battery level and self-regulate the circuit to ensure that the battery is automatically disconnected when it reaches full charge level, and automatically connected to the supply when it is discharged to some lower level.
The input supply can can be from any 5V regulated source. However make sure the current spec of the supply is restricted to 0.5 C. Meaning the current of the 5V source must not be 50% of the battery mAh value.
How to Adjust the Preset
The auto cut off preset setting up is easy.
Initially, do not connect any battery or the input supply, and rotate the preset wiper to the ground level.
Next, take a variable DC power supply. Adjust its output to precisely 4.1 V, which is the optimum full charge level of a standard 3.7 V battery.
Connect this supply to the circuit from the left side, across the points where the battery is supposed to be connected.
You will see the GREEN LED illuminating. At this stage the relay must switch ON, however it won't since there's no 5V supply from the right side of the circuit. No worries, we can still setup the circuit by looking at the LEDs.
After this, slowly adjust the preset until the GREEN LED just switches off and the RED LED just switches ON.
That's all, the auto cut off set up is complete for the circuit.
Now, to test the circuit LIVE, you can connect a discharged 3.7V cell across the indicated points, and a 5 V supply from the relay side and see the actually cut-off happening, as soon as the battery is fully charged at 4.1 V.
Anto Das8 says
What can be the substitute for the 150E resistor in the project in the link
https://www.homemade-circuits.com/wp-content/uploads/2024/11/3.7V-auto-cut-off-battery-charger-circuit.jpg
Swagatam says
There is no substitute for this resistor, you can make it by adding a few assorted resistors in series parallel, slight difference is OK…
Anto Das8 says
Which circuit (in your opinion) is best in factors like time taken for charging, safety
Swagatam says
The following circuit is the best:
https://www.homemade-circuits.com/wp-content/uploads/2024/11/3.7V-auto-cut-off-battery-charger-circuit.jpg
Anto Das8 says
Can we use a 1.67A Samsung adaptor
Swagatam says
Yes, definitely you can use it…
Nelio says
Hi,
Does these circuits only work in fully empty batteries, 0V?
I assembed the 3rd circuit, for the 4th time, calibrated, with the preset at ground level (0homs), turn it on, green LED was on, move the preset until red LED becomes on, turning OFF green LED.
Connected a battery with only 2.3V, plug it to a 5V DC adapter and the red LED came ON, implying that the battery was charged….
Swagatam says
Hi,
The circuit can be used to charge any 3.7V battery discharged below the set level (4.1V).
While setting up the preset, the supply input to the IC must be exactly adjusted at 4.1V.
I hope you have connected 1uF at pin#2.
Also, the input power supply current must be rated at 50% of the battery Ah.
If you are having difficulty setting up this circuit you can try the following one:
https://www.homemade-circuits.com/wp-content/uploads/2024/11/3.7V-auto-cut-off-battery-charger-circuit.jpg
Nelio says
Hi,
When you say preset to the ground, means that the resistor value between the center point and ground is 0 (zero).
Right?
If that is so, meassuring between the entry point of the adjustable resistor and the center point is about 3K, leaving 7K between the center point and ground.
Nélio Abreu
Swagatam says
Hi Nelio,
Yes, that refers to resistance value between the center point and ground, which should be 0 (zero).
This is to be done during the setting up procedures of the preset. initially we must keep the preset fully towards ground and then slowly adjust it until the LEDs just changeover. This sets up the op-amp cut-off threshold.
There’s no need to measure the preset resistance, you can confirm the changeover through a variable power supply voltage and LED switching.
Nelio Abreu says
Hi, Swagatam,
I’m currently testing the 2nd circuit, with 2 minor changes:
Using TIP41C and without the base resistor and so far is working fine.
The 3rd circuit didn’t work
Best Regards.
Nélio
Swagatam says
Hi Nelio,
A base resistor is strictly recommended for all BJTs, so please do not remove the base resistor.
The 3rd circuit should work, because it has been tested by me, you can see the adjoining video.
However, here’s another design which is very basic and very good, and virtually failproof, you can try it:
https://www.homemade-circuits.com/wp-content/uploads/2024/11/3.7V-auto-cut-off-battery-charger-circuit.jpg
Nelio says
Hi, the LED in the failproof circuit, is what? Charging LED or Charged LED?
How to I set the trimmer?
Best Regards.
Nélio
Swagatam says
That LED indicates the battery is Charging, when it is shut-off means battery is fully charged.
To ensure that the LED does not blink ON-OFF at the threshold, you can connect a 100uF capacitor across the pin#2 of the IC, and ground.
Gee says
Hi Swagatam,
Thanks for all the work you do here to help us all out.
I have a couple questions:
Thanks,
-G
Swagatam says
Thank you Gee,
1) Yes, the last circuit can work with a solar panel. You can use any solar panel between 9V and 36V and use a 5V buck converter to optimize the solar panel output to 5V and then feed this 5V to the op amp circuit.
2) You can charge any number of batteries in parallel depending on the buck converter capacity.
Hiette says
il manque l’indication de la valeur de la résistance concernant la diode verte , est-elle
aussi de 1k ohms ? Merçi
Swagatam says
Yes, the resistor connected with the green LED can be also 1k, but if you find the brightness low then you can decrease it to 470 ohms.
Nelio Abreu says
Hi Swagatam,
Is there a possibility that you have the LED’s identification wrong?
I mean, When it says Full should be charging and vice-versa.
Swagatam says
Hi Nelio,
The LEDs are correctly configured to identify the results.
Initially when the battery is low, pin2 voltage is lower than pin3, so the output pin1 is high causing the green LED to illuminate and red to remain shut off.
When the battery is fully charge, the pin2 voltage becomes higher than pin3 voltage, causing pin1 to go low and the RED LED illuminates and the green is shut off.
So as per the above functioning the LEDs are labelled correctly.
Nelio Abreu says
Well that’s not that is happening in my circuit. When I connect the circuit with Battey in it, the RED LED (in your schematic) is ON and the green OFF (in your schematic)
Swagatam says
That means you have either connected the pin2 and pin3 oppositely, or your preset adjustment is not done correctly.
What happens when you check with a power supply?
If the power supply result works then the battery result should also work.
You can see the video it worked perfectly for me.
Nelio Abreu says
With my PSU the result is the same. However it’s is charging, although I don’t if it’s correct.
I have an imagem but I can’t share it with you since your blog don’t allow it.
Swagatam says
The opamp comparator works with a simple principle. When the battery is connected and power is switched ON, the battery immediately SINKS the current and causes the voltage to drop to its discharged level. When this happens the pin#2 voltage becomes lower than pin#3. So this is the crucial aspect. In your circuit when you switch ON power with the battery connected, is the pin#2 voltage dropping below pin#3???
This must happen, If this does not happening then the RED LED will never shut off.
If with PSU the same is happening then you might be missing something with the setting up procedure. Please follow the steps as explained under How to “Set up the above 3.7 V Li-ion Charger Circuit”
If you are having problems with the above circuits, you can try the following alternative design. For setting up, please replace the battery with the input DC from a variable power supply. Adjust the voltage to 4.1 V, keep the preset wiper arm to ground level, initially the RED LED will remain illuminated, now slowly adjust it until the LED just shuts off. Setting up is finished.
https://www.homemade-circuits.com/wp-content/uploads/2024/11/3.7V-auto-cut-off-battery-charger-circuit.jpg
Nelio Abreu says
I’m currently testing the 3rd circuit with 2N2907 and BC547. The results are the same. RED LED (in your schematic) is ON and GREEN LED if OFF.
Nelio Abreu says
Hi Swagatam,
I have assemble the 2nd circuit, calibrat it.
Put a 3.7V Li-Ion battery, type 16340 of 4800mAH to charge, connect a 5V adapter of 1A of current maximum output.
Left the battery there to charge with a capacity monitor and it hasn’t stop charging, after 2 days.
The capacity monitor indicates 4,338V, 99%. I have measure the voltage, to be the same.
The calibration was done using an adjustable PSU, set to 4.2V and 1A.
Swagatam says
Hi Nelio,
The op amp has to operate and switch OFF the transistor if the 10K preset is correctly adjusted to 4.2 or 4.1 V. You can do one thing, connect another LED in series with the base 1K resistor of the transistor and monitor this LED response. This will ensure that no leakage or offset voltage from the op amp output can falsely keep the transistor switched ON.
Also while setting up the preset did your LEDs shut off correctly?
I would recommend you to set the cut off at 4.1V, so that it cannot exceed at the most 4.2V.
Nelio Abreu says
Yes. When I adjust the preset, the LED’s switch status. The RED turned OFF and the GREEN turned ON (in my circuit Colors are switched, since RED is consider danger, don’t touch, and Green is consider Ok).
I will try your sugestion of the 3rd LED and 1K resistor.
Thanks.
N.A.
Swagatam says
OK, that means your op amp is good and working. Now you can just put another LED in series with the transistor base resistor and check the response.
Nelio Abreu says
Hi Swag,
In these circuits the capacitor is 1uF 25V.
Should it be these values?
Can I use 1uF 50V?
Thanks.
Best Regards.
Nélio Abreu
Swagatam says
Hi Nelio,
As a rule of thumb, the capacitor voltage value must be two times the supply voltage, so for these circuits it can be any value higher than 12 V or 25 V. 50 V is fine.
Nelio Abreu says
Hi Swag,
Thanks
Best Regards.
Nélio Abreu
Swagatam says
You are welcome Nelio!
Binoj K says
Hi Sir, I have made an lm358 charger using BC 547anc 2n2907 transistors as your schematic and is fun in seeing the change over of led silently at full charge. But I have some thing to be clarified bu you sir. In the circuit, I hv used a 3.3v zener instead of 3v as given in the diagram. Will it affect the circuit in any way sir? And why you included the battery to be charged in the collector side of the PNP transistor and not on the emitter side? And if I needed a current control stage also in this circuit, where is it to be added ?If u can,pls suggest a modified circuit. Because I find some difficulty in dealing with the last stage PNP transistor to include the current control stage along with it. And afterall thanks so much for making us experiment and learn a lot sir.
Swagatam says
That’s great Binoj, glad you could make it successfully.
3.3V will also work since the cut off value is 4.2V. However, instead of 3.3 V zener you can use 3nos of 1N4148 diodes connected in series in place of the zener diode, but with opposite polarity.
Connecting the load at collector enables maximum current transfer due to minimum resistance and also there’s no voltage drop of 0.6 V.
For the current control, the best way id to add a LM317 current limiter at the input source. Here’s the complete diagram:
https://www.homemade-circuits.com/wp-content/uploads/2023/03/adding-current-limit-to-a-3.7-V-charger-circuit-1200×417.jpg
Binoj K says
Sir, thanks for your help and there is excellent current control when using LM317 as suggested by you.. And continuing my experimentation, i have also tried the relay cutoff circuit using 2n2222. But when the preset is adjusted to effect the cut off, the lm358 is going low but the relay is not being cutoff and the battery continues to be in charging mode. And then i added the 1k resistor across the base and emitter of 2222,which you have only included in the previous circuits and eliminated in this particular circuit. Now the correct cutoff is happening as required. Can you pls tell what is happening when the 1k is present and when it is not there.
Swagatam says
Thank you Binoj,
I appreciate your useful observations and feedback.
Yes, indeed a base/emitter resistor must be included for the relay driver transistor to eliminate the offset voltage which is normally present at the output of most op amps.
This offset voltage is actually a small level of leakage voltage which continues to hang even while the output has turned low….this voltage is in the range of 1V or 1.5V which is enough to keep the transistor switched ON.
The base emitter resistor creates an appropriate resistive divider which effectively eliminate this leakage voltage and allows the transistor to be switched OFF correctly.
Chidon lite says
Hi ????
In number 1 circuit diagram below can I replace bc547 transistor with C945 transistor?
Swagatam says
Yes, you can do that!
M Ali says
Hi Swagatham,
i am a fan of your site. and i am looking for a Charging circuit 3.7V 5A. i do EV vehicle repairs. for my testing purpose i want to build a customer 3.7V 5A auto cut-off battery charger. i hope you may have a circuit diagram for it. can you please provide me the correct link for it.
Regards.
Swagatam says
Thank you M Ali,
I have designed the required circuit for you.
Please refer to the last updated circuit in the above article.
Hope it works for you.
James W says
Can I charge 3.7vilt Lion batteries in series with this circuit
Swagatam says
Yes that may be possible.
Jason says
Good day Sir, Please i need a circuit diagram of a Lithium battery charger for 3 lithium cells connected in parallel of 3.7v having a charging current of 5 amperes. Can you help me?
Swagatam says
Hi Jason, you can build an LM196 based voltage regulator and adjust its output to precisely 4.1 V and use this 4.1V to charge your parallel cells. Make sure to keep the charging current at 50% of the battery’s total mAh rating. You may also have to use series resistors with each cell which must be calculated such that each resistor allows a current that’s only 50% of the cell’s mAh rating. So if the mAh rating of each cell is for example 1000mAh then the resistor must allow only 500 mA current to each cell.
Hannah says
If a 3.7 battery via a USB port is it possible to over do it? You state it may take many hours. Could you detail your longest time to date please so we know an approximate worst case possibility?
Is an intermittent signal always a sign of completion?
Swagatam says
The USB port from my computer could supply only around 200 mA current, which took around 5 hours for the a standard 2400 mAh Li-ion to get fully charged.
Yes, the intermittent ON/OFF blinking of the LED indicates that the battery terminal voltage has reached the desired 4.1V or 4.2V full charge level.
Mubasheer Ahmed S says
Okay Sir.
Now I required at least 8volts across batteries. So, i have decided to use them as 3 series and 3 parallel connection so the voltages across the battery can 8.2v when it is fully charged. at what electrical settings I have to charge now for above Series-parallel connected batteries. if I set 4.1v and 1 ampere will all my batteries get charged?
Swagatam says
For 3 series cells you will need a charging voltage of 4.1 x 3 = 12.3 V, and due to the parallel connections of two 3S battery, you will need 2 amps. But since we do not know whether all the cells have identical charging rate or not, using 2 amp can be risky, so better use 1 amp current.
So you will need 12.3 V and 1 amp for your 3S3P li-ion combination.
Mubasheer Ahmed S says
Sir, I am using all six same cells for the series parallel combination. But sorry I mistakenly said it’s 3S3P. it is 2S3P battery combination at the end I need 8volts atleast so can’t charge the batteries using 8.2v and 1A?
And thanks a lot for helping me this much.
Swagatam says
Mubasheer, for 2S3P you can use a 8.2V or 8V, but at 8V the battery will be only 75% charged. 1 Amp current may be a little less for 3P configuration and may take many hours to get charged.
Mubasheer Ahmed s says
Hello Dear Sir. I have 6 Li-Ion Batteries (Samsung ICR18650)which was removed from old laptop. I am planning to use this for my emergency light. Now, Batteries electrical ratings are 3.7volts and 2800maH. Now I am charging with bench power supply connected and set for 3.74v and 100mA on power supply. i know it is not safe charging in this way. But, my question is can I utilize any one of the best circuit from you which is above mentioned. I hope the one with NPN transistor for cut-off this circuit will be fine. And what if input 5volts is not fixed because many PCs will not be same for some it sources 4.5v and some PCs sources 4.7v and some PCs 5v. because of unfixed input our ref voltage for cut-off and battery low indication also might charge? right? how to fix this sir?
Thank you.
waiting for your response.
Swagatam says
Hello Mubasheer, your charging system is perfectly safe but not adequate to charge your batteries.
The full charge level of a 3.7V Li-ion cell is 4.2V, and it can be charged with a safe 0.5 C rate, which in your case is 0.5 x 2800 = 1400 milliamps or 1.4 amps.
Therefore you can adjust your bench power supply to 4.2V, 1.4 amps or 1 amp optimally.
However, since you do not have an auto cut off system, it is better to limit the full charge voltage 4.1 V, which will allow you to keep the charger connected to the battery without any fear of over charging the battery.
But if you want to use an auto cut off you can use the transistorized version shown in the second last diagram. The input can be 5V, or 4.7V still the reference to the opamp will be fixed at 3 V due to the zener diode, so that’s not an issue.
Mubasheer Ahmed S says
Okay. thank you for the reply sir.
Questions:-
1.Sir what is 0.5C means.
2. If charging battery in this way is safe then can I charge my battery again and again using this system? instead of making above mentioned charging circuits?
3. I have heard charging Li-Ion batteries with continues current is not safe and they recommend me to use switching circuit? how is it safe sir can you please clear my doubt? because we are charging batteries with power supply and batteries which are continuously drawing current from the PS.
4. Sir, 4.1v and 1A with these ratings, can I charge only one single battery with the same settings? and can it be same for all six in parallel as well?.
Swagatam says
Here are answers to your questions:
1) C refers to the mAh of the battery, so 0.5 C means a charging current that must be equal to 50% of the battery mAh value. We can assume 0.5 C to cause no heat generation in the battery. If you find the battery getting significantly warm at 0.5 C then you can reduce the current to 0.4C or lower, but mostly that will never happen at 0.5 C current.
2) As long as you limit the full charge voltage to 4.1 V and current to 0.5 C you can use it as many times you want to charge you batteries without any control circuit.
3) When you are limiting the current to 0.5C and voltage to 4.1V then it becomes constant current and constant voltage which is the recommended way of charging Li-Ion batts.
4) Yes you can safely do itfor all six batts, by following the above points.
Mubasheer Ahmed s says
Okay thank you Sir.
Before I was charging one single cell at 3.74v and 100mA and it was consuming more than 6 to 7 hours to show up 3.7v accross my battery. Now as per your instructions I have set the PS to 4.1V and 800mA and I observed it is charging faster than earlier and no heating on the cell. Now next I will connect all 6 cell in parallel just modify the current settings to 1A. That’s it. Just tell me if it’s okay to do this and then I will begin. Thanks a lot again sir.
Swagatam says
Thanks Mubasheer, Glad your battery is charging faster now. If you connect 6 cells in parallel, then technically the current must be also increased to 6 amps, but that may be dangerous, because increasing the current may cause some cells to consume more current than the others. To avoid this you may have to add current limiter across each of the cells. You can use 6 LM317 based current limiter circuits, and add them in series with each of the Li-ion cells, to ensure that 1 amp current is shared equally across all the cells.
Mubasheer Ahmed S says
Okay I will check LM317 circuits for this setup. For time being can i charge all 6 cell in parallel at 4.1volts and 2A settings in PS?
Thank you Swagatam Sir.
Swagatam says
Yes, 2 amp is quite nominal for 6 cells in parallel, you can try that, with 4.1V supply
Mubasheer Ahmed S says
Hello Again Sir.
I have tested my batteries drain test once charging fully. I have now to change the whole plan.
Before I used 6 cell in parallel and charged them at 4.2volts and 2A as per your instructions. Now, I want to double the supply I am planning to connect them in series-parallel connection so that voltage doubles. but in this case what will be my total capacity of my batteries and electrical ratings? where my each battery has 2600mah(ICR18650). and if I connected them in series- parallel connection at what settings i need to charge them using bench Power Supply?
Thanks and Regards.
Swagatam says
Hello Mubasheer, you must use 4.1V and not 4.2V which can otherwise cause overcharging of the cells if the charging is not cut off quickly.
You can put more cells in parallel and series and increase the voltage and current accordingly but that can be a little risky.
For series the charging voltage will multiply and current will remain 1 amp, for parallel the voltage will remain the same, but the charging current will increase proportionately
Goldmindz Eze says
Hello everyone!
Please, I want to use the circuit diagram above to construct a charger that can charge 4 lithium batteries of 3.7v, 1200mA each connected in parallel. Please, as the output current of the diagram mention above is 200mA, can I still use it for my work?? If yes, what can be added to the circuit to increase the both voltages and currents to the required ratings. If no, what do I need to do?
Swagatam says
Hello, I would recommend you to use the last circuit with a relay. For 4 cells in parallel the total current will be 4800mAh or 4.8 Ah, so the input current must be around 2.4 amperes. The input voltage can be 5 V.
Swagatam says
Hi, Please provide the Ah specifications of both the batteries….