# Adding hysteresis to over-voltage protection using comparator

I am trying to add hysteresis into my over-voltage detection circuit. The output of the comparator should be high as long as the supply voltage is below 14 V.

The circuit works perfectly fine, but I would like to add hysteresis, so that after going low the output only goes high again if the supply voltages reaches about 13.5 V.

Can anyone give me a suggestion here?

If you flip vertically the left part of the Simon Fitch's schematic and swap the comparator's inputs, you can solve the problem with the "stiff" Zener diode voltage in another way.

simulate this circuit – Schematic created using CircuitLab

• oh wow, I like that a lot as well! Apr 16, 2023 at 14:58

You need positive feedback, to implement hysteresis, and it's pleasantly easy to implement straight into your design.

You need a resistor from the output back to the non-inverting input, in order for the changing output to be able to "modulate" the reference voltage there by a small amount.

The trouble is that zener diode D1 and resistor R3 form a very low impedance voltage source, which will be hard for such a feedback resistor to fight against. Therefore we also need to "loosen up" the voltage at the non-inverting input with a second additional resistor, so that the feedback resistor is able to have some influence:

simulate this circuit – Schematic created using CircuitLab

These additions are R4 and R5, but I've also changed R1 and R2 to set the midpoint of hysteresis:

As a rule of thumb here: the output swings between 14V and 0V, near the switching threshold, and the ratio $$\\frac{R5}{R4}\$$ will be roughly representative of what fraction of that 14V swing will be presented to the non-inverting input. That's about $$\\frac{15k}{1M}\times 14V = 210mV\$$.

This amount isn't the hysteresis visible at the output (between the green markers), because the other, inverting input, changes by only $$\\frac{10k}{10k+13k} = 43\%\$$ of the change in supply at IN. So 210mV is how much the inverting input must change for the output to switch over.

The change in output that would produce a 210mV change at the inverting input is $$\\frac{210mV}{43\%} = 490mV\$$, and that's the interval you see between the green markers.

To increase the hysteresis interval, decrease R4 (or increase R5), and to set the midpoint of that interval, alter R1 and/or R2 to raise or lower the inverting input potential.

• wow, thank you for the detailed explanation. I was trying to add a feedback resistor to the positiv input without seeing any effect. I didn't quite understand what you ment by loosening up the voltage source that D1 and R3 form. Any chance you can elaborate this once more for me? Apr 15, 2023 at 21:58
• Hint: Swap R1 with D1 :-) Apr 15, 2023 at 22:00
• @Axodarap consider D1/R3 as producing a very "rigid", or "stiff" 6V potential. It's difficult to move it away from 6V. If you wanted to shift it, you would have to inject or extract a lot of current from that source. R5 has one end (A) fixed to that rigid point, and in the absence of any current through it, its other end (B) has the same potential, 6V. The difference is, that with only a little current, you can cause a voltage drop across R5, causing B to deviate above or below A. Thus source B is a "loosened" version of immovable A. Apr 16, 2023 at 3:36
• @Axodarap I admit that analogy of loose/stiff might not be ideal. Think of R4+R5 as a potential divider between two voltage sources, one a fixed 6V and the other (the comparator output) variable. The junction of the two resistors will change in potential by some fraction of changes at the output. Smaller R5 reduces that fraction, staying closer to 6V (which I call "stiffer"). Larger R5 increases the fraction, less coupled to the 6V source ("looser"), more coupled to the output instead. Apr 16, 2023 at 3:52
• that was very helpful, thanks a lot! Apr 16, 2023 at 14:57
1. Place a 1 k resistor in series, between D1 and the + input of U1
2. Place a 100 k resistor between the + input of U1 and the output of U1

That will give you a 140 mV hysteresis. To reduce it, increase the value of the 100 k resistor.

By the way, it's easier to do what you're doing with a "supervisor" IC: https://www.digikey.com/en/products/filter/supervisors/691