When you remove negative feedback, or replace it with positive feedback, the op-amp stops being a linear amplifier and becomes a one-bit decision-maker. These circuits are surprisingly useful.
4.1 Comparators
An op-amp without feedback. The output saturates at the positive rail when and at the negative rail when . The transition is fast: limited only by the slew rate. Output is always railed.
Used everywhere a binary "is A bigger than B?" answer is needed:
- Threshold detection (battery low, intrusion alarm).
- Building block of every flash and SAR ADC.
- PWM generators (compare a triangle wave to the duty-cycle command).
- Zero-crossing detectors (compare to ground).
- Window detectors (compare to two thresholds).
Note: dedicated comparator chips like the LM393, LM339, LMV393, TLV3501, ADCMP600 are much faster than general-purpose op-amps and have open-drain or push-pull rail-to-rail outputs designed for digital fan-out. Use a dedicated comparator chip for any application that requires fast response or clean digital edges.
4.2 Schmitt trigger
Add positive feedback to a comparator and you create a circuit with two thresholds (hysteresis). The output flips high when the input crosses one threshold and flips low at a different threshold lower than the first.
V_in ─────│-\
│ \
│ ●─────────●── V_out
│ / │
┌────│+/ │
│ │/ │
●─────[R_2]────────●
│
[R_1]
│
GNDWhy the hysteresis matters: a noisy signal crossing a single threshold produces multiple bounces (ringing). With hysteresis, the input must overshoot one threshold to flip; once flipped, only a return through the lower threshold flips back. Clean digital edges from noisy analog inputs, no debouncing required.
The two thresholds are:
The hysteresis width is scaled by the divider.
Built into most discrete digital input ICs, GPIO pins on microcontrollers, and CMOS gates marked "ST" (e.g., 74HC14 hex Schmitt inverter). Used in mechanical-switch debouncing, optical sensor thresholding, infrared receivers, and the front end of many digital communications systems.
4.3 Zero-crossing detectors
A comparator with one input grounded. The output flips state every time the input crosses zero. Used to detect the phase of a 50/60 Hz mains voltage (for triac control), to find the timing of a sine signal (for PLL phase detectors), or to convert a sine wave to a square wave.
4.4 Precision rectifiers
A diode in an op-amp's feedback loop. The op-amp's high gain compensates for the diode's 0.6 V forward drop, so rectification works even down to millivolts.
Half-wave precision rectifier:
D
──▷│──
│ │
V_in ─[R]──●── V- ─────●─── V_out
│ │\│
│ │ \
│ │ /
GND ──│+/
│/When , the op-amp drives down to forward-bias the diode and pull to virtual ground. tracks the input through and the diode. When , the diode reverse-biases, the op-amp's output saturates negative trying to keep the loop closed, and is held by another path (often a second resistor) at zero.
Full-wave precision rectifier: two op-amps and a few diodes producing a continuous output. A practical example is the AD736 RMS-to-DC converter chip (which uses an op-amp-and-diode network internally) for true-RMS digital multimeters.
Used in: AC voltmeters that read down to mV (cheap rectifier diodes alone cannot, because of the 0.6 V drop), audio level meters, AGC detection, peak detectors, RF envelope detectors.
4.5 Peak detector
A diode plus a hold capacitor: the input charges the cap through the diode but cannot discharge it (diode reverses). The cap holds the highest voltage seen at the input.
D
V_in ──── ▷│ ─────●── V_out (held on C)
│
[C]
│
GNDFor accuracy, the diode is wrapped in op-amp feedback (precision rectifier topology). Used in pulse-height analyzers (radiation detectors), peak-program meters (audio), and spectrum analyzers (RF peak detection).
4.6 Sample-and-hold
An analog switch in series with a hold capacitor. On a "sample" command, the switch closes and the cap charges to the input voltage; on "hold," the switch opens and the cap maintains that voltage for the rest of the conversion cycle.
V_in ──── / ────●── V_buffer ─── V_out
SW │
[C]
│
GNDAlways present at the front of every ADC, because the input must not change while the conversion is happening (a moving target gives wrong digital codes). The internal sample-and-hold of a SAR ADC is what determines its analog input bandwidth: even with a 1 MSPS conversion rate, you can sample a 10 MHz sine cleanly because the S/H takes a snapshot in nanoseconds.
The classic discrete S/H chips were the LF398 and the AD585. Modern ADCs include S/H on-die, integrated with the comparator and switching logic.