JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Hysteresis and the Schmitt Trigger

Last guide left you with a comparator that chatters: park a noisy signal right on the threshold and the output machine-guns between high and low. The cure is a thermostat trick — give the decision a deadband, two thresholds instead of one, so a little fuzz can no longer push it back across. That is hysteresis, and the circuit that builds it with a sliver of positive feedback is the Schmitt trigger.

The chatter, and a thermostat with a deadband

Guide 1 left you holding a problem. A bare comparator decides which of its two inputs is bigger and slams its output to a rail — wonderfully decisive, until the signal you are watching crawls slowly across the threshold while carrying a few millivolts of noise on its back. Right at the crossing, the noise alone is enough to keep flipping the answer, so the output sprays out a burst of false high-low-high-low pulses instead of one clean edge. That machine-gun rattle is comparator chatter, and no amount of a steadier comparator chip fixes it, because the indecision is real: at that instant the input genuinely is dancing across the line.

Your home thermostat faces exactly this, and solved it long ago. If it turned the furnace on the instant the room dipped below 20 °C and off the instant it rose above 20 °C, it would click on and off every few seconds forever, since the air right at the sensor always wobbles by a fraction of a degree. So it does not use one temperature — it uses two. It fires the heater only when the room falls below 19 °C, then keeps it running until the room climbs past 21 °C, and only then shuts off. That 2-degree gap is a deadband: a zone where nothing changes, so a little wobble can never flip the decision back.

Hysteresis: two thresholds instead of one

Carry the thermostat into electronics and you get hysteresis: instead of a single switching voltage, the comparator uses two. There is an upper trip point (call it VTH) that the input must rise above to flip the output one way, and a lower trip point (VTL) that the input must fall below to flip it back. Between those two levels lies the deadband, and inside it the output simply holds whatever state it last settled into. The word literally means lagging behind — the output's behaviour lags the input, depending not just on where the input is but on which direction it came from.

Now replay the noisy crossing. Suppose VTL = 1.0 V and VTH = 3.0 V, and a slow signal riding ±0.3 V of noise drifts upward through 2 V. As it climbs past 1 V nothing happens — that is only the lower trip, which matters on the way down. It keeps rising, noise and all, and the output does not budge until the signal genuinely pushes above 3 V. The instant it does, the output snaps over once and stays there. For the noise to undo that, the signal would now have to fall all the way back below 1 V — a 2-volt retreat that 0.3 V of fuzz cannot manufacture. One clean edge, no chatter, because the gate it has to crawl back through is now far behind it.

The width of the deadband, VTH minus VTL, is the hysteresis itself, and it is the one number you design. The rule of thumb is plain: make the band comfortably wider than the worst-case noise on your signal. If your input carries 0.3 V of peak-to-peak noise, a 2 V band is luxuriously safe; if it carries only a few millivolts, a 50 mV band might do. Too narrow and the chatter leaks back; too wide and you start ignoring real changes you needed to catch — a tension we will come back to honestly at the end.

Building it: a sliver of positive feedback

So how do you make a comparator carry two thresholds? You feed a little of the output back to help set the threshold. This is the Schmitt trigger: a comparator wrapped in a small dose of positive feedback. Stop and notice how strange that sounds after everything you learned about op-amps. Every linear amplifier in the earlier rungs leaned on negative feedback, where a slice of the output is subtracted to calm the circuit toward a target. Here we add a slice instead, which is normally the recipe for instability — but instability is exactly what we want at the threshold. We want the circuit to commit, hard, the moment it decides.

Picture it as a snap. The moment the input nudges the comparator over the edge, the output starts moving — and because a fraction of that output is fed back to the input in the same direction, it shoves the input even further past the edge, which drives the output harder still. This runaway is called regeneration, and it is over in nanoseconds: the output rockets to the opposite rail in one decisive flick. The same feedback that makes the snap also moves the threshold. As the output lands on the new rail, it drags the trip point along with it to the far side, opening up the deadband. That is the whole mechanism — the positive feedback gives you the snap and the two thresholds in one stroke.

Designing the trip points with real numbers

Let us build the most common version: the inverting Schmitt trigger. The signal goes into the inverting (−) input. The non-inverting (+) input is fed by a voltage divider from the output — and that divider voltage is the threshold the input is racing against. Because the output is always sitting on one rail or the other (±Vsat), the threshold can only take two values, one for each rail. The divider sets what fraction of the rail comes back, and that fraction is everything.

                Vin ----------[ - ]\
                                   | \
                                   |   >----+------ Vout  (+Vsat / -Vsat)
                         +------[ + ]/      |
                         |                  |
                         +-----[ R1 ]-------+     R1 = 90k  (output -> + node)
                         |
                       [ R2 ]                      R2 = 10k  (+ node -> ground)
                         |
                        GND

   Feedback fraction   B = R2 / (R1 + R2) = 10k / 100k = 0.1
   With Vsat = +/- 10 V:
     Upper trip   VTH = +Vsat x B = +10 x 0.1 = +1.0 V
     Lower trip   VTL = -Vsat x B = -10 x 0.1 = -1.0 V
     Deadband (hysteresis) = VTH - VTL = 2.0 V
An inverting Schmitt trigger. R1 and R2 feed a fraction B of the output back to the + input; that fraction times each rail gives the two trip points, and their gap is the hysteresis band.

Walk the algebra slowly — it is just the divider you already know. The voltage at the + node is V+ = Vout times R2/(R1+R2) = Vout times B, where B is the feedback fraction. The output flips whenever the input crosses V+. While the output sits at +Vsat, the threshold is V+ = +Vsat times B, so the input must rise above that to trip — that is VTH. Once it flips, the output is at −Vsat, so the threshold jumps to V+ = −Vsat times B, and the input now has to fall below that to flip back — that is VTL. The deadband is VTH − VTL = 2 times B times Vsat. With B = 0.1 and Vsat = 10 V, the trips are ±1 V and the band is 2 V wide, just as drawn.

  1. Measure the worst-case noise on your input — say 0.3 V peak-to-peak — and pick a hysteresis band a few times bigger for margin. Aim for a 2 V band here.
  2. Find the fraction B from band = 2 times B times Vsat. With band = 2 V and Vsat = 10 V, B = 2 / (2 times 10) = 0.1.
  3. Turn B into resistors: B = R2/(R1+R2) = 0.1 means R1 is nine times R2. Pick R2 = 10 k, so R1 = 90 k. Keep them in the tens-of-kΩ range so they barely load the output.
  4. To shift the whole band off zero — useful on a single supply where you cannot go negative — return R2 to a reference voltage instead of ground. That slides both trip points up together without changing the 2 V width.

Choosing the band honestly — and the free gifts

Hysteresis is not free immunity; it is a trade. The deadband that noise cannot cross is also a band where real, small changes get ignored. If your signal must resolve a genuine 0.1 V step but you set a 2 V deadband to beat the noise, that real step vanishes — the output will not move for it. So the honest design target is: make the band as wide as your worst noise demands and no wider. And accept that the switching is no longer at one crisp voltage; the up-going edge and the down-going edge now happen at different levels, by design. If you needed a precise, single threshold, hysteresis is the wrong tool — you would instead clean the signal first, or shrink the noise at its source.

That same trade buys you two gifts, though. The first you have already met implicitly: because the output snaps through regeneration rather than crawling, a Schmitt trigger sharpens a slow input into a fast, clean edge — feed it a lazy sine or a sluggish sensor ramp and it spits out crisp digital transitions, which is why it lives at the analog-to-digital boundary. The second gift is a free oscillator. Wire the Schmitt's output back to its own input through a resistor and capacitor and it can never rest: it charges toward one trip point, snaps, then charges toward the other, forever. That is a relaxation oscillator, and it is exactly the hysteresis-plus-RC engine hiding inside the 555 timer you will meet in the timing rung.

In practice you rarely build the divider from scratch. Many comparator chips ship with a few millivolts of hysteresis baked in — enough to stop chatter from their own internal noise, though usually too little for a dirty external signal, so you add external resistors for a wider band. And whole logic gates come pre-Schmitted: the classic 74HC14 is six inverters each with hysteresis on its input, the everyday workhorse for cleaning up a slow or noisy logic edge. The other place this idea earns its keep is switch debouncing — a mechanical switch's contacts bounce for milliseconds, and feeding that ragged bounce through a Schmitt trigger (or its software cousin) turns the mess into one clean press, a story the last guide of this rung tells in full.