LearnTronics
Comparator — A Voltage Decision Circuit
Recipe #11 — comparator
A comparator answers a very simple electrical question: is one voltage higher or lower than another?
Example
Two equal 10 kΩ resistors make a reference of about 2.5 V from a 5 V supply.
If VIN is above VREF, the output moves to one state. If VIN is below VREF, the output moves to the other state.
Where it appears: battery monitors, thermostat controls, light sensors, level detectors, alarms, and circuits that turn an analog measurement into an ON/OFF decision.
Another way to think of it
A comparator is an electronic referee. It looks at two voltages and reports which one is greater.
A comparator is not the same thing as a voltage follower
The voltage follower uses negative feedback to stay in its linear region. A comparator is normally used without that feedback so its output changes state when the two input voltages cross.
Real comparator outputs differ by device; some require a pull-up resistor. The device datasheet determines the actual output connection.