help with hysteresis calculation of back-up battery circuit

Thread Starter


Joined Apr 4, 2009
This is my first post and hopefully the .pdf file I attached shows up properly.

So, I found this circuit that can be used to provide back-up battery power to a circuit when you don't have power from your outlet. When you do have power from your wall outlet it will recharge your batteries with a current which is appropriate for the voltage across the battery. When the circuit is running off battery power it will disconnect the battery from the load so it does not over-drain the battery and damage it. It does this by using some hysteresis with op-amp U1a in the pdf file. The file says the lower switching threshold is 5.5V and the upper switching threshold is 6.5V.

Now, I need to adapt this circuit because I have different voltage for my batteries and a different wall outlet voltage of 15V. (Note, I also don't need all the rectification or wave enveloping from R2, R3, D5, C2 because I am using an adapter that gives 15V and about 800mA max, i.e., it is already DC.) I am using 8 Ni-MH batteries at 1.2V each and 2200mA-h. I don't want my batteries to go below 1.0V each which gives a lower threshold limit of 8.0V and maybe an upper threshold of 8.5-9.0V for the hysteresis.

Now that I got all that out of the way I wonder if anyone is able to tell me if my steps to solving for the threshold values in the hysteresis are correct so that I may choose my own resistor values to set my own threshold levels. I hope this isn't confusing I feel like I've done too much writing. Anyhow I will show you my calculations and if there are errors let me know.

(note switch S is open so no voltage from outlet/transformers/rectifier)

Current going into pin-3/V+ is zero.

i1 + i2 - i3 = 0

(V-batt - V+)/(8.2k) + (V-out - V+)/(39k) - (V+ - 0V)(2k) = 0

Where: V-out is output voltage of op-amp

So, switching occurs when V+ is equal to V-ref which is 1.2V according to the pdf.


(V-batt - 1.2V)/(8.2k) + (V-out - 1.2V)/(39k) - 1.2V/2k = 0

To determine threshold we want to find V-batt, but V-out can be in two states, Vs+/pin-8 OR Vs-/pin-4. So, we solve for each case separately.

When V-out = Vs+ we have V-out = V-batt, giving:

(V-batt - 1.2V)/(8.2k) + (V-batt - 1.2V)/(39k) - 1.2V/2k = 0

Solving for V-batt:

V-batt = [(1.2V)*(39k)*(8.2k)/(2k) + (39k + 8.2k)*(1.2V)]/[(39k)*(8.2k)]

V-batt ≈ 5.3V

When V-out = Vs- we have V-out = 0V, giving:

(V-batt - 1.2V)/(8.2k) + (0V - 1.2V)/(39k) - 1.2V/2k = 0

Solving for V-batt:

V-batt = (1.2V/2k + 1.2V/39k)*(8.2k) + 1.2V
V-batt ≈ 6.4V

So using the resistor values given I get a lower threshold of 5.3V and an upper threshold of 6.4V, though the pdf says 5.5V and 6.5 (they quote 5.5 V and 6.5V for convenience maybe?). Any errors/mistakes, anything I'm missing?

I'm also not sure about the purpose of resistor R7.

I'm far from a pro with circuits this is my first project really building any circuits so I may not be familiar with some things but I'm smart enough to understand if explained.

Thanks for the help.



Joined Mar 6, 2009
I got 5.34V and 6.37V for the lower and upper thresholds - which agree pretty well with your values.

U1 a & b, being dual comparators each have an open collector output requiring a pull-up resistor - R7. The outputs can be wired together as shown without any harm being caused.

Thread Starter


Joined Apr 4, 2009
Okay great. I'm going to assume then that they were just rounding to the nearest 0.5V or something when they report 5.5V and 6.5V. Thanks a lot though is really helps. Much appreciated.