Comparator Hysteresis Calculator
Use this tool for a 2-resistor positive-feedback network where the threshold node is tied to Vout through Rfb and to Vref through Rref.
Why Comparator Hysteresis Matters
A comparator without hysteresis can chatter when the input sits near its switching point. Noise, ripple, and small disturbances make the output bounce rapidly between high and low. Hysteresis fixes that by creating two thresholds instead of one: an upper threshold and a lower threshold. The input must move farther before the output can switch back.
This behavior is often called a Schmitt-trigger response. In practical designs, hysteresis makes circuits far more stable in the real world, especially when you are monitoring slow analog signals, battery voltages, sensor signals, or noisy rails.
Circuit Model Used by This Calculator
The calculator assumes the threshold node is made by a resistor divider between Vout and Vref:
- Rfb: from comparator output to threshold node
- Rref: from threshold node to reference source (Vref)
If VOH is greater than VOL (the usual case), then the threshold with output high is the upper threshold, and the threshold with output low is the lower threshold.
How to Use the Calculator
1) Enter your electrical levels
Provide the actual output levels of your comparator stage. If you use an open-collector/open-drain output with pull-up, use the real resulting VOH and VOL, not ideal values.
2) Enter resistor values
Only the ratio matters for threshold math, so any consistent unit is fine (for example both in kΩ).
3) Choose mode
- Inverting mode: Vin goes to the minus input. Rising Vin typically crosses the upper threshold first.
- Non-inverting mode: Vin goes to the plus input. Transition directions swap, but threshold values are unchanged.
4) Click “Calculate Thresholds”
You will get upper/lower thresholds, midpoint, hysteresis width, and switching direction notes.
Designing for a Target Noise Margin
A practical way to size hysteresis is to estimate the peak-to-peak noise at the comparator input and choose hysteresis comfortably larger than that noise. As a quick starting point:
- Low-noise lab signals: hysteresis around 2–4× expected noise amplitude
- Industrial or high-EMI environments: sometimes 5× or more
Use the built-in design helper to solve Rfb for a desired hysteresis width while keeping your chosen Rref value.
Worked Example
Suppose:
- Vref = 2.5 V
- VOH = 5 V
- VOL = 0 V
- Rfb = 100 kΩ
- Rref = 10 kΩ
The calculator gives approximately:
- Upper threshold ≈ 2.727 V
- Lower threshold ≈ 2.273 V
- Hysteresis width ≈ 0.455 V
That means the input must move by nearly half a volt to reverse state, which significantly reduces false toggling in many 5 V systems.
Practical Design Tips
Check input common-mode limits
Some comparators or op-amps used as comparators cannot sense all the way to both rails. Make sure your thresholds are inside valid input range.
Mind propagation delay and source impedance
Very high resistor values reduce current but can increase susceptibility to leakage, bias currents, and stray coupling. Values from roughly 10 kΩ to a few hundred kΩ are common starting points.
Use real output levels
VOH and VOL are rarely ideal rails under load. Datasheet output swing and pull-up resistor choices directly change threshold levels and hysteresis width.
Quick Troubleshooting Checklist
- Output still chatters: increase hysteresis or reduce input noise/bandwidth.
- Switch point is shifted: verify resistor placement and actual VOH/VOL levels.
- Thresholds look impossible: check comparator input range and supply rails.
- Unstable at startup: review power-up sequencing and reference source behavior.
With correct hysteresis, your comparator behaves cleanly, even when the input is slow or noisy. Use the calculator to iterate quickly and then verify with simulation or bench data.