Analog Electronics
Schmitt Trigger
Comparator with hysteresis — the universal noise-killer for digital interfaces
A Schmitt trigger is a comparator with positive feedback that has two distinct thresholds: a higher one for rising inputs and a lower one for falling. The gap rejects noise and turns sloppy analog signals into clean digital edges.
- TopologyComparator + positive feedback
- ThresholdsV_T+ (rising) ≠ V_T- (falling)
- HysteresisV_h = V_T+ − V_T- ≈ 0.4 V on 74HC14 (3.3 V)
- Op-amp formulaV_T± = V_ref ± (V_sat·R1)/(R1+R2)
- Famous parts74HC14, CD40106, NE555 internally
- ApplicationsDebounce, sensors, oscillators, ADCs
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
Why noise breaks a plain comparator
Picture a comparator wired so it outputs HIGH whenever its input exceeds 1.5 V. You feed it a slow ramp — say, a photodiode that drifts up from 1.0 V to 2.0 V as the room brightens. As the photodiode signal crosses 1.5 V, it doesn't cross cleanly. There's 50 mV peak-to-peak of thermal and Johnson noise riding on top, which means the input bobbles back and forth across the threshold dozens of times in the few milliseconds it takes to cross.
Each bobble flips the output. Instead of one rising edge at the moment the light hit your target, the downstream microcontroller sees twenty or thirty rapid HIGH-LOW transitions — chatter. If the comparator is driving a counter, you count thirty events instead of one. If it's clocking a flip-flop, you've corrupted timing. If it's controlling a relay, the relay buzzes.
The fix is to make the threshold remember which side it last decided on. After the output goes HIGH, raise the threshold for going LOW; after it goes LOW, lower the threshold for going HIGH. Now the input has to move by more than the noise band before the comparator changes its mind. That memory — implemented with positive feedback — is the Schmitt trigger.
The classic op-amp Schmitt circuit
The inverting Schmitt trigger is two resistors and an op-amp:
┌───── V_out
V_in ──┐ │
▽────┤-
R │ op-amp
┌─────┤+ │
│ │ │
├──R2─┤────┘
│ │
Vref R1
│
GND
V_T± = Vref ± (V_sat × R1) / (R1 + R2)
V_h = V_T+ − V_T- = 2 × V_sat × R1 / (R1 + R2)
The op-amp has no negative feedback path — only a positive one through R1, R2. The non-inverting input sits at a voltage that depends on both V_ref and the current output. When V_out = +V_sat, the (+) input is pulled high and the comparator demands the (-) input rise above that elevated threshold before flipping. When V_out = -V_sat, the (+) input drops and the threshold drops with it. The same hardware decides 'is the input above or below', but the line it draws moves based on the current state.
Worked example: button debounce at 3.3 V
You have a pushbutton between V_CC and a microcontroller GPIO, with a 10 kΩ pull-down. When pressed, the input ramps from 0 V to 3.3 V in roughly 10 μs. But the mechanical contacts bounce — making and breaking contact 5 to 20 times over the first 5–10 ms of the press. Without debouncing, your interrupt handler fires ten times per press.
Drop in a 74HC14 Schmitt inverter (six inverters in a 14-pin DIP). At V_CC = 3.3 V, the datasheet says V_T+ = 1.74 V and V_T- = 1.13 V, giving V_h = 0.61 V. The bouncing contact spends most of its bounce time near V_CC or near GND — it doesn't oscillate within the hysteresis band. As long as a single bounce moves the input across the full hysteresis only once, the Schmitt output emits one clean edge per press.
For more vigorous debouncing, add an R-C network in front: R = 10 kΩ, C = 100 nF gives τ = 1 ms, low-passing the bounce frequencies into a smooth ramp that the Schmitt then squares up. Total parts: one resistor, one capacitor, and 1/6 of a 74HC14. Solved.
Schmitt as a relaxation oscillator
Wire a 74HC14 inverter so its output drives an RC network whose junction feeds back to the input. The capacitor charges through R toward the output rail; when it crosses V_T+, the output flips, and now the capacitor discharges through R toward the opposite rail. When the capacitor crosses V_T-, the output flips again. Continuous oscillation at frequency:
f ≈ 1 / (1.4 × R × C)
R = 10 kΩ, C = 10 nF → f ≈ 7.1 kHz
R = 47 kΩ, C = 1 nF → f ≈ 15.2 kHz
Two passives plus a Schmitt inverter and you have a square-wave clock with ~1% accuracy. It's not crystal-stable, but it costs ten cents and works from microhertz to megahertz. NE555 timers, microcontroller wakeup oscillators, and cheap relaxation drivers all use this trick.
Schmitt trigger vs alternatives
| Approach | Hysteresis | Speed | Parts | Best for |
|---|---|---|---|---|
| Plain comparator (LM393) | None — chatters in noise | 1 μs typical | 1 IC | Clean fast signals |
| Op-amp Schmitt (TL081) | Tunable via R1/R2 | 5–20 μs (slew limit) | 1 op-amp + 2 R | Custom thresholds |
| Logic-family Schmitt (74HC14) | ~0.4–1.6 V fixed | 30 ns prop delay | 1 inverter | Debounce, clean digital |
| Comparator + external hysteresis (LT1011) | Tunable, very fast | 200 ns | 1 IC + 2 R | High-speed precision |
| RC low-pass + Schmitt | Hysteresis after filtering | τ-limited | 1 R + 1 C + Schmitt | Bounce + thermal noise |
| Software debounce (MCU polling) | Time-based, not voltage | 1–20 ms read interval | 0 (firmware) | Quasi-static signals only |
Picking the hysteresis band
- Measure noise first. Scope the signal at the comparator input. Peak-to-peak noise sets the floor for V_h.
- Pick V_h ≥ 3× noise pk-pk. 50 mV of noise on the input wants V_h ≥ 150 mV to comfortably suppress it.
- Centre the band on your decision point. If you want a 1.5 V decision and V_h = 0.4 V, set V_T+ = 1.7 V, V_T- = 1.3 V.
- Asymmetric supplies need attention. A single-supply Schmitt has its thresholds biased by V_ref. Two-supply ground reference simplifies the math.
- Layout: positive feedback can latch up. Keep the feedback resistor close to the IC; long traces add ringing.
Why every CMOS input has a Schmitt
Look at any modern microcontroller datasheet — STM32, ESP32, RP2040 — and you'll find that GPIO inputs have a Schmitt buffer between the pad and the internal logic. Reason: a slowly-rising input at a CMOS gate is dangerous. CMOS gates have both NMOS and PMOS conducting in the transition region, which means a slow ramp through the threshold burns shoot-through current and can lock up the gate or cause metastability downstream.
By placing a Schmitt at every input, the chip guarantees that whatever sloppy analog signal arrives at the pin gets converted to a fast, monotonic logic edge before reaching the synchronous core. The hysteresis is typically 5–15% of V_DD — small but enough to suppress reflections and metastable transitions. The same logic applies in FPGA I/O blocks, where Schmitt is selectable per-pin.
Historical note: who was Schmitt?
Otto Schmitt invented the circuit in 1934 as a graduate student at Washington University in St. Louis. He was trying to study squid giant axons — biological neurons firing all-or-nothing action potentials — and needed a vacuum-tube circuit that mimicked the same regenerative threshold behaviour. The original device used two thermionic triodes with cathode coupling; the silicon implementation came thirty years later. Schmitt himself coined the term 'biomimetics' in 1957, decades before it became fashionable.
Common pitfalls
- Wrong polarity. Confusing inverting vs non-inverting Schmitt configurations. Sketch the circuit, label which rail the output is on for each case, and check the divider direction.
- Insufficient V_h. Designing for nominal noise and forgetting that supply ripple, RF pickup, and ground bounce add a lot more in a real system.
- Forgetting V_sat is not V_CC. Op-amp output rails sit a volt or two short of supply for non-rail-to-rail parts. Compute V_h from actual V_sat, not nameplate V_CC.
- Bad layout. The positive feedback path is a high-gain loop; pickup on it makes the threshold jitter. Route it short, ground it nearby.
- Using a Schmitt where a comparator is wanted. For accurate zero-crossing detection (e.g., AC mains synchronisation for triac control), the Schmitt's hysteresis introduces a phase error you may not want.
Frequently asked questions
How is a Schmitt trigger different from a plain comparator?
A plain comparator has one threshold. Any input crossing that line — even from a microvolt of noise — flips the output. A Schmitt trigger has two thresholds: V_T+ (must exceed this to drive output high or low, depending on inverting/non-inverting topology) and a lower V_T-. The output only switches when the input crosses the active threshold; once switched, the comparator uses the other threshold until the input has moved by at least V_h = V_T+ − V_T-. This memory is what kills noise-induced chatter.
How big is the hysteresis band in practice?
Logic-family Schmitt inputs target V_h ≈ 0.4 V at 3.3 V supply (e.g., 74HC14 inverter: V_T+ ≈ 2.7 V, V_T- ≈ 0.9 V at V_CC = 5 V, giving V_h ≈ 1.6 V; at V_CC = 3.3 V it scales down to V_h ≈ 0.8 V). Discrete op-amp Schmitt circuits set V_h with two resistors — V_h = (R1 / R2) × V_out_swing — so you can tune it from millivolts to most of the supply rail.
How do I design a Schmitt trigger with an op-amp?
Connect the input signal to the inverting (-) input. Connect a voltage divider from the output through R1 to a reference (often midpoint of the supply) and to the (+) input. The (+) input now sits at V_ref + (V_out − V_ref) × R1 / (R1 + R2). That's positive feedback: a small bump above V_ref makes V_out swing high, which pushes V_T+ even higher, latching the state. The thresholds become V_T± = V_ref ± (V_sat × R1) / (R1 + R2). Pick R1 = 10 kΩ, R2 = 90 kΩ, V_sat = 5 V → V_h = 1 V.
Why does positive feedback work here?
Negative feedback drives the inputs together for linear amplification. Positive feedback drives them apart and forces the output to a rail — exactly what you want for a digital decision. Once the output is at +V_sat, the positive feedback pushes V_T+ up to (R1 × +V_sat)/(R1+R2) above the reference, so noise on the input has to pull the inverting node above that raised threshold to flip the output. Same story flipped after the swing: V_T- sits below the reference by the same amount. The 'memory' is in which rail the output is currently sitting on.
What are the main applications?
Switch debouncing — a mechanical contact bounces 1–10 ms before settling; the Schmitt's wide hysteresis ignores the chatter. Sensor signal conditioning — slow analog signals from photodiodes, thermistors, or proximity sensors get squared into clean logic edges. Relaxation oscillators — a Schmitt inverter with one R, one C generates a square wave with f ≈ 1 / (1.4 × R × C). Receiver front-ends — every UART, I²C, and SPI input on a microcontroller has a Schmitt buffer to immunise against noisy cabling. Zero-crossing detectors — when accuracy matters more than precision, a Schmitt squares up an audio or AC mains signal.
When should I NOT use a Schmitt trigger?
When you need precise zero-crossing detection (the hysteresis introduces a known offset; use a clean comparator with external hysteresis only at the level you can budget). When the noise band is larger than the signal swing (you'll lose real signal as well as noise). When you need very fast response with no edge delay (positive feedback adds a tiny lag at threshold). And when you need an analog output proportional to input — a Schmitt always saturates, it has no linear region by design.
What is the difference between inverting and non-inverting Schmitt triggers?
An inverting Schmitt (input on the - terminal) outputs LOW when the input rises past V_T+ and HIGH when it falls past V_T-. A non-inverting Schmitt (input on the + terminal through R1, with R2 from output to + terminal) outputs HIGH when input rises past V_T+ and LOW when it falls past V_T-. The thresholds in the non-inverting case depend on both R1/R2 and the supply rails: V_T± = ± V_sat × R1/R2 (assuming symmetric supplies and the reference at ground). Inverting is more common on op-amps; non-inverting matches the polarity convention of logic-family Schmitt inputs like the 74HC14.