PartAndStock
Amplifiers & Op-Amps

What Is a Comparator?

1 min read
Quick answer

A comparator is an IC that compares two voltages and reports which is larger with a digital (high/low) output. It's the threshold element connecting the analog world to the digital.

How Does It Work?

It has two inputs. If the (+) input is larger than the (−) input the output is high (1), if smaller it's low (0). So it works like a "threshold detector".

Difference From an Op-Amp

An op-amp is designed for linear amplification and used with feedback; a comparator is optimized for fast switching (saturation) and its output is usually 0 or 1.

PropertyComparatorOp-Amp
OutputDigital (0/1)Linear
SpeedFast switchingMedium
FeedbackUsually positiveNegative

Hysteresis (Schmitt Trigger)

If the input is noisy around the threshold, the output can chatter. With positive feedback two separate thresholds (hysteresis) are created to prevent this chatter; this structure is called a Schmitt trigger.

Where Is It Used?

Threshold detection, zero-crossing detectors, battery/temperature monitoring, square-wave generation and converting a noisy signal into a clean digital one.

Output Types

Comparators have two output types: push-pull drives 0/1 directly; open-collector/open-drain needs an external pull-up resistor but allows adapting to different voltage levels and a "wired-AND" connection. The right type must be chosen in the design.

Common Mistakes

  • Using it without hysteresis: with a noisy input the output chatters rapidly.
  • Mistaking an op-amp for a comparator: an op-amp's switching is slow and not ideal.
  • Output type: a comparator with an open-collector output needs a pull-up resistor.

Frequently Asked Questions

Can I use an op-amp as a comparator?+
In a pinch yes, but it can be slow and unstable; a real comparator is more accurate.
What is the LM393?+
A very common, dual-channel comparator IC with an open-collector output.

Search parts related to "What Is a Comparator?"

Find the right part by comparing price, stock and distributors.

Search These Parts