A comparator compares two input voltages and outputs a binary signal indicating which is larger. If the non-inverting (+) input is greater than the inverting (-) input, the output goes high. If the inverting input is greater than the non-inverting, the output goes low.
The most frequent application for comparators is the comparison between a voltage and a stable reference. Comparators have many applications, including threshold detectors/discriminators, zero-crossing detectors, and oscillators.
The two basic types of voltage comparator are inverting and non-inverting, depending on which terminal the input signal is applied to.
In an inverting comparator (or negative voltage comparator), the input signal is applied to the inverting terminal and the reference voltage is at the non-inverting terminal. This creates a positive voltage output if the input voltage is less than the reference voltage.
In a non-inverting comparator, the input signal is applied to the non-inverting terminal and the reference voltage is at the inverting terminal. This creates a positive voltage output if the input voltage is greater than the reference voltage.
A simple comparator can be achieved using an op amp without negative feedback. Its high voltage gain enables it to resolve very small differences in input voltage. Comparators can improve upon this basic design with added features, such as hysteresis and internal references.
Application Note 886: Selecting the Right Comparator goes into more details on how comparators work, their specifications, common comparator features, and how to select a comparator that best fits your needs.
Learn More: Comparators