Comparator

IC (Analog)

A high-gain amplifier that compares two voltages and outputs a digital signal indicating which is higher. Acts as a decision-making circuit.

Schematic symbol

Operational amplifier

How comparator appears in a circuit diagram.

Types & variants

Open-collectorPush-pull outputRail-to-rail input/outputHigh-speedLow-powerWindow comparatorProgramable hysteresis

Key specs

Input offset voltage

mV

Voltage difference needed at inputs to make output switch. Lower = more precise.

Propagation delay

ns

Time from input change to output change. Lower = faster response.

Supply voltage

V

Operating voltage range. Must match your circuit's power supply.

Output current

mA

Current the output can source/sink. Must drive your load.

Hysteresis

mV

Built-in 'dead zone' to prevent oscillation when inputs are nearly equal.

Markings

IC packages have manufacturer logo, part number (e.g., LM393), date/batch codes. SMD often has tiny laser marking on top.

Standard values

Common models: LM339 (quad), LM393 (dual), LM311 (single). Supply voltage: 2-36V (varies by model).

How to choose

1) Determine needed speed (propagation delay). 2) Check supply voltage compatibility. 3) Choose single/dual/quad. 4) Consider hysteresis needs. 5) Check output type (open-collector vs push-pull).

Pinout & package

1OUT A8VCC2IN A−7OUT B3IN A+6IN B−4GND5IN B+

DIP-8 (LM393 dual) — top view, notch up

Check first: Outputs are open-collector: they can only pull low, so a pull-up resistor to VCC is required. The quad LM339 uses a 14-pin package with a different order.

VCC (+), GND (-), IN+, IN-, OUT. Common packages: DIP-8, SOIC-8, SOT-23-5. Pinout varies by model - always check datasheet.

Example circuits

  • Voltage level detection (e.g., battery low indicator)
  • Zero-crossing detector for AC circuits
  • Window comparator for voltage range detection
  • Analog-to-digital converter (simple)
  • Oscillator with hysteresis

Common failures

Output stuck high/low (internal damage), oscillation without hysteresis, damage from overvoltage/ESD. May show overheating if overloaded.

How to test

1) Apply known voltage to inputs (e.g., 2.5V to both). 2) Power the comparator. 3) Measure output voltage. Should be stable. 4) Slightly increase one input. 5) Output should switch cleanly to opposite state.

Substitutes

Same pinout and specs. LM393 can replace LM339 (but only half). Check voltage and speed requirements before substituting.

Where to buy