Give it the trip points you want and it returns real E-series resistors, the reference voltage those thresholds actually imply, and the thresholds you will measure with the reference you have — then checks the result against the input noise you expect.
| You asked for | With real parts and your reference | Error | |
|---|---|---|---|
| Upper trip VTH | |||
| Lower trip VTL | |||
| Hysteresis band |
Runs entirely in your browser. Nothing is uploaded, stored, or sent anywhere.
A bare comparator has enormous gain and no memory. When the input sits near the threshold — which is exactly where it sits during any slow transition — a few millivolts of noise crosses the trip point repeatedly, and the output produces a burst of edges instead of one. On a slow ramp that burst can be hundreds of transitions.
Downstream that is rarely harmless. A counter counts them, an interrupt fires on each, a relay buzzes, a motor controller sees a stream of contradictory commands. It is also intermittent and load-dependent, which makes it a genuinely unpleasant fault to chase after the boards are built.
Hysteresis fixes it by making the threshold depend on the current output state: once the output flips, the trip point moves away from the input, so noise has to be larger than the hysteresis band to flip it back.
Vhyst = (R1/R2) · (VOH − VOL),
centre set by VrefVhyst = Rref/(Rref+Rf) · (VOH − VOL),
centre set by VrefThe width of the band depends only on the resistor ratio. The position of the band depends only on the reference. They do not interact, which means you can design them separately — set the reference for where you want to trip, then choose the ratio for how much noise immunity you need.
It also means scaling both resistors together changes nothing electrically. That freedom is what lets you move the network impedance up to stop loading the source or the output, or down to reduce the offset caused by input bias current flowing through it.
With an open-drain comparator, VOH is not a property of the comparator at all — it is set by the pull-up resistor. And the feedback resistor is a second path to that same node, so the pull-up and the feedback network form a divider and the real VOH sits below the rail. Feed the loaded value into the calculator, not the supply voltage, or the hysteresis will come out smaller than predicted.
The same node also has to charge whatever capacitance is on it through the pull-up, so an open-drain output is slower on the rising edge — which on a fast comparator can be the dominant limit on how quickly the feedback actually arrives.
Enough to exceed the noise, with margin. Two to three times the peak-to-peak noise is a common starting point, and the noise to use is the noise at the comparator input — including supply coupling and whatever the input filter did not remove, not just the sensor's own datasheet figure.
The cost of more hysteresis is accuracy: a 200 mV band means the trip point is uncertain by 200 mV depending on which way you arrived. For a threshold detector that is usually irrelevant; for a precision level measurement it may not be, and the answer there is a filter before the comparator rather than a wider band.
Each of these runs entirely in your browser. Nothing is uploaded, stored or sent anywhere, and none of them needs an email address.
See all 49 engineering tools →
We add tools here fairly often and write up the things worth writing up — a stackup that behaved oddly, a standard that turned out to be obsolete, a calculator that was quietly wrong. Join and you get told when something new lands.
One email a month at the very most, and usually less. No drip sequence, no sales cadence, no sharing your address with anyone. Unsubscribe whenever you like.