Comparator Hysteresis: Stop the Chatter

Surface-mount ICs and resistors on a circuit board. Cover for Comparator hysteresis.

Quick answer

A comparator with no hysteresis will chatter whenever the input crosses the threshold slowly, because its own noise and the input's noise are enough to push it back and forth. The fix is positive feedback from the output to the reference node, which moves the threshold depending on the output state. The width of that window is (VOH − VOL) × R1/(R1 + R2), where R1 is the feedback resistor and R2 goes to the reference. For a 3.3 V output and a 10 kΩ / 680 kΩ pair, that is about 48 mV — enough to stop chatter, small enough to keep the trip point accurate.

Executive takeaways

  • Hysteresis is a threshold offset, not a filter. It does not slow the comparator down; it changes the level at which it switches depending on which way the input is moving.
  • The output swing sets the width. A rail-to-rail comparator with a 3.3 V swing gives more hysteresis than an open-drain part with a 1.8 V pull-up, for the same resistors.
  • Too much hysteresis is a real error. It becomes a fixed offset in the trip point that varies with nothing, and it hides slow drifts that the circuit was supposed to detect.
  • Above a few hundred kilohertz, use a Schmitt trigger IC. Discrete feedback around a fast comparator invites oscillation at the package and layout level.

1. Why a comparator chatters

An ideal comparator switches when V+ = V−. A real one has finite gain, a propagation delay and input noise measured in microvolts to millivolts, and the input signal itself carries noise. When the input moves slowly through the threshold, the differential voltage stays inside the noise band for a long time, and the output follows the noise: a burst of transitions at every crossing.

Downstream this looks like a counter that increments hundreds of times, an interrupt storm, or a relay that buzzes. The oscilloscope trace shows a clean, slow ramp and a digital output that is anything but clean.

The cure is to make the threshold depend on the output state. Once the output switches, the threshold moves away from the current input value, so the noise has to overcome the offset before it can switch back.

2. The circuit and the formula

Take a comparator with the signal on the inverting input and a reference on the non-inverting input. Add a resistor R1 from the output to the non-inverting input, and R2 from the non-inverting input to the reference source. The non-inverting node is then a weighted average of the output and the reference.

VHYST = (VOH − VOL) × R1 / (R1 + R2)

The centre of the window sits at the reference voltage, and the two thresholds are VREF ± VHYST/2 for a symmetric divider. If the output is open-drain with a pull-up to a different rail, use that rail's swing in the formula — the hysteresis shrinks with it.

R1 (feedback) R2 (to reference) Hysteresis at 3.3 V swing Use
10 kΩ 1 MΩ 33 mV Clean signal, small offset
10 kΩ 680 kΩ 48 mV General purpose
10 kΩ 220 kΩ 143 mV Noisy input
10 kΩ 100 kΩ 300 mV Mechanical switch

The ratio, not the absolute values, sets the width. Absolute values set the loading on the reference and the impedance seen by the input, which is why 10 kΩ is a common starting point rather than 1 MΩ.

Table of feedback resistor ratios and resulting hysteresis width for a 3.3 volt output swing
Hysteresis width against resistor ratio. The output swing multiplies the whole column.

3. Worked example: 12 V supply monitor

Monitor a 12 V rail, trip when it falls below 11 V, and add 50 mV of hysteresis around the divided threshold. The divider is 10:1, so 11 V becomes 1.1 V at the comparator.

  • Required hysteresis at the comparator input: 50 mV.
  • Ratio: 50 mV / 3.3 V = 0.01515 = R1/(R1 + R2), so R2/R1 = 65.
  • Values: R1 = 10 kΩ, R2 = 650 kΩ; the nearest standard value is 680 kΩ, which gives 3.3 × 10/690 = 47.8 mV.
  • Reference: 1.1 V. Use a divider from a stable rail, or a shunt reference if the trip point has to be accurate over temperature.
  • Referred to the 12 V rail: the hysteresis is 47.8 mV × 10 = 478 mV, so the rail trips at 11.0 V falling and resets at 11.48 V rising. That is the number that matters to the system.
  • Sanity check: 478 mV of hysteresis on a 12 V rail is 4%. If the supply is expected to sag to 11.2 V under load, the circuit will trip on a load step and stay tripped — which may be exactly what is wanted, or exactly what is not.

That last point is the design decision. Hysteresis referred to the comparator input is small; referred to the monitored rail it is multiplied by the divider ratio. Always convert back before deciding whether the value is acceptable.

4. Inverting versus non-inverting

The two topologies behave differently and are easy to confuse:

  • Signal on the inverting input, reference on the non-inverting input: the output goes high when the signal falls below the threshold. This is the natural "power-good" or "undervoltage" configuration.
  • Signal on the non-inverting input, reference on the inverting input: the output goes high when the signal rises above the threshold. Positive feedback still goes to the non-inverting input, which is now the signal node.

In both cases the feedback resistor connects output to the non-inverting input. Putting it on the inverting input gives negative feedback, which turns the comparator into a (bad) amplifier and produces a linear output instead of a switching one.

5. Open-drain outputs change the arithmetic

An open-drain comparator with a 1.8 V pull-up has a 1.8 V swing, not 3.3 V. The hysteresis is 55% of what the same resistors would give with a rail-to-rail part. If the design was copied from a 5 V circuit and the rail changed, the hysteresis changed with it — usually downward, and usually unnoticed.

Open-drain is still the right choice for wired-OR chains and for level shifting, but the feedback resistor has to be recalculated for the actual pull-up rail.

6. Speed, delay and when to use an IC

Positive feedback around a fast comparator creates a circuit that can oscillate at the comparator's own bandwidth if the layout is poor. The feedback trace adds capacitance to the input node, and the output edge couples back through it. At a few hundred kilohertz this is manageable; at tens of megahertz it is not.

For fast signals, a Schmitt trigger logic gate or a comparator with internal hysteresis is the correct answer. Those parts specify the hysteresis in the datasheet, typically 100–500 mV, and their internal design keeps the threshold stable over temperature. A discrete feedback network does not.

There is also a middle option: comparators with a programmable hysteresis pin, which apply the same idea internally with better matching.

7. Five mistakes we see

1. No hysteresis on a slow input. The output chatters at every crossing, and the downstream counter or interrupt handler does the rest.

2. Hysteresis computed at the comparator but not at the rail. 48 mV at the input is 478 mV on a 12 V rail, which may be far more than intended.

3. Feedback to the wrong input. Negative feedback makes an amplifier; the output sits at an intermediate level and the circuit behaves like a slow, inaccurate buffer.

4. Forgetting the open-drain swing. The same resistors give less hysteresis than the calculation assumed.

5. Loading the reference. The feedback network and the input bias current both draw from the reference; a high-impedance divider from a weak reference moves when the output switches.

8. Selection checklist

  • Required trip point, and the divider ratio that produces it.
  • Noise amplitude on the input, and the hysteresis needed to cover it.
  • Output swing, including open-drain pull-up rail.
  • Hysteresis referred back to the monitored rail, not just the comparator input.
  • Reference accuracy and temperature drift.
  • Propagation delay and whether the signal is fast enough to need an IC with internal hysteresis.
  • Input bias current and its effect on a high-impedance divider.
  • Behaviour during power-up and power-down, when the reference may be absent.

FAQ

How much hysteresis do I need?

Enough to cover the peak-to-peak noise at the comparator input with margin — typically 2–3× the noise amplitude. More than that starts to distort the trip point.

Does hysteresis affect the accuracy of the trip point?

It creates two trip points instead of one. If the system cares about the exact threshold, the centre of the window is the number to specify, and the width has to be small relative to the tolerance.

Can I use a resistor divider instead of a reference?

Yes, if the rail it divides is stable enough. A divider from the same supply being monitored gives a trip point that moves with the supply, which is usually not what you want.

Why does my comparator output sit at 1.6 V?

Because it is operating as an amplifier, not a switch — usually negative feedback on the wrong pin, or a missing pull-up on an open-drain part.

Can I add hysteresis with a capacitor?

A capacitor across the feedback resistor adds AC hysteresis and slows the switching, but it does not define a DC threshold window. It is a supplement, not a substitute.

Do I need hysteresis on a fast, clean signal?

Usually not, if the edge rate is high compared with the noise. It costs nothing to add a small amount, and it protects against the case where the signal slows down at temperature or under load.

What is the difference between a comparator and an op-amp here?

A comparator is designed to saturate cleanly and to recover quickly from overdrive; an op-amp is designed to stay linear. Using an op-amp as a comparator works at low speed and fails at high speed or with large differential inputs.

Glossary

Hysteresis
Difference between the rising and falling threshold of a switching circuit.
Positive feedback
Feedback that reinforces the output state, used here to move the threshold after switching.
VOH / VOL
Output high and low voltages; their difference sets the hysteresis width.
Chatter
Repeated switching caused by noise around a single threshold.
Schmitt trigger
Logic input or gate with built-in hysteresis.
Open-drain
Output that pulls low only; the high level comes from an external pull-up.

Sources

Stopping a threshold from chattering?

Browse analog ICs and integrated circuits, or send the trip point, noise amplitude and speed and we will shortlist comparator or Schmitt trigger options.

Browse In-Stock Components  ·  Submit Your BOM

Related reading: ADC input RC filter, shunt resistor current sensing, and level shifting options.

Check stock by part number

Turn this insight into a sourcing decision.

Need pricing or a drop-in alternative? Submit a BOM / RFQ or talk to our team.