The post discusses a two opamp IC 741 and LM358 based auto cut off battery charger circuits which are not only accurate with its features but also allows a hassle free and quick setting up of its high/low cut-off threshold limits.
The idea was requested by Mr. Mamdouh.
Circuit Objectives and Requirements
- As soon as I connect the external power automatically it will disconnect the battery and supply the system, in the meanwhile charging the battery.
- Overcharging protection ( which included in the above design).
- Battery low and full charging indications (which included in the above design).
- Also i don't know what is the formula to help how to determine the voltage required across my battery to charge it with( battery will be extracted of old laptops.total will be 22V with 6 apms at no load)
- Furthermore, I don't know the formula to indicate how long my battery will last, and how to calculate the time if i want a battery to last me two hours.
- Also, the cpu fan will supplied by the system too. It would be great too to add the option of a dimmer, my original plan was to vary between 26-30 v not need much more than that.
Circuit Diagram

The Design
In all of my previous battery charger controller circuits I have used a single opamp for executing the full charge auto cut-off, and have employed a hysteresis resistor for enabling the low level charging switch ON for the connected battery.
However calculating this hysteresis resistor correctly for achieving the precise low level restoration becomes slightly difficult and requires some trial and error effort which can be time consuming.
In the above proposed opamp low high battery charger controller circuit two opamp comparator are incorporated instead of one which simplifies the set up procedures and relieves the user from the long procedures.
Referring to the figure we can see two opamps configured as comparators for sensing the battery voltage and for the required cut-off operations.
Assuming the battery is s 12V battery, the lower A2 opamp's 10K preset is set such that its output pin#7 becomes high logic when the battery voltage just crosses the 11V mark (lower discharge threshold), while the upper A1 opamp's preset is adjusted such that its output goes high when the battery voltage touches the higher cut off threshold, say at 14.3V.
Therefore at 11V, the A1 output gets positive but due to the presence of the 1N4148 diode this positive stays ineffective and blocked from moving further to the base of the transistor.
The battery continues to charge, until it reaches 14.3V when the upper opamp activates the relay, and stops the charging supply to the battery.
The situation is instantly latched due to the inclusion of the feedback resistors across pin#1 and pin#3 of A1. The relay becomes locked in this position with the supply completely cut off for the battery.
The battery now begins slowly discharging via the connected load until it reaches its lower discharge threshold level at 11V when the A2 output is forced to go negative or zero. Now the diode at its output becomes forward biased and quickly breaks the latch by grounding the latching feedback signal between the indicated pins of A1.
With this action the relay is instantly deactivated and restored to its initial N/C position and the charging current yet again begins flowing towards the battery.
This opamp low high battery charger circuit can be used as a DC UPS circuit also for ensuring a continuous supply for the load regardless of the mains presence or absence and for getting an uninterrupted supply through out its usage.
The input charging supply could be acquired from a regulated power supply such as an LM338 constant current variable constant voltage circuit externally.
How to Set the Presets
- Initially keep the 1k/1N4148 feedback disconnected from the A1 op amp.
- Move the A1 preset slider to ground level, and move the A2 preset slider to the positive level.
- Through a variable power supply, apply 14.2 V which is the full charge level for a 12 V battery across the "Battery" points.
- You will find the relay activating.
- Now slowly move the A1 preset towards the positive side until the relay just deactivates.
- This sets the full charge cut off.
- Now, connect the 1k/1N4148 back so that the A1 latches the relay in that position.
- Now slowly adjust the variable supply towards the lower discharge limit of the battery, you will find the relay continues to remain switched OFF due to the above mentioned feedback response.
- Adjust the power supply down to the lower battery discharge threshold level.
- After this, begin moving the A2 preset towards the ground side, until this turns A2 output to zero which breaks the A1 latch, and switches ON the relay back to the charging mode.
- That's all, the circuit is fully set now, seal the presets in this position.
Answers for other additional questions in the request are as given under:
Formula for calculating full charge cut off limit is:
Battery voltage rating + 20%, for example 20% of 12V is 2.4, so 12 + 2.4 = 14.4V is the full charge cut off voltage for a 12V battery
To know the battery back up time the following formula can be used, which gives you the approximate battery back up time.
Backup = 0.7 (Ah / Load Current)
Another alternative design for making an automatic over/under charge cut-off battery charger circuit using two op amps, can be seen below:

How it Works
Assuming there's no battery connected, the relay contact is at N/C position. Therefore when power is switched ON, the op amp circuit is unable to get powered and stays inactive.
Now, suppose a discharged battery is connected across the indicated point, the op amp circuit gets powered through the battery. Since the battery is at a discharged level, it creates a low potential at (-) input of the upper op amp, which may be less than the (+) pin.
Due to this, the upper op amp output goes high. The transistor and the relay activate, and the relay contacts moves from N/C to N/O. This now connects the battery with the input power supply, and it begins charging.
Once the battery is fully charged, the potential at (-) pin of the upper op amp becomes higher than its (+) input, causing the output pin of the upper op amp to go low. This instantly switches OFF the transistor and the relay.
The battery is now disconnected from the charging supply.
The 1N4148 diode across the (+) and the output of the upper op amp latches so that even if the battery begins dropping it has no effect on the relay conition.
However, suppose the battery is not removed from the charger terminals, and a load is connected to it so that it begins discharging.
When the battery discharges below the desired lower level, the potential at pin (-) of the lower op amp goes lower than its (+) input pin. This instantly causes the output of the lower op amp to go high, which hits the pin3 of the upper op amp. The instantly breaks the latch, and switches ON the transistor and the relay to initiate the charging process yet again.
PCB Design

Adding a Current Control Stage
The above two designs can be upgraded with a current control by adding a MOSFET based current control module, as shown below:

R2 = 0.6 / charging current
Adding a Reverse Polarity Protector
A reverse polarity protection can be included to the above designs by adding a diode in series with the positive terminal of the battery. Cathode will go the battery positive terminal, and anode to the op amp positive line.
Please make sure connect a 100 Ohm resistor across this diode, otherwise the circuit will not initiate the charging process.
Removing the Relay
In the first opamp based battery charger design, it may be possible to eliminate the relay and operate the charging process through solid state transistors, as shown in the following diagram:

How the Circuit Works
- Let's assume A2 preset is adjusted at 10 V threshold, and A1 preset is adjusted at 14 V threshold.
- Suppose we connect a battery that is discharged at an intermediate stage of 11 V.
- At this voltage pin2 of A1 will be below its pin3 reference potential, as per the setting of the pin5 preset.
- This will cause the output pin1 of A1 to be high, turning ON the transistor BC547 and the TIP32.
- The battery will now start charging via TIP32, until is terminal voltage reaches 14 V.
- At 14 V, as per the setting of the upper preset, pin2 of A1 will go higher than its pin3, causing the output to turn low.
- This will instantly switch OFF the transistors, and stop the charging process.
- The above action will also latch the A1 op amp through the 1k/1N4148 so that even if the battery voltage drops to the SoC level of 13 V, the A1 will continue hold the pin1 output low.
- Next, as the battery begins discharging via an output load, its terminal voltage begins dropping, until it has dropped to 9.9 V.
- At this level, as per the setting of the lower preset, pin5 of A2 will drop below its pin6, causing its output pin7 to turn low.
- This low at pin7 of A2 will pull pin2 of A1 to almost 0 V, such that now pin3 of A1 becomes higher than its pin2.
- This will immediately break the A1 latch, and the output of A1 will once again turn high, enabling the transistor to switch ON and initiate the charging process.
- When the battery reaches 14 V, the process will repeat the cycle yet again
Search Related Posts for Commenting
hi Sir,
what changes to made on the above circuit to charge 24 v 150AH battery.
Thanks,
Hi BG, no major changes will be required, just replace the relay with a 24 V relay, and the charging supply with a 29V DC supply
Hi Swagtam, can u make a circuit practically amd make a video on it.. coz, alot of ppl around here are facing some sort of problems. Pls i also gave up making a 3.7volt lion battery charger. My idea was not fulfilled.
Hi Chandrashekhar, Can you please explain the testing procedures you have used to confirm the various stages of your circuit? if you try it randomly without understanding the steps then you are bound to have problems. I have already tested and applied similar designs many many times for battery charger applications successfully. These are very basic concepts using op amp compartor.
If you can specify a mistake in my design then definitely I’ll look into it. But for that you must be first able to check it yourself, right?
You can see one such working example here using a single op amp:
USB 3.7V Li-Ion Battery Charger Circuit
You can probably do it by replacing the lower 6A4 diode with a TIP127 pnp transistor. Emitter will go to battery positive, collector to load, and base to the output of the op amp A1, via a 1 k resistor
Please note that if we don’t apply proper understanding then things will look weird and incorrect. The op amps are working perfectly and will automatically charge and discharge the battery as explained in the article.
The RED LED is supposed to work like a battery charging indicator only when the charging supply is ON. When the supply is not switch ON the LED is basically indicating whether the battery is ready for charging or not ready for charging.
When the RED LED is OFF, it means the BC547 is completely switched OFF, and therefore the TIP32 can noway conduct, then how can the battery discharge through TIP32?? By the way the current is supposed to pass from the emitter to collector across the TIP32. The battery cannot flow from collector to emitter of TIP32. At which points did you measure the 1.5 V??
To be entirely confirmed you can add a diode in series with the collector of the TIP32, and the response again. The cathode should be towards the battery and the anode towards the collector of the tIP32. Furthermore add a 4k7 across emitter and base of the TIP32 to ensure total switch OFF of the transistor when the op amp A1 output is low.
You can connect an ammeter in series with the collector line of the TIP32, which will indicate exactly whether the battery is getting charged or not. The meter FSD must be rated according to the battery charging rate.
You can apply the following modifications around the TIP32:
BJTs are normally not efficient as far as current conduction is concerned, you can probably try replacing the TIP32 with a p-channel MOSFET and check the current response. However, initially you can try reducing the value of 1K at the base of TIP to 100 ohms and reduce the 10k at the base of BC547 to 1k. And make sure to remove the RED LED from the BC547 emitter and connect it in series with BC547 base. You can also remove the 10K across the base and ground of the BC547. These enhancements might help you increase the current to the battery, if it doesn’t help much, try using a MOSFET in place of the TIP32
Absolutely INCORRECT, not sure how and what you might have messed up with my suggestions? All the suggestions made by me are done with proper understanding calculations, and precautions. I cannot comment on your work since I cannot see or verify it practically.
That’s exactly why I suggest the newcomers to first learn electronics and then attempt the designs presented in this website or elsewhere. Learning all the basics is very important no matter in which field you are working.
With your invalid conclusions you are sending a wrong message to the other readers, that is why i had to clarify my stand.
Requiring a fan for cooling a resistor is an unnecessary exaggeration. If you are an hobbyist then you must try to investigate what is causing the heating up, May be the 100 ohm wattage needs to be rated higher, or may be your transistor is faulty? You should have investigated these questions.
If you are a hobbyist, then you should know how an PNP BJT is supposed to work.
Adding a resistor across base/emitter of any transistor will switch it OFF completely in the absence of biasing voltage. That’s why I told to add this resistor for TIP32.
The LED should be positioned in series with the BC547 base and not at its emitter when a 100 ohm is used at the base of TIP32
You are saying that the current flows back from collector to emitter, when the TIP32 is not conducting and with a collector diode in reverse bias condition, that’s defying basic laws of electronics.
You are saying that the TIP127 does not switch off even when A1 output is high? How can a PNP remain switched ON with a positive bias across it base emitter. For a PNP to conduct its base voltage must be 0.6 V lower than its emitter potential, when A1 output is high the base of TIP127 should be equal to its emitter, then how will it conduct? You can add an LED in series with the TIP127 base to exactly see its switching status in response to output of A1
If you are not getting enough current from TIP32 then you can replace it with a MOSFET or simply use a relay which will provide an unconditional and 100% current transfer to your battery.
Here’s what you exactly need to do, the LED status will clarify the positions of the various stages
And please do not assemble it over a breadboard, that would be like inviting mistakes. Assemble the circuit over a veroboard or strip board by properly soldering the parts.
Also please replace the BC547 with 2N2222
Make sure the charging input supply is 1 V higher than the battery full charge spec.
Thank you for taking the time and effort to explain the why’s and whatnot’s. I built the last circuit with the TIP127 and it works the way it is supposed to with the triggers when testing with bench power supply to but there is a major heat issue on the 100 Ohms 2 watts so I could not finish charging a battery in full when testing in real life. I have measured the temperature of the resistor to be 105.8°C and it was already cooling down so I stopped everything and I am wondering if putting resistors in parallel at the base of TIP32 would help in taking the heat or if there is another solution to keep charging at 1 A at least without risking a fire? If using MOSFETs, what would be your solution? I am more used to building small circuits where power sources are not much of an issue but my current project is tougher than I thought it would be.
Glad it is working now!
There are a few things that must be correctly calculated to ensure proper working of the circuit.
The input current must be preferably no more than 50% of the mAh rating of the Li-Ion cell. For example if the the cell is rated at 2600 mAh, then the charging current should be kept below 1.5 amps.
The base resistor of TIP32 must be calculated using the formula R = Input V – Battery V / Charging Current
R wattage should be = (Input V – Battery V) x Charging Current.
If a MOSFET is used in place of the TIP32, then the gate resistor becomes immaterial, and this could be an ordinary 1k 1/4 watt. However, the battery charging voltages should be in the range of 10 V to 15 V
I replaced the TIP32C with a MOSFET IRF4905 and now, I can charge my 12V 7000 mAh in about 8h with no alarming heat which is great. However, that was the proof of concept phase with low voltages. I would need to use this circuit with a 25.2V Li-ion battery and when I try to set the high threshold, the charging LED dims a little bit but never switches off when the LED on the TIP127 lights up thus, the other triggers do not work. It seems that the highest voltage accepted for the battery around 15V and above 15.5V, the locks do not work anymore. Which resistor should I change to make it working with voltages above 24V?
Please try the following modified configuration, and check the results:
Thank you for your super quick new design, I was not expecting so many changes. May I kindly ask you which value should be used for the Zener diode at the charging point in this new design?
You are welcome! The zener diode can be a 15 V 1/4 watt diode.
Unfortunately, the circuit does not accept a high threshold over 21.8V. The charging LED never switches OFF but rather dims a lot and the “full” LED switches ON quite dim as well and the locks only work at = or < 21.8V, over this voltage, the locks do not work at all. I am wondering if we should not change the potentiometer at A1 for a higher value. What do you think?
The input pins of all op amps have very high resistance, so the value of the preset shouldn’t be relevant. Any preset between 1k and 100k can be tried, all should work equally well.
The problem could be due to high current/voltage at pin8 of the op amp which might be causing high offset or leakage voltage at the output of the op amp and is not allowing a full 0V at the output.
You can try a 10k resistor in series with the pin8 of the op amp, and then put a 12V or 15V zener across pin8 and the ground.
This should solve the issue, but now this will not all the battery side MOSFET to switch OFF, since a 12V or 15 V output from the op amp will be lower than the 25V at the source of the MOSFET which will never allow it to shut off.
This can be remedied by adding another BC547 stage for the gate drive of this MOSFET.
You can try this later on once the op amp switching problem is solved using the above explained procedures.
Unfortunately, nothing seems to be workingwomen it comes to use any voltage above 20.8V for some reason. I have tried the 10k resistor in series with the pin8 of the op amp and both the “charging” and “full” LED were glowing dimmed but could only latch at 20.8V, it did not work above this voltage. I tried with the 15V zener across pin8 and the ground in addition to the 10K resistor in series and this time, the “low battery” LED was switching ON as soon as the voltage reached 15.5V and stayed ON all the way up. It only dimmed OFF only around the 15.2V and switched back ON on preset 15V. I could not go higher than 20.8V either to latch the settings. I even tried to power the LM358 with 12V and then 5V using 7812 and 7805 ICs with no more luck. It is way above my current skills.
Yes the low battery will now stay ON, because pin7 is turning high with 15V, while the green LED anode is at 24V.To correct this please connect the green LED anode side with pin8 of the IC, and replace the a 10K at pin8 with a 1k so that the LED can get proper current.
Now, to check whether your op amp is working correctly or not, you can remove the left side MOSFET stage entirely, then remove the latching feedback also across the A1 op amp.
After this supply the upper and lower thresholds from the battery side using a variable power supply, and then rotate presets to make sure the LEDs switch ON and switch OFF according to the general rules or a comparator.
The basic rule is that when the voltage at the (+) input pin of the op amp is higher than its (-) input pin, its output will turn high (or equal to its pin8), when the (+) is lower than (-) then the output will turn 0V.
Please conform the above using a multimeter, if you find the op amp output not turning 0V fully, which may keep the transistor switched ON permanently, you can correct this by adding another red LED in series with the BC547 base which should cut off the excess leakage voltage and allow a total switch OFF for the BC547.
We are making some progress!! Now with the “Low” LED on 8 and 1K with the 15V Zener in addition to a second LED in series with the charging and the left side MOSFET detached, the latches work even though the “full” LED starts to dim ON at 17V all the way up to 25.2V but this time, the charging LEDs switch OFF. Once the charging LEDs are OFF, output 1 measures 1.12V @ 25.2V. Output 1 reaches 0.9V only @ 18V. Output 7 works perfectly but is never @ 0V, it reads 1.02V when set @ 15V. However, when I reattach the left MOSFET side, the high latch does not work anymore.
The latch will break and the charging process will be restored only when the “low” at pin7 pulls the pin2 level of A1 below its pin3 level. Since A1 output is 0.9V this means the pin3 will be dragged approximately at this 0.9V level by the 1N4148/1k feedback. When the A2 output turns low at 15V, it’s output turns 1.2 V, which looks a bit higher than the 0.9V, which implies the latch cannot break. For the latch to break the A2 output must drag the pin2 of A1 below the pin3 level.
This could be probably adjusted by increasing the 1K in series with the 1N4148 to may be around 4k7 or 10k etc
The left side MOSFET will not work correctly in this modified version unless a separate BC547 driver is also added with this MOSFET
Thanks a lot for your time! The main issue was more on keeping the latch than breaking it actually. I could verify all the latch breaking, thanks to your explanation. I managed to keep the latch @ 25.2V by just changing the 10K in series with the “Full” LED by a 15K. Now PIN 8 has a 12V Zener instead of 15V since the battery itself will drain down to 15V. The second “Charging” LED in series has been removed as it was rendered unnecessary. Now I need to find a way to drive properly the left N-Channel MOSFET IRLZ44N. Should I use a P-Channel MOSFET on the left too?
Glad you could solve it so quickly!
For the load side MOSFET a P-channel will be required and will be more suitable than a N-channel….you can do the following modifications:
1) Add another BC547, by connecting its base with the collector of the existing BC547, emitter to ground line, and collector directly with the gate of the load side p channel MOSFET.
2) For the MOSFET, just connect a 10K across its gate/source, and nothing else. The source pin will connect with the battery positive as done earlier, and the drain will connect with the load side output, as per earlier configuration.
Thank you so much, it works great! Now, do you have any suggestion for the 1N5408 which is burning hot when charging the battery @ over 2A? A 7000mAh Li-ion battery takes too long to charge if we reduce the amperage too much but I don’t want to burn a lab either. I also noticed a current surge on the load output when connecting the charger: the high amperage required to charge the empty battery seems to leak a bit too much to the load but this, I think, I can find a fix.
Glad it’s finally working as required! 1N5408 is rated to handle 3 amps max, so 2 amps can make it red hot indeed. You can replace it with a 6A4 diode, but even this diode might get significantly hot and will require a good heatsinking.
Alternatively you can also check the response without including this diode at all.
I have changed the 1N5408 for a 6A4, it should be OK (the battery must drain before next test). Up to now, I was focused on the charging side but now there is a new issue: there is a 4.5 to 4.8V drop between the battery terminals and the output and I measured the drop to happen right at the MOSFET drain on the output side. This is so weird! Even stranger: if I plug an unpowered a charger, I get the full voltage of the battery at the output! When powering the charger, it works as expected, but I am puzzled by the 4.8V drop on battery only.
Did you measure it with respect to the ground line? Meaning, the meter probes connected across drain and the battery negative? You can also try shorting Gate terminal directly with the battery negative and check the response.
And did this happen with an appropriate load connected at the output side or without a load? Please confirm the same with a load connected.
Yes, all measures were done with respect to battery ground with or without a load. The only moment I could get full voltage at the output was when I tried to short the gate of the MOSFET to ground but then, the battery would be charging when the charger is connected even if the « charging » LED was OFF. I think, I will try to go back to the TIP127 for the output.
But that again sounds against the standard laws of electronics. If you short circuit the collector/emitter of the BC547 associated with the charging MOSFET (right side MOSFET), would mean shorting the base of the other BC547 associated with the battery side MOSFET (left side MOSFET). In this situation, the other BC547 will stop conducting, cutting-off ground bias for the left side MOSFET, and this should shut down the left side MOSFET, so how is it possible that you are getting full voltage in this situation, ……which will also mean that the battery will be depleting while charging.
Well, I discovered the source of the issue with the high threshold which didn’t want to latch, it was a poor contact on the A2 trimpot towards ground, that was all my fault, so I fixed it and I got back to original 10K at the “full” LED and it worked. I also removed the 15V zener and the 10K which were connected to pin 8 of the LM358 and that reduced the voltage drop down to 0,35V which is way better. The voltage drop actually occurs as soon and as long as the “full” LED switches ON with or without a load. I kept the output MOSFET though.
No problem, actually a hardware fault is a common thing that we all come across with electronic circuits, and this inevitably happens with all hobbyists and engineers. However, if the circuit is thoroughly understood then troubleshooting becomes easy and quick.
Coming back to the circuit, if you remove the 15V zener from pin8 of the IC, then the low battery indicator (green LED) might not work correctly.
And, as long as the red LED is ON (battery charging), the left side MOSFET is supposed to be fully cut off, therefore getting any voltage at the drain of the left side MOSFET should not be possible?
Moving the diode did not change much. Self discharging will always occur anyway due to the BMS but it is more about laboratory safety that I need to have a switch to disable the device when not in use. This circuit is the closest, to date, I could find on the web for the very specific usage I need. It is going to be used in a laboratory setting to power a liquid flow meter where ambiant air may be filled with ethanol and a power socket might no be available. I will implement a battery meter with a push button for quick readings and a low battery alarm with a buzzer to make sure people will react when battery is going to die to plug the power in time. Due to the specific requirements of the device, I had to add an adjustable voltage step up at the output and this makes all the voltage monitoring a bit difficult. I also needed an adjustable power boost to charge the battery when empty which would not trigger the high threshold too easily. At 25V, it is way more difficult than at 12V!! But it works, thanks to you and I really appreciate your help!!
The diode will protect self discharging only from the 10k presets and the associated opamp circuitry. Anyway, glad the circuit helped you to achieve your objective, now it needs to be confirmed over a well deigned PCB before the final implementation.
I do have an issue I cannot understand now that I am testing the system completely. I removed the “Full” LED as it was more of a distraction. The system is complete with a load running on a fully charged battery, no LED “ON” which is normal but if I connect the power at the input, the battery disconnects from the load and start charging while the load is powered by the charger. Isn’t the charging supposed to start only if the “Low” LED triggers the “Charge” LED? I have checked multiple times the circuit against the schema and I don’t see an error.
That is normal, because when the charging input is switched OFF, the latch breaks, and when the charging supply is switched ON back the A1 restores the battery charging by switching ON the transistors.
This can be perhaps corrected by adding the following circuit in the existing design:

….You can change the 1k to 10k for reducing unnecessary current dissipation
I found the reason why the input kept charging despite the battery being full with no LED ON: the P-MOSFET on the load side leaks through the drain toward the source when power applied at the input. So I changed this MOSFET for a N-MOSFET IRLZ44N and a 1K between gate and source, that stopped the bleeding but there is still a tiny leak I cannot figure. If the battery is charging with “charging” LED ON then the battery is disconnect from the load and zero Amp is consumed as long as it charges but when the charge stops with the charger still powering the load, the battery reconnects to the load or something else and it draws 0.0048 A for a 12V battery. I tried with a TIP127 and it draws 0.0037 A in the very same condition.
But the battery is connected at the source side of the MOSFET, then how can the leakage be from drain towards source? Is it the load side MOSFET or the charger side MOSFET that you are referring to? Also remember there’s an internal diode with every MOSFET, so check if that is affecting the situation?
And if you change the load side mosfet with a n channel, then you will have to eliminate the new BC547, and connect the gate directly with the old existing BC547, and also remove any resistor previously suggested across gate/source of the n-channel mosfet.
The second BC547 driving the output MOSFET was fried actually, I replaced it with a new one and to be sure we are on the same page, I went back to the zener and 10K at PIN8. The locks are working now and I get full voltage at the output. Now, you told me earlier how to connect the output MOSFET but without the feedback with the 1K between gate and PIN1, I cannot get any output. Just for test, I temporarily have connected an LED with a resistor in series on the output MOSFET drain with the output to check if it was disconnecting when charging at the input and it does, I removed it as it was dropping too much voltage at the output. A last thing, I need to use a switch to save the battery when not in use but when the battery comes back online with a lower voltage than the higher threshold or if the battery is full and a load kicks on, the charging LED lights up, is there any trick to avoid this? Do we need another Opamp as a comparator?
The second BC547 shouldn’t have burned because its base is protected by the 4k7 resistor and the collector by the 1k across gate/source of the MOSFET
…Are you referring to the battery self discharging through the 10k preset while it is not being used? This can be probably prevented by shifting the 6A4 diode from the indicated position to the point exactly between extreme left 10k preset positive connection and the battery positive.
Good day sir,
please if i use a 12volts,400ohm relay for the above charger,will it be okey for 10Amp requirement bearing in mind that v/r = i > 12/400 =0.03amps.Will the relay and the transistor handle this current level ?.What do you suggest sir?.Another thing the resistor needed for the constant current will be too small to find in the market.
Patrik, the 400 ohm is the resistance of the relay coil, and cannot be used for the calculations. The best way is to check the printed rating on the relay itself. It should be rated at 30 amps/220 V to handle 10 amps comfortably.
Hi Swagtam, i have tried every possibility but the lm358 never gives the exact output as the vcc voltage.. always there is a drop of 1.3 volts… Pls make a video on the output volt..
Hi Chandrashekhar, there may be some offset voltage difference at the output of an op amp, but still that is enough to switch ON the transistor. In your case it is 3.7 – 1.3 = 2.4 V which is more than enough to turn on the BJT.
Hello sir,
Can i use this circuit to charge a 12 volt battery while providing output to a 12 volt 2 ampere load with an adapter of 12 volts?
If yes then please guide
Many thanks in advance
Hello Eshu, yes that’s possible using the first circuit but the input supply current must be sufficiently rated to charge the battery and also handle the output load.
Thanks for your response and help
Actually i don’t want to use a relay for switch over. Can i use the last circuit for my requirement as i want fast switching from mains to battery to supply the load
yes surely, you can try it.
i yam using a variac tranformer for a variable supply with a bridge rectifier this works well i can charge anything to any set volts and amps all your work of great interest
Hi swagtam , i want to use the 1st circuit without using a relay. can it be possible to use transistor based circuit beside relay?
Hi Chandrashekhar, I have updated the required design at the end of the post, you can check it out. Remember to disconnect the feedback 1k/1N4148 while adjusting the presets. Connect it back once the adjustments are done.
Hi swagtam, in the last circuit where u put TIP transistor, i saw the unusual behavour in the spice simulation. Is is works in real circuit. pls confirm. coz i will make an good quality pcb for the circuit.
Also i want to charge 3.7v 6600mAh LI-ION battery. Is TIP transistor ok for that . Please confirm early. ALso tell the zener value for 3.7v charger circuit. Is it 3volt zener.??
Hi Chandrashekhar I cannot comment on simulator behavior, but according my own brain simulation the circuit is perfect and will work. However, the person who is building the circuit must first understand the working of each and every component, otherwise troubleshooting may become impossible in case an issue arises. So I would recommend you to spare some time to understand the opamp comparator working, and only then proceed. Also, a PCB must be designed only when the prototype is tested and confirmed on a veroboard…these are the some basic electronic rules that all must follow. TIP will support 3 amp current (on heatsink) so it looks ok to me. You can replace the zeners with two series 1N4148 diodes, with cathode towards the ground line.
ok. thanks for early reply. i definitely trust on ur Brain Simulation. I will first try on blank pcb coz i have no veroboard then i will make an pcb..
Thanks for giving such wonderful Website.
Thank you for trusting me Chandrashekhar, I wish you all the best. I have made a couple of changes around the upper op amp pin2/3 connections, please make sure to do it accordingly.
Ok Sir, I have given a circuit diagram link with necessary modification for automatic LED on-off feature. Pls have a look and suggest if is there any correction in it.

Thanking you for your kind co-op.
Thank you Chandrashekhar, that looks great…however due to lack of time I won’t be able to confirm your version of the schematic. If you have any questions regarding the schematic which I have updated in the above article, please let me know I’ll solve it for you.
Ok, Sir pls let me confirm that on your last circuit which u have designed, i want to charge 3P Li-Ion battery (i.e 3600Mah 4.2v) with it and load LED will be 250MA total. Hence pls tell me the resistors, zener and transistor for the circuit for modification. Awaiting for early reply
Chandrashekhar, for the mentioned application you can change the zener diodes with two series 1N4148 diodes with cathodes towards ground side, and replace the red LED with a short.
Qsn no-1: Sir, how to over discharge feature will add to your last circuit.? Pls expain.
Qsn no-2: Again for a comparator, when inverting input get low than non inverting then we can get full input voltage. But in my case the voltage drop by 1.3volt why. Pls..
Chandrasekhar, I have updated the explanation at the bottom of the article. When the (+) input of the comparator goes higher than the (-) input, its output will become equal to the ICs Vcc voltage or the full supply voltage. Check your comparator with 6 V or 12 V, may it is malfunctioning.
How to Use an Op amp as a Comparator Circuit
hello sir swagatam,please let me know the changes i should make to the circuit incase am monitoring a 24v battery?https://www.homemade-circuits.com/wp-content/uploads/2020/06/op-amp-transistor-solid-state-auto-cut-off.png
Evans, Use a 24 V relay, and a 24 V battery, rest everything can be as it is.
hi, this is REvocatus from Tanzania I want to know how can use a transformer from UPS lated at 850VA as a battery charger for 100AH or 50AH battery with auto cut off. If you have a diagram or any advise please provide it, I hope you will help me. Thanks
Hi, you can refer to the following two articles for more info:
Designing a Customized Battery Charger Circuit
Lead Acid Battery Charger Circuits
Hi Mr Swagatam, thank you for fast reply so now I want to know which type and size of the rectifier diode I should use to match with this transformer? also should I add a capacitor on that rectifier diode or not, if yes which volue of the capacitor I should use?.
Thanks.
Hi Revocatus, for charging lead acid battery, the diodes must be rated with current that’s 20% of the battery Ah. Transformer current rating must be 10% of the battery Ah. Filter capacitor is not required for charging a battery
Hi thank you for nice explanation, so can I use this transformer from UPS to charge battery, the UPS is rated at 800VA and the transformer input is 230V output 7.5v-0-7.5v?
800 / 15 = 53 amps that’s a lot of current. Unless your battery is a 500 Ah battery you will need a current controller stage to limit the current to 10% of the led acid battery Ah.
Hello sir,I like the idea,so how can I connect this to an existing inverter to make it a ups? With an aid of a diagram,I’ll appreciate.
For a UPS design you can read the following article:
https://www.homemade-circuits.com/making-ups-tutorial/
Pls,is the component value at (R2 = 0.6 / charging current) a resistor or what?
It is a resistor.
How can I configuration this circuit for 24v battery?
replace the relay with 24v relay and set the circuit for cutting off at 28V high and 22V low
Can i use potentionmeter instead of R2 resistor R2 = (0.6/ Chrg Current) for control current in above circuit.
Second how much current can handle above circuit.
I have 15v transformer but i dont know current rating when i install 35amp bridge rectifier it have burnt instantly. Can i use 2 50amp diode for rectification?
Sorry for lenghty question but ur ans will be very helpful for me.
If you can arrange a 1 ohm pot then you can use it. Diode will burn if the load current is high, not because of the transformer current rating, so make sure the load is not an overload. The diode current should be 2 times the charging current of the battery.
Please sir, what can I do, when I use 10amp 12v relay, the response is faster than 30amp 12v relay
different relays will have different response times…so we can’t do much about it.
Sir, I am proud of you. I have build your modified sine wave inverter circuit successfully. I have added one of your charger circuit,using lm358. I used 20amp battery for the inverter. Sir pl. Clarify the following :
1.In charger circuit around Lm358 how can I identify upper threshold
pot,and lower threshold pot.
2. Which diode can be used for reverse polarity protection. Can it
be 6A Diode
3. The charging transformer is 18volt 2amp. Can I charge 30 amp
battery with this transformer.
4. I am having a UPS transformer with 3 wires in secondary side is to
be connected to the inverter circuit. And the other side it has 7 wires
out of which 2waires( paire) , when connected to rectifier
gives 12volt 7amps. Can I use this tapping for charging 20amps
battry. If so how can I reduce the current to 2amp. Can it be possible
using Lm 338 circuit.
Sorry sir, for the long questions.
Thanking you sir,
Leelesh.
Hello Leelesh, here are the answers.
1) Keep the upper preset to ground level, and the lower preset to positive level. From an external variable power supply, apply 14.2V across C1, you will find the relay clicking ON. Now slowly adjust the upper preset so that the relay just switches OFF. Next, reduce the input voltage to 11V, and slowly adjust the lower preset so that the relay click ON again.
2) Yes you can use 6A4 diode
3) Normally 3 amp is advisable for 30 Ah battery, 2 amp will make the process slow and may take 20 hours for optimal charging
4) you will need 14.2V for charging a 12V battery, 12V will not work
I am Bernard Tendengu.
On the operational amplifier comparators the 741 and the LM 358 both presets are 10k ok I am getting lost
on how you got the values of the other 10 k resistors which are connected to the 6v zener diodes. Did you use the voltage as 12 volts from the relay to calculate the resistors as well as the current passing through the relay as 40 amp.
Accurate values are never required for these kind of semiconductor application. The zener provides us with a wide range of current through which it can operate optimally. You can use any value between 1K and 10K. I did not mention 40 amp anywhere in the article, and it is not relevant, as long as the voltage is 12V. If the voltage is significantly higher then the current will matter.
dear mr….
i wish to change my motorcycle’s sla battery with li ion18650.. and could to drive high power led 200w power output.. is this circuit safe?
should me to add bms 3s board?
answer me please to hilmanropiudin@gmail.com
This is not for motorcycle application. I would recommend a LM338 based constant voltage constant current module set at slightly lower than the full charge level of the battery…this will be safest way to charge it.
Hello sir. Actually i wanted to refer the first circuit (load is connected to the supply) other than the modified one. The things i wanted to know is:-
1. What must be the range of input voltage and current for the safe working of the circuit.
2. What are the specifications of the relay to be used. Is it dependent on the type of battery to be charged. If yes, then what are it’s specifications.
Please do help sir.
Hello Ashish,
The IC can tolerate a maximum of 30V, so the input supply should not be increased above this value.
The relay coil voltage can be as per the battery voltage, if it’s 12V then the relay should be also 12V. The relay contact current rating should 2 times more than the charging current rate of the battery. Charging current should be ideally 10 times lower than the Ah value of the battery for a lead acid battery
Thank you so much sir for replying. It means a lot.
What are the changes i need to do to increase the max input voltage(i.e 30 V)
So as said above, i need to change the relay every time i need to charge a different battery. Or is there anything that can be done so that i can charge various batteries with one particular relay.
Hi Ashish, For different input voltages you can feed the opamp supply pin and the relay coil positive side pin with a 12V fixed voltage through a 7812 IC. Then you can use any voltage from 3 to 30V or higher input and charge different batteries accordingly.
Can I use the last circuit diagram to charge my polymer battery 12v 100ah using 12v 10 amp transformer?
Lipo batts are designed to accept high charge/discharge rates at around 5C, meaning at 50% of their Ah rating. At 10 amp your 100AH batt may take a lot of time to charge, although this will allow the battery to have a very long life.
1.If am going to charge 12v 100ah battery, will I use the charging current of battery as LOAD to calculate the value of R2?, let’s say if is a lead acid; 1/10 that is 0.7/10A or what?.
2. In your earlier post you said for charging lipo or polymer batteries it is recommendable to charge 5% for their efficiency and current control charger, can i use this last circuit with 1/10 , that is; 12v 10A rectifier to charge my polymer 12v 100ah battery?
yes you must use the charging current as the load to calculate R2, I have updated the formula under the second last diagram.
sorry i did not get your second point, what is “5% for their efficiency?”
Hi, I have issue concerning power supply and I ask for your help/ guidance. I have a power amplifier which needs 24v 7amp and the transformer available in market is 24v 5amp and when I connect it with 24v 5amp the amplifier output is not sufficient and transformer becomes so hot when I vary volume to max, my question is, can I use two 2 transformer in parallel to amplify current to 10 amp and how to connect them
Yes that’s possible but you will have to do this by adding separate bridge rectifiers at the two transformer outputs, and also separate filter capacitors for the respective bridge rectifiers.
Is it a must to put 12v zener across the emitter and collector of T2 if my transformer is 12v, can I use BC 548 as T2?
zener won’t be required if the supply is 12V. BC548 will do for T2!
i did not set low voltage and high voltage. my english is not good. i am using translate.
what (pin 3) and 5 voltage shold be? please help me. thanks.
You will need a variable power supply for setting up the opamp presets, please see the discussion with Mr. Engr bashir, I have explained how the presets should be adjusted by applying the high and low voltages. Unfortunately there’s no other method which can be used correctly
Sir,
Can I use the circuit in 300 watt invert er circuit. and can Tr.bc 547 be used in substitute to Tr.2n2222
Thanking youl sir.
Hi Ieelesh, you can do that, if your relay coil resistance is not less than 200 ohms
ok sir i really appreciate thank you
ok sir, which one i suppose to set as my full charge cutoff 16v or 15.5. ???
i thought that the battery can be damage it i set it at 16v
15.5V is not correct, you can use 16V, but at 16V you won’t require any cut off, cut off will be required only when you set it at the max 16.8V.
A single 3.7V requires 4.2V to get fully charged, at 4V also it is quite good and does not require any cut-off
therefore if you set at 16V that corresponds to 4V for each cell, which means cut off may not be necessary at all.
1). 14.8V sometime 15.5v,
2).36000mAh lithium battery constructed by me. using 3.7v lithium battery. the cell connection is 16p4s arrangement =14.80 36000mAh
3). 16.5v input charger
if you have connected 4nos of 3.7V Li-Ion cells in series then the correct full charge level of this battery should be 16.8V and not 15.5V.
14.8V will be the low discharged voltage level for the battery.
another observation Sir,
(1) that my charger that i made yesterday it cut off at 14.89v instant of 15.5v. but my battery is 14.8v but sometimes it reached 15.5v when it full lithium battery.
Engr Bashir, I wanted to know the specification of the battery, because I have never seen a battery with 15.5V full charge requirement, so please specify the printed value of the battery so that i can help you with better suggestions.
A preset setting can produce some inaccuracy unless you use a multi-turn type of preset, so slight variation may be there. You can try replacing it with fixed resistors…
i will try to send you a pictures Sir so that to it will be a reference
OK great, thanks!
Woow!!! is now working i am very happy now i am really appreciations thank u SIR
I am glad it is working for you!
yes sir i hv done it as you said but the problem that i am experienceing is that when i set the low battery at 12v and the full charge at 15.5v when i plug charge to test. it just cut off at 14.80v instant 15.5v.
and when there is no any load on it the relay it just start vibrating and when i connect battery on it , it will stop vibrating and cutt off at 14.80
Hi Bashir, Yes the relay may vibrate if battery is not connected, but the problem can be easily solved simply by swapping the N/C contact with N/O. Please see the updated first diagram, I have exchanged the N/C, N/O positions and now the charger should work without any problems.
Please check it and let me know.
Sir i did the first circuit above according to your instructions. but the problem is that, the reply is vibrating but my specifications is as following:-
-Relay 12v 10A
-my Battery voltage is 15v to 15.5v
-Input charger is 16.5v
-And i want my low level voltage to be 12v and cutoff full charge to be 15.5v.
please what is the problem???
Hi Bashir, did you set the presets correctly? for your case the upper preset must be set to switch ON the relay at 15.5V, and the lower preset must be set to switch OFF the relay at 12V.
Do it in this way:
1) Initially keep both the presets sliders to ground level.
2) Now feed a 15.5V from a variable supply to the circuit (from the battery side), and adjust the upper preset such that the relay just switches ON.
3) Now slowly reduce the supply to 12V, and adjust the lower preset until the relay is just switched OFF….that’s all
your circuit is all set now.
Helo sir the circuit am seen here is all about circuit that measures input voltage.
I want or am taking about the variable DC voltage source that I can adjust to a particular DC voltage of my choice to be able to test my circuit…
you can use your multimeter’s voltage range for measuring any voltage level
Please sir ,I want to build a variable voltage DC voltage source to be powering my circuit for testing.
Pls help me get the circuit with LCD.
Akinbi, you can try the following circuit with your variable supply circuit
https://www.homemade-circuits.com/make-this-simple-digital-voltmeter/
Pls sir ,how can i use or connect this circuit to my solar panels to be able to use it as solar charge controller?
2) Whatbis the load that is beside the battery in the circuit and what is the meaning of the 2 diode(6A4*2nos) connected to the Load?
Akinbi, I am sorry these are extremely basic things, and you should figure them out yourself.
Pls sir ,how can i use or connect this circuit to my solar panels to be able to use it as solar charge controller?
If you are using the first design, simply apply the solar voltage from the right side, that’s all. Make sure to use a 7812 IC for pin#8 of the opamp if the solar panel voltage is above 30V
goodevening swag can this circuits be used for 24vdc charging as well
Hi charles, yes you can use the same design for 24V battery also, just make sure the relay coil is also rated at 24V
sir swagatam,whats the maximum voltage lm358 can handle without damage?
32 V
sir swagatam,so if i connect the circuit to a 24v system should not have any worries? because my system is 24v battery and the supply is also 24v?
Make sure the output does not exceed 29 V, then no worries.
sir swagatam,is there any chanhttps://www.homemade-circuits.com/wp-content/uploads/2020/06/op-amp-transistor-solid-state-auto-cut-off.pngge in the values of the components incase am charging a 24v battery
TIP32 base resistor also will need to be changed to 4k7
Hello sir Swagatam,
Still on the second schematic.
1. Please what value of bridge rectifier diodes can I use that can handle any charging current? And
2. Supposing that I want to charge batteries in parallel, say for example, two 200Ah batteries. Do I have to upgrade the transfo to 40A transfo?
Hello Godson, the bridge rectifier current must to 2 times of the selected charging current, yes for 400AH battery you will need a 40AH or even slightly higher transformer…
I’m sorry sir, I didnt quite understand the second point in your answer. Please clarify it. Thank you sir.
I meant to say transformer, not battery…I have edited the previous comment accordingly.
Hello sir Swagatam. I can see that you’ve undated the second schematic. I’ll like to ask that suppose i want to use circuit to charge a battery bank of 36V, 48V and above, where will the pin#8 of LM358 be connected to since from the datasheet, the maximum supply voltage is 32V?
Hello Godson, pin#8 which is the positive of the IC must get a constant (+) supply, fixed at anywhere between 12V and 30V
Ok sir. Thank you very much.
you are welcome!
One more question sir. The power and ground pins of LM358 are not shown on the schematic. How should they be connected?
Pin#8 is positive, pin#4 is negative.
Hello sir Swagatam,
In the second schematic, it appears that the two input symbols are witched i.e the “+” is in the position of the “-” and vice versa. Or is it correct that way? Please confirm sir. Thank you.
Hello Godson, the marking are correctly assigned, and should be connected in the shown manner…the 1st and the 2nd concepts work on different principles, therefore the opamps are configured differently.
Ok sir. Its noted. I am designing the PCB for it so I needed to confirm before going ahead. Thank you very much for the prompt reply sir. Keep up the good work!
I would suggest that you first build it on a strip board, test it by practically, understand the concept thoroughly and only then go for the PCB
Yes I will do just that. Thank you sir.
Good day sir Swagatam. Please I still need more info as regards the second schematic.
1. What is the value of C1?
2. What is the value of the base resistor of the lower transistor?
3. What is the optimal charging voltage for 24V, 36V, 48V, 60V and 76V?
4. How can I get a constant voltage from a transfo output because after rectification, the voltage always increases? For example, to charge 12V battery, I need about 14.5V from the transfo. How do I get this voltage from say a 12V transfo or a 15V transfo?
Anticipating your usual prompt response. Thank you sir.
Hi Godson,
C1 can be a 2200uF/80V capacitor
you can use 10K for the lower transistor base.
It’s 14.3V for 12V, so you can find the proportionate values through a simple cross multiplication for the other voltages also.
the bridge and the filter capacitor will lift the 12V to a 14.3V DC coincidentally, same for the other levels, so the bridge and the filter cap will do it for you.
That is quite explanatory. Thank you very much sir.
you are welcome!
Hello sir Swagatam,
I asked for an automatic charger circuit and you referred me to this post. I understand that this circuit for monitoring the the charging. I was actually looking for the circuit that has both the power source and the charger. The charger should be able to charge batteries up to 200Ah and higher voltages such as 24V, 48V and higher. Please kindly help with one. Thank you sir.
Godson, The TR1 in the last diagram could be replaced with the charger winding output, the IC pinout should be supplied from a stepped down 12V source..and the relay replaced with a 30 amp relay.
Thank you very much for the prompt reply sir. I really appreciate it. So what you are saying is that as long as the transfo, the bridge rectifier and the relay contacts are correctly rated, the circuit will automatically charge any battery capacity and voltage. Is that correct sir?
Will the zener diodes be changed when using the circuit for higher voltages?
What is the diode symbols between the 1N4148 at the output of the opamp and the base resistors of the transistors? Are they indicator LEDs? If yes what will they indicate?
The charger winding must be rated at 20 amps for your 200 AH battery, if we assume this is correctly placed rest will be automatically handled by the charger circuit.
the zener diode is not critical, you can use a value anything between 3 and 9V.
the red/green symbols are the LeDs, in the last design, the upper red LeD will indicate the upper battery limit reached, similarly the lower red LeD will illuminate as long as the level is over the lower threshold.
Thank you very much for the prompt reply sir. I really appreciate it. I’ve really learnt a lot from you. Keep up the good work. God bless you sir.
You are welcome Godson, God bless you too!
Dear sir! I want to modify this circuit for 6v 4.5AH sealed lead acid battery. I need to start charging at 5.8 volt and cutoff at 7.1 volt. Please help me.
Dear Arul, you just have to follow the preset adjustment steps as explained in the article, and set them as per your mentioned specs
Thank you Mr swagatam…. it worked perfectly.
Sir pls can you shear a link for a converter that I can use to double my panels voltage…..
Also a step down converter that convert 24v downward…
Thank you in advance
That was quick abdulakeem 🙂 glad to know it worked!!
for a boost charger you can search for "IC 555 flyback converter circuit", you will get many good circuits on the net which you can use for doubling your panel V..
for stepping it down you can try the following circuit and adjust R8/R9 for getting the intended output
https://homemade-circuits.com/2015/05/5v-pwm-solar-battery-charger-circuit.html
Nothings happening while adjusting the lower pot…. while adjusting upper pot relay is vibrating…. I thought I have made mistakes in the connection same happen after I made another…. pls help…. It has cost me lot of money
if you do it without understanding then it will be impossible for you to succeed.
the circuit is very easy to set up if it's done after proper understanding.
so please first learn and then do the adjustments.
first apply the lower threshold voltage, and then adjust the lower preset until the red LED lights up.
after that keep increasing the voltage until the higher threshold level is reached, and now adjust the preset such that the relay just clicks.
before doing all these keep the presets at the ground level, meaning shift slider to ground level , and then slowly adjust upwards for the setting up as explained above.
…you must have a 0-16V or 0-24V variable power supply for setting up this circuit
.Sorry it lm338 regulator to drop solar voltage to 16v …. my solar reads 20v at max sunlight
Thank you….
OK you can try the following design
https://homemade-circuits.com/2012/04/how-to-make-solar-battery-charger.html
Am sorry to say am not sure if these will do what I want… my batteries are not gell. They are lipo, that requires care.. these circuit you refereed me to is extremely off what I want sir. Electronic component r expensive In my city… please I belief these above circuit should do wat I want…..pls help me I have made 2 of the above circuit, it has same outcome…
Pls carefully attend to this sir.. I have no mistake in my wiring…
After I finished the circuit. I wanted setting it up . I have two power adaptor one 12v and 16v respectively.
I followed the way u thought me to setup the circuit by first disconnecting 10k via pin 3. And feed in the cutoff voltage without the battery connected, and adjusting the lower 10k pot until the the red light illuminate…
I did just these nothing happened both the r and g light are on…
When I fed 16v and adjust the upper pot. The relay started vibrating…..
Please Mr swagatam these circuit is my last hope… help me please
Abdulakeem, just following me will not help…you will have to grasp the functioning of the circuit only then you will be able set it up correctly even without my help.
if your cell is LIPO then this circuit may not be suitable for it, because Lipo requires a balanced charger….but anyway the cut off setting up procedure is not relevant to the type of battery…because the setting up needs to be done using a variable power supply first.
you can also refer to the following article for more info regarding opamps in battery chargers.
https://homemade-circuits.com/2016/05/how-to-set-ic741-battery-charger.html
or you can do one thing first test the opamps separately as explained in this article, if they work then go ahead with the above design
https://homemade-circuits.com/2012/03/how-to-use-ic-741-as-comparator.html
Hello thank you… please give me a link to the lm358 regulator circuit…
Also about the above opamp circuit. I finally finished the circuit… I had lot of problem I would like u to attend to..
First I couldn't find 6A4 diode… I used 6A1 I start up the circuit with 12.6v at input the relay was vibrating until I removed and connected the diode directly.( Question ) was the 6A1 not equal to the 6A4?..
AGAIN I tink I still have problems setting up the circuit when I feed in 12.6 there are two led, the two leds lights up and nothing happens even wen I adjusted the upper ND lower pot?… (question) if I input the high cut off example 12.6v, and I adjust the upper pot is the red led soppose to light alone or the green?
If I have a battery higher than 12v can I still use 12v relay or I have to change to a higher one.
Also sir my upper op amp is gets hot and pot was blown.
Sir. Make a layman discription of setting up this circuit
Help sir….. thank you
Abdulakeem, you must first disconnect the feedback 10k resistor connected at pin3 of the upper opamp in the fist circuit.
after that adjust the lower preset to illuminate it's red LEd at just over the selected lower threshold value…and similarly adjust the upper preset to cause the relay to activate at the selected upper threshold voltage. once this is done you may reconnect the 10k feedback…that's done…. it's so simple.now you can connect the battery for the charging and the cut off
I have already explained the procedure in the article.
sorry which LM358 regulator are you looking for??
Pls sir, I have a solar panel that reads 20v at max sunlight. Can I connect it directly to the circuit?. Am a Lil confused because I set the circuit with 12.6v
Abdulakeem, you can use an LM338 based regulator circuit to drop the voltage to 15V and then use it with the above opamp based circuit.
Sorry Mr swagatam, am a lil confused on the transistor in the circuit, is it 2n2222?
Again setting up the circuit my battery won't exceed 12.3v they are lion packs… sir pls how do I set it up? Am sorry am just a hobbyist I might not understand some things u expected me get
yes the transistor is 2N2222 or you can try any other similar.
you must set up the cut off thresholds without connecting any battery initially, please confirm the cut off operations by manually adjusting the input supply voltages….once confirmed then you can test it with an actual battery.
I am not sure what is the higher cut off threshold for your Li-ion battery…normally for a 3.7V Li-ion cell its 4.2V
By the way did you connect the LEDs which are indicated in the diagram?….make sure to connect them so that you can get the relevant indications while adjusting the circuit
Thank you… it 4.2 full charge cut off.. so I have them in 3 parallel I.e 12.6v full charge…
OK, you meant to say in series….that's fine then…your battery will not charge beyond 12.6V
Thank you very much for introducing me to this circuit, this is exactly what I am looking for. Sir my questions
What's the value of the transistor? Is it a normal 2n2222 or it a n channel mosfet…
I quote ur reply: *Hi mars, remove the 1N4148 anode from the hysteresis resistor and connect it directly to pin#3 of the upper opamp and check the response…* are you saying the 10k resistor is not needed?
Again can the relay be just the normal 12v type?
Also the major problem I always have is setting up the circuit… pls sir help detail setting up the circuit
Thank you abdul,
2N2222is a BJT not a mosfet
the referred 1N4148 can be seen at the output of the lower opamp, this 1N4148 diode's anode could be directly connected to pin#3 of the upper opamp
the relay can be any 12V, but the contact current must be capable of handling the the charging current
set the lower preset such that the lower opamp output just becomes high when the voltage exceeds this lower limit….similarly set the upper preset such that the upper opamp output just goes high when the voltage exceeds this upper limit
Sir I have i have connected the variable power supply and I also got the concept u said but there is a problem I m able to set lower op amp to 11v but not able to set upper limit because as I set the voltage 14.4 the op amp switching at 10v only please help me
Sameer, I did not quite understand what you meant by
"because as I set the voltage 14.4 the op amp switching at 10v"
anyway you can try the following…remove all connections associated with pin#1 and pin#7 except the LED assembly connections.
repeat the LED assembly connections for the upper opamp output pin also.
Now repeat the setting up procedure as explained by me earlier.
If you understand the concept correctly then you will have any difficulty in setting it up
alternatively you can just confirm the following:
ensure that at 11V pin#5 voltage is just higher than pin#6
similarly just ensure that at 14.4V pin#3 voltage is just above pin#2 voltage
adjust these by rotating the respective presets.
Once the above is done rest will automatically fall in place.
thankyou sir. i will soon try and will reply
sir thank u for reply ,i have rebuilt the circuit but one more problem …
i have connected the 12v battery as it is new its showing me 12.90v but i am not able to set the lower limit because zener diode is of only 4.7 and at pin 2 and 6 i am getting 3.7v so as soon as i turn the pot opamp switches to +vcc .so please help me with this do i have to change the zener to 13 or14v
Sameer, please read the article properly for understanding the setting up procedure, the zener diode does not need any modification.
you will need a variable power supply for the procedures:
feed 11V first and adjust the lower preset such that the lower opamp output becomes just high.
next increase the voltage to 14.4V and adjust the upper preset such that the output of the upper opamp just becomes high….that's all
once this is done the cut-offs will automatically function for the connected battery.
while setting up the presets do not connect any battery
no sir i have connected in proper way but as i try to increase voltage ref pot is getting burnt
sir i have designed other circuit how can i send u its picture or image.
Sameer, if you have connected the center lead of the preset with the (+) pin of the opamp and still the preset is burning then your opamp may be faulty or short circuited….replace it with a new one and check again
sorry I can only discuss regarding circuits from this blog…
sorry sir pot is getting burnt
that means you have connected the pot in the wrong….the center lead must go to the opamp, the other outer leads must go to the positive and negative supply lines.
sir i have built the circuit but while adjusting pot 1 my zener diode is getting burnt
the zener is noway associated with the pot…you might have done something severely wrong with the connections.
hi swagatam
just wondering why you always use opamps for the chargers and not a proper comparator like the LM 311 or the LM 393 and what is the purpose of the 1K resister on pin 1 is the 10K not enough for the histeresis
Hi Mars,
It's merely because opamps like 741 and LM324 are more popular and easily available than LM311 or LM339.
as you increase the resistor value the hysteresis will decrease and vice versa, here we want the hysteresis to be towards maximum or infinity that's why we have selected the least resistance….
how would that work when most batteries are full at 13.8v and can not even reach 14.4v for cut off and completely discharged at 11.9v and going down below 50% which is 12.2v will damage the battery
all good batteries will reach the 14.4V mark, if not then the problem could be with the battery, and in that case the upper regulation would become meaningless since the battery itself is unresponsive above 13.8V.
The lowest discharge level is 10V but ideally it should not be below 11V.
at 11.9V the battery can be considered healthy with its charge capacity
what would you say is a good setting for the on and off time when charging a 12v battery at 14.4 volts
preferably charging should be switched off at 14.4V and restored at 11V
hi swagatam
after playing around with these battery chargers for a while i find that these opamp based chargers that checks the voltage and not the current moves from 12.6 to 14.4 very quickly and the opamp switches on and off but it is not really charging the battery as it only checks the volts
do you see the same and is there a remedy for better charging
Mars, opamps are not responsible for charging the battery, these are just sensors that are supposed to sense the battery voltage at the specified levels and initiate the cut-offs. The actual charging is done by the power supply source whose voltage and current must be correctly rated…for lead acid battery this must be set at 14.4V and current at 1/10th of batt AH.
With the above rate the battery should take 10 to 14 hours to get fully charged….if this not happening then either the power supply could be malfunctioning or the battery could be faulty.
The opamp based chargers are more than perfect with their jobs….voltage detection is the right way to go for making automatic battery chargers.
If i use two 12V 7Ah battery in parallel, can i use 12 volt 5A smps to charge the battery and do i want make changes in circuit
5 amp can be a little high, it must not be higher than 3 amp…you can add a 24V automotive lamp in series or use a 5 ohm 5 watt resistor in series.
the smps voltage must be 14.5V…12V will not do…no other changes would be required
is the 1k resistor on pin 1 not suppose to be the pull up resistor to the pos rail
No, it is correctly configured as indicated in the diagram.
also, this circuit will work with 24V battery ?
and if so, i'm little confused about the calculation of the 10K variable resisters
let say my output source is 24V what is my pre-set for the variables 10K ?
also the output to the load need to be constant at 3Amp with 24V
would i be able to keep it at 3Amp with 24V at the output, and what kind of voltage at the external power do i need?
this circuit can be used with a 24V battery (and a 28V input)
the resistor values need not be changed.
for acquiring a constant voltage you can include a LM338 circuit as shown in the following article and in series with the load
https://homemade-circuits.com/2013/06/universal-high-watt-led-current-limiter.html
thanks for responding,
i was referring to the 10K resister that is connected to pin 3/5 on A1/A2
those resistors suppose to have 3 pins? if so are they variable resistors and im just gonna keep them at 10K for the sake of having 3 pins resistors.
sorry it might be a stupid question, but im trying to understand as well as learn.
thank you.
does it makes any difference with Lm338 or Lm338T?
No difference according to me
What is the name of transistor T2 and the value of resistor in base and emitter of T2 ( ohms/ wattage ) in send diagram. Also is it a must to put heat sink in mosfet irf 540 and T2?
T2 = 2N2222
For R2 formula please refer to this article:
https://www.homemade-circuits.com/universal-high-watt-led-current-limiter/
yes heatsink will be required
thanks for responding,
i was referring to the 10K resister that is connected to pin 3/5 on A1/A2
those resistors suppose to have 3 pins? if so are they variable resistors and im just gonna keep them at 10K for the sake of having 3 pins resistors.
sorry it might be a stupid question, but im trying to understand as well as learn.
thank you.
those are presets or trimpots, they are variable resistors, their values are suggested to be 10K, meaning the resistance is variable from 0 to 10k
Also, what is the value of 6A4 ?
6A4 = 6 amp rectifier diode
yes it is a 6A4 diode in the image, and it will handle upto 4 amps easily and can be used for the above explained circuit
hi MR. Swagatam,
Thank you very much for the post and the circuit is great. I have a question, is it possible to switch the SPDT relay with a digital switch, as relays aren't really reliable?
thank you.
Hi Mamdouh,
relays are very reliable devices, but if you don't refer a relay you can use a mosfet, as explained in the above comment.
Hi Swagatam,
Thanks for nice Circuits. I need circuit idea to lighting the EXIT sign board with below requirement. Will you be able to help me ?
1) When AC main is there light should lit from AC->DC transformer same time it should charge 6V/12V battery and shut charging automatically when battery is full.
2) When AC mains is not there then EXIT sign light should lit using battery. Again load (light) should be disconnected when low battery.
Your circuit solves this problem. In this circuit relay is used, i think relay will consume battery current so i want MOSFET and Transistor to be used instead relay. I will use MOSFET or transistor which is cheaper and available with me so I am asking MOSFET as well as transistor.
Hope there is not much changes to be done to circuit.
3) In relay / MOSFET / Transistor which is less current consuming ?
Thanks for great, simple and effective circuits.
-Raghavendra
Hi Raghavendra, yes the above circuit will be quite suitable for your application.
A relay will consume some current but it will be negligible in comparison to the load current, but if you don't want this you can remove the relay and replace the BC547 transistor with a P channel mosfet and connect the battery across its drain and the negative line of the circuit.
the load may be connected via another mosfet (N channel), whose gate may be connected with the output of the lower opamp, source with the negative line and the load across its drain and the powitive line of the battery
mosfet and BJT both will consume no idle current, only a relay will consume some current while it's in the triggered mode.
Hi Swagatam, would you please clarifying more about replacing the relay and BC547. the BC547 your referring to in the circuit is the 2N222 if im not mistaken?
Also as P or N mosfet Chanel they both has, Drain, Gate, and Source.
I'm confused with both on how to connected with the above circuit.
Thank you.
yes that's correct, I am actually referring to the 2N2222.
the mosfet connections are explained in the previous comment…sketch the diagram according to the instructions and you will be able to get the idea
after testing the circuit i find the zeners to be losing about 1v as it is only getting about 1 ma with the 10k resisters
when adjusting the 10k resistors for about 10ma it is much more stable and is almost working at the zener voltage
the zener is for creating a fix reference level for the opamps, and 10K will not affect this functionality in any manner….
hi
the circuit is running now but it does not like the 1n4148 connection
then how will the lower cut-off work…..that's not possible, I think your opamps are not good.
working better but circuit is unstable
No, that shouldn't happen, opamps are extremely straightforward components, and moreover the preset adjustments are wide apart so instability cannot happen…connect LEDs across the opamp outputs to check the responses during their switching
hi swagatam
when testing your circuit we find setting A2 does not set the bottom limit for switching the relay but only for the led
Hi mars, remove the 1N4148 anode from the hysteresis resistor and connect it directly to pin#3 of the upper opamp and check the response…
Hi Swagatam
Interesting circuit. However, I think the value of the feedback resistor should be 100K instead of 10K. What do you say?
BTW, have you tested this circuit?
Hi Abu Hafss, the low value resistor is purposely selected to hard latch the upper opamp when it detects the full charge threshold….the delatching operation of this opamp is done by the lower opamp output when the battery reaches the lower threshold.
Please clear i can understand "the 4V constant can be achieved using a emitter follower voltage regulator buffer"
at the output of the joule thief circuit you will need to connect the following type of circuit for achieving 4V constant…by using a 4.7V zener at the base:
https://homemade-circuits.com/2012/08/simplest-dc-cell-phone-charger-circuit.html
Can it solve issue of low self consumption
No, there will be always some minimum consumption by the circuit….around 5mA when there's no input supply
Sorry dear i am so excited from your blog dear I have one more problem
I have required a boost controller of gprs data logger which have 1A load at the time of network searching or data transmission for 10ms than normal on 50ma sleepmode current is 600uma
In put 2 to 3.6 volt from lithium primary call with 250ma output
Output constant 4v 1A
Due to long life period of battery it must to self cunsuption of circuit is lower qucent current
I founded a circuit of LTC3125 but this ic is not Easley available
So that suggest any easy circuit according to availability of spare and lower self consumption
Thank
Awaiting your response friend
If you like send me your whatsapp no
Gajendra 9414134388
Thanks Dear, I appreciate your response!
The input current should be at least 1.2 Amps….you cannot get 1amp output from a 250ma input
To get 4V constant from a 2 to 4V input I think you could use joule thief concept, as shown in the following figure:
https://homemade-circuits.com/2012/10/1-watt-led-driver-using-joule-thief.html
use 10 turns for both the winding instead of the shown 20 turns and 0.6mm wire thickness
the 4V constant can be achieved using a emitter follower voltage regulator buffer
can the input supply be a solar panel? is this a monitor for batteries or a charger with battery monitor?
it will work with solar panel input, and monitor the cut-offs with battery alone or with an input
Very Usefull to all electronic hobbiests. Thanx from all hobbiests.
it's my pleasure
Hello sir Swagatam Majumdar
I am a big fan of your circuits and find them very helpful. I have been viewing all of your circuits for long long time now.
How ever Please can you help me on this circuit. I have built it and connected everything correctly! how ever, You did not mention how to set up the cut off limits. I need to know how to set the turn on voltage for charging and the cut off voltage for when it is full. how do you adjust the 10K preset pots to your desired voltage values..??
kind Regards Darren
Thank you Darren, I appreciate your enthusiasm.
for the above circuit you just have to set the lower preset to get a high at the output of the lower voltage, this must be done for the lower voltage threshold of the battery.
Similarly the upper preset should be adjusted to get a high at the output of the upper opamp, and this must be done for the higher threshold or the full charge threshold of the battery.
Once the above adjustments are done , the circuit can e expected to work automatically and produce the proposed cut off functions.
COMMENT BOX IS MOVED AT THE TOP