An op amp comparator switches its digital output state based on the analog voltage difference between its two inputs. Unlike linear operational amplifier circuits that rely on negative feedback to stabilize in the active region, comparators operate open-loop—or with positive feedback for hysteresis—to slam the output into saturation. While you can hack a general-purpose op-amp like the LM358 to act as a comparator, dedicated comparator ICs offer vastly superior propagation delays, output stage architectures, and input voltage tolerances.
This guide covers the exact part numbers you should default to, how to map the pinouts, how to design a stable window comparator circuit, and how to diagnose a blown chip on your workbench using a standard digital multimeter (DMM).
Selecting the Right Op Amp Comparator: Safe Defaults and Specs
The most common beginner mistake is selecting a part based solely on the 'op-amp' label without checking the output stage architecture or overload recovery time. If you use a standard op-amp as a comparator, the internal compensation capacitor must charge and discharge every time the output swings rails, resulting in microsecond-scale delays. Dedicated comparators eliminate this phase compensation.
Here is a data-dense comparison of the safest default part numbers for 2026 bench and production designs, ranging from low-cost legacy bipolar chips to high-speed CMOS alternatives.
| Part Number | Type & Architecture | Output Stage | Propagation Delay | Max Differential Input | Approx. Unit Price |
|---|---|---|---|---|---|
| LM393 | Dual Bipolar Comparator | Open-Collector | 1.3 µs | ±36V (Independent of VCC) | $0.12 - $0.18 |
| TLV3201 | Single CMOS Comparator | Push-Pull | 40 ns | VCC + 0.3V | $0.80 - $1.10 |
| LM358 (Reference) | Dual General Op-Amp | Push-Pull (Slow recovery) | >30 µs (Overload) | ±32V | $0.08 - $0.12 |
| MAX9021 | Dual Micropower CMOS | Open-Drain | 28 µs (Low power) | Rail-to-Rail ±0.3V | $1.50 - $2.10 |
Pinout, Symbol Anatomy, and Operation Regions
The standard schematic symbol for an op amp comparator is a triangle pointing right. The non-inverting input is marked with a plus (+), and the inverting input is marked with a minus (-). Unlike linear op-amp symbols, comparator symbols often explicitly show the VCC and VEE/GND pins, and sometimes include a dedicated ground pin for the output stage if it is an open-collector type.
For the ubiquitous 8-pin DIP or SOIC LM393 dual comparator, the pinout is as follows:
- Pin 1: Output 1 (Open-Collector)
- Pin 2: Inverting Input 1 (-)
- Pin 3: Non-Inverting Input 1 (+)
- Pin 4: VCC- / GND
- Pin 5: Non-Inverting Input 2 (+)
- Pin 6: Inverting Input 2 (-)
- Pin 7: Output 2 (Open-Collector)
- Pin 8: VCC+ (Supply Voltage)
Because comparators lack internal frequency compensation, they operate in distinct saturation regions rather than a linear amplification zone. Understanding these regions is critical for predicting output behavior.
| Operation Region | Input Condition | Output State (Push-Pull) | Output State (Open-Collector) | Typical Output Current |
|---|---|---|---|---|
| Positive Saturation | V(+) > V(-) | High (VCC - V_drop) | High-Z (Floating) | 0 mA (Sourcing limited) |
| Negative Saturation | V(+) < V(-) | Low (VEE / GND) | Low (Sinking to GND) | Up to 16-20 mA (Sinking) |
| Transition Region | V(+) ≈ V(-) | Unstable / Oscillating | Unstable / Oscillating | Spikes during switching |
Biasing for Stability: Hysteresis and a Complete Window Comparator
If you feed a noisy analog signal (like a thermistor or a slow-moving LDR) into a comparator, the output will chatter violently as the signal crosses the threshold. The All About Circuits guide on op-amps as comparators highlights that adding positive feedback creates hysteresis—a deadband where the upper and lower switching thresholds are separated, effectively filtering out high-frequency noise.
Below is a complete, build-ready design for a 5V Window Comparator using an LM393. A window comparator triggers only when an input signal falls between two specific voltage thresholds. We will use open-collector wired-AND logic to achieve this with just two pull-up resistors.
Window Comparator Circuit Specifications
- Supply (VCC): 5.0V DC
- Lower Threshold (V_L): 1.5V
- Upper Threshold (V_H): 3.5V
- Logic: Output goes LOW when the input is INSIDE the 1.5V–3.5V window. Output is HIGH when outside the window.
Component List and Wiring
- Voltage Divider for V_H (3.5V): Connect R1 (15kΩ) from 5V to Pin 5 (Non-inverting 2). Connect R2 (33kΩ) from Pin 5 to GND. (Yields ~3.47V).
- Voltage Divider for V_L (1.5V): Connect R3 (33kΩ) from 5V to Pin 2 (Inverting 1). Connect R4 (15kΩ) from Pin 2 to GND. (Yields ~1.56V).
- Signal Input: Connect your analog sensor signal to both Pin 3 (Non-inverting 1) and Pin 6 (Inverting 2).
- Pull-Up Resistors: Connect R5 (10kΩ) from Pin 1 (Output 1) to 5V. Connect R6 (10kΩ) from Pin 7 (Output 2) to 5V.
- Wired-AND Output: Tie Pin 1 and Pin 7 together. This combined node is your final digital output. Connect this node to your microcontroller GPIO or logic gate.
How the Logic Works
Comparator 1 monitors if the signal is above 1.5V. If Input > 1.5V, Output 1 goes High-Z. Comparator 2 monitors if the signal is below 3.5V. If Input < 3.5V, Output 2 goes High-Z. When the input is inside the window (e.g., 2.5V), both outputs are High-Z. The combined node is pulled HIGH to 5V via the parallel pull-up resistors. If the input drops below 1.5V, Comparator 1 sinks the node to GND. If it rises above 3.5V, Comparator 2 sinks the node to GND.
Failure Modes and Bench Testing with a Multimeter
Comparators typically fail due to three specific abuse scenarios: exceeding the absolute maximum differential input voltage, violating the common-mode input range (causing phase reversal in JFET/CMOS inputs), or short-circuiting a push-pull output to a hard voltage rail.
If your circuit is misbehaving, do not immediately desolder the IC. You can perform a highly effective diagnostic sequence using a standard DMM.
Step 1: In-Circuit Power Verification
Set your DMM to DC Voltage. With the circuit powered, measure Pin 8 to Pin 4. You must read your nominal VCC (e.g., 4.95V to 5.05V for a 5V system). If this reads low, the IC might be internally shorted and dragging down the regulator, or your power supply is browning out. Measure the reference pins (Pins 2 and 5 in our window circuit) to verify your resistor dividers are actually providing the expected threshold voltages.
Step 2: Input Stage Diode Test (Power Off)
De-energize the circuit and discharge any large capacitors. Set your DMM to Diode Test mode. Place the red probe on the non-inverting input and the black probe on the inverting input, then swap.
Expected Result for Bipolar (LM393): You should read a forward voltage drop of roughly 0.6V to 0.9V in one direction (due to the base-emitter junctions of the input PNP transistors) and 'OL' (Open Loop) in the reverse direction.
Expected Result for CMOS (TLV3201): You should read 'OL' in both directions. If you read 0.00V (a dead short) or a very low resistance across the inputs on any comparator, the input differential pair is blown.
Step 3: Output Stage Continuity Check
Keep the DMM in resistance or continuity mode. For an open-collector part like the LM393, place the black probe on GND (Pin 4) and the red probe on the Output pin.
Expected Result: You should read the resistance of your pull-up resistor (e.g., ~10kΩ). If you read 0.00Ω or a dead short to ground, the internal output NPN transistor has shorted—a classic failure mode caused by attempting to sink more than the rated 16-20mA, or by accidental thermal runaway.
By understanding the internal architecture of the op amp comparator, respecting the limitations of open-collector outputs, and utilizing hysteresis to stabilize your thresholds, you can design robust analog-to-digital interfaces that survive the electrical noise of real-world environments.






