A comparator watching a slow, noisy signal crossed its threshold 1,442 times in one second when it should have switched four times. Add 300 millivolts of hysteresis, a second threshold set slightly apart from the first, and the count dropped to exactly four. Those figures come from a short Python simulation run for this post, using resistor values from a Texas Instruments reference circuit. The circuit that does this trick is called a Schmitt trigger, and it is the reason a cheap 74HC14 chip turns a wobbly sensor reading or a bouncing button into a clean digital edge.
The problem with a single threshold
Noise at the crossing point
A plain comparator has one job: report whether the input is above or below a reference. That works for a clean, fast signal. It fails when the signal drifts slowly across the reference while carrying even a little noise, because every tiny wiggle near the threshold flips the output.
Texas Instruments puts it plainly in its application note SNOA997, “Inverting Comparator With Hysteresis Circuit”: “With noise, signal variation, or slowmoving signals, undesirable transitions at the output can be observed.” A thermostat that clicks a furnace on and off dozens of times as the room passes 68 degrees is the household version of the same fault.
What hysteresis changes
A Schmitt trigger uses two thresholds instead of one. The output only switches high-to-low after the input climbs past an upper threshold, and only switches back after the input falls below a lower threshold. Between the two, the output holds whatever state it already had. Noise smaller than the gap between the thresholds cannot cause a second flip, because after the first crossing the circuit is waiting for a different number.
The gap is the hysteresis. Too small and noise still gets through. Too large and the circuit becomes sluggish about real changes.

How a comparator gets two thresholds
Positive feedback
The trick is positive feedback: a resistor from the output back to the input that the comparator compares against. When the output changes state, it drags that reference node up or down slightly, which moves the threshold away from where the input currently sits. The input now has to travel further to undo the change.
TI’s worked example
SNOA997 designs an inverting comparator for a 3 V supply with an upper threshold of 2.5 V, a lower threshold of 2.2 V, and 300 mV of hysteresis. It uses an open-drain comparator with a 100 kΩ pull-up (R3), a 500 kΩ resistor to ground (R2), a 112 kΩ resistor to the 3 V reference (R1) and an 809 kΩ feedback resistor (R4). The note derives each threshold from Kirchhoff’s current law at the comparator’s reference node, one equation with the output high and one with it low.
Checking the numbers
Solving those same node equations in Python with the rounded resistor values gave:
| Output state | Threshold | TI design target |
|---|---|---|
| High (pulled to 3 V through R3 + R4) | 2.5012 V | 2.5 V |
| Low (R4 to 0 V) | 2.2019 V | 2.2 V |
| Hysteresis | 299.3 mV | 300 mV |
The standard resistor values land within a few millivolts of the design, which is about as close as 1 percent resistors allow in practice.
A simulation: counting false transitions
The setup
To see the difference, the simulation fed both circuits a 2 Hz sine wave centred on 2.35 V and swinging 0.5 V each way, so it crossed the 2.2 to 2.5 V band four times per second. Gaussian noise was added at three levels, sampled 100,000 times per second. The single-threshold comparator switched at 2.35 V, the midpoint of the band. The Schmitt version used the 2.2019 V and 2.5012 V thresholds computed above.
The results
| Noise (standard deviation) | Single-threshold transitions | Hysteresis transitions | Ideal |
|---|---|---|---|
| 20 mV | 1,442 | 4 | 4 |
| 50 mV | 3,549 | 6 | 4 |
| 100 mV | 7,308 | 583 | 4 |
At 20 mV of noise, hysteresis removed every false transition. At 50 mV, two extra flips slipped through. At 100 mV the noise regularly spanned more than the 300 mV gap, since random noise with a 100 mV standard deviation reaches 300 mV from its centre often enough over 100,000 samples, and hundreds of false edges came back.
The rule that falls out
Hysteresis has to be wider than the peak-to-peak noise at the crossing, not its average. The simulation shows the failure is gradual rather than sudden, which matches what happens on a bench: a design that worked fine in a quiet lab starts chattering next to a motor.

The 74HC14: hysteresis in a chip
What the datasheet promises
For logic-level work the simplest option is a gate with hysteresis built in. The SN74HC14 datasheet (TI document SCLS085L) describes six Schmitt-trigger inverters in one package. Its electrical characteristics table at 25 °C gives typical thresholds of:
| Supply | Rising threshold (VT+) typ | Falling threshold (VT−) typ | Hysteresis (ΔVT) typ |
|---|---|---|---|
| 2 V | 1.2 V | 0.6 V | 0.6 V |
| 4.5 V | 2.5 V | 1.6 V | 0.9 V |
| 6 V | 3.3 V | 2 V | 1.3 V |
Reading the spread
The minimum and maximum columns matter as much as the typical ones. At 4.5 V, the datasheet allows the rising threshold anywhere from 1.55 V to 3.13 V and the hysteresis anywhere from 0.4 V to 2.1 V. The chip guarantees that hysteresis exists, not exactly where it sits. A design that depends on switching at a precise voltage needs a comparator and resistors, as in the TI example. A design that only needs a clean edge, such as squaring up a slow RC ramp or a sensor that drifts, can use the 74HC14 directly.
The thresholds also scale with the supply. The datasheet’s tables run from 2 V to 6 V, so the same part sits comfortably in a 3.3 V microcontroller project or a 5 V one, with its switching points moving up as the supply rises. A design that later changes supply voltage needs the thresholds rechecked.
For breadboard work the chip is cheap and easy to find:
- SN74HC14N SN74HC14 74HC14 Hex Schmitt-Trigger Inverters Breadboard-Friendly IC DIP-14 (Pack of 10): a ten-pack of the through-hole DIP-14 version that fits a standard breadboard. See it on Amazon (affiliate link)
As an Amazon Associate I earn from qualifying purchases. A commission may be earned if you buy through this link, at no extra cost to you.
Where Schmitt triggers show up
Inputs that move slowly
Any signal that ramps instead of snapping is a candidate: a light sensor at dusk, a thermistor in a warming room, a capacitor charging through a resistor in a timing circuit. A Schmitt trigger at the input of a microcontroller pin or a logic gate gives one clean edge per real change.
Oscillators from one gate
Because the gate switches at one voltage and switches back at another, a single Schmitt inverter with a resistor from output to input and a capacitor from input to ground oscillates on its own. The capacitor charges toward the high output until it reaches the upper threshold, the output flips low, and the capacitor discharges until it reaches the lower threshold. The frequency depends on the resistor, the capacitor and the two thresholds, which is why the wide datasheet spread above makes this oscillator handy but imprecise.
Thermostats and window sensors
The same idea appears in firmware. A thermostat routine that turns heat on below 67 degrees and off above 69 is software hysteresis, written with two numbers instead of one. Water tank pumps, battery chargers and fan controllers all use the pattern for the same reason the circuit does: so a value sitting right at a threshold does not wear out a relay.

Choosing how much hysteresis
Start from the noise
The practical design order runs backwards from the problem. Measure or estimate the worst noise at the crossing point, peak to peak. Set the hysteresis comfortably wider than that. Then check that the input actually travels past both thresholds during normal operation, or the output will never switch at all.
The simulation’s 50 mV case is a warning about margins. Noise with a 50 mV standard deviation spends most of its time well inside the 300 mV gap, yet over 100,000 samples it still produced two extra edges. Rare spikes are what break a design, not typical ones.
Accept the cost
Hysteresis trades precision for stability. The circuit no longer switches at one exact voltage; it switches at one of two, depending on history. For a thermostat or a button that is the whole point. For a measurement that needs a precise trip point, the hysteresis band should be kept small and the noise reduced at the source, with filtering, shielding or a slower sample rate, instead.
Sources
- Texas Instruments, SNOA997A, “Inverting Comparator With Hysteresis Circuit” (revised August 2019): https://www.ti.com/lit/pdf/SNOA997
- Texas Instruments, SN74HC14 datasheet, SCLS085L: https://www.ti.com/lit/ds/symlink/sn74hc14.pdf
