Opamp Low High Battery Charger Controller Circuit

The post discusses a two opamp low high battery charger controller circuit which is 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.

The Request

Hi Mr Swagatam,

I’ve got the idea, please bear with me, because
I’m new to circuits design. i actually thought about using opamps to
create the circuit that i need, so that makes me feel better i was
heading in the right direction.

However, how can i upgrade this smart emergency light circuit to
operate on 26-30 volts and 3 amps. I’ll be using a dc to dc voltage
booster and steady current between the battery and this circuit, as the
battery wont be able to supply the required voltage.

so, I’m not sure if
this circuit will still remain to operates with the voltage booster
between the battery and the circuit. also, i will have another voltage
booster to be connected the main power adapter as the adapter will only
produce 19v and i need 26-30 volts. I’m kinda lost with this part because
i need circuit to:

1) as soon as i connect the external power
automatically it will disconnect the battery and supply the system, in
the mean while charging the battery.

2) overcharging protection ( which included in the above design).

3) battery low and full charging indicates (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)

also, 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

Also, the cpu fan will supplied by the system too.

it would be great too to add the option of a dimmer, my original plane was to vary between 26-30 v not need much more than that.

it’s a flash light design but using higher wattage LED.

I’m sorry for those many questions, but i’m trying to get
help and improve my skills in designing as i’m very new to electronics

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.

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 this calculator can be used which gives you the approximate battery back up time.


63 Replies to “Opamp Low High Battery Charger Controller Circuit”

    1. darren70215

      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

    2. Swagatam Post author

      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.

  1. Gajendra Mishra

    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
    Awaiting your response friend
    If you like send me your whatsapp no
    Gajendra 9414134388

  2. Abu-Hafss

    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?

    1. Swagatam Post author

      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.

  3. mars

    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

    1. Swagatam Post author

      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…

    1. Swagatam Post author

      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

  4. mars

    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

  5. Raghavendra

    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.

    1. Swagatam Post author

      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.

    2. Mamdouh Mikhail

      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.

    3. Swagatam Post author

      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

  6. Mamdouh Mikhail

    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.

    1. Swagatam Post author

      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.

  7. Mamdouh Mikhail

    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?

    1. Mamdouh Mikhail

      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.

    2. Mamdouh Mikhail

      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.

    3. Swagatam Post author

      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

    1. Swagatam Post author

      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

  8. mars

    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

    1. Swagatam Post author

      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.

  9. mars

    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

    1. Swagatam Post author

      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

  10. mars

    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

    1. Swagatam Post author

      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….

    1. Swagatam Post author

      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.

  11. sameer

    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.

    1. Swagatam Post author

      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

  12. sameer

    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

    1. Swagatam Post author

      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

  13. sameer

    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

    1. Swagatam Post author

      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.


Leave a Reply

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