What Is a Comparator?
A Comparator is an element that compares two input signals and produces different outputs depending on the results. Generally, two inputs are provided: an input of the signal to be measured and a reference signal.
This makes it possible to perform conditional branching in the circuit, such as to perform a specific operation when a signal (current or voltage) that exceeds the reference value is input.
The Comparator Input is Analog, but the Output Signal is Digital
The input of the comparator is analog, but the output signal is digital. Therefore, comparators are sometimes used as an interface between analog and digital circuits.
Uses of Comparators
Comparators can be used to build logic circuits that perform comparisons between input signals (current and voltage) and reference signals. For example, they can monitor excessive rises or drops in voltage and alert you if they are out of range, or control the operation of equipment.
Other if/then conditional branching can also be performed, such as automatically adjusting the temperature of a refrigerator or air conditioner, or limiting the performance of a cell phone or PC when the battery is low.
Comparator Principle
A comparator has five pins, each consisting of a positive and negative power supply pin, two inputs, and an output pin. It has almost the same configuration as an operational amplifier, with the only difference being whether or not inverting amplification is performed. Originally, operational amplifiers have the property of outputting the voltage of the power supply when there is a difference in input voltage, and comparators make use of this property.
Conversely, if a circuit is built to apply feedback from the output terminal of a comparator to the negative input terminal, it can be used as an operational amplifier. Since comparators do not have a mechanism for inverting amplification, they do not provide phase compensation to prevent oscillation like operational amplifiers do.
Therefore, the most important feature of comparators is that comparators have superior responses compared to operational amplifiers. Moreover, if multiple comparators are used and the reference value is set in steps, they can be used as AD converters. AD converters with this structure can perform high-speed conversions.
Other Information on Comparators
Hysteresis Comparator
When a comparator has a single threshold for comparison, unexpected external noise superimposed on the analog signal causes the comparator to repeat High/Low in response to the noise. This causes a malfunction instead of switching with the original input value, so a comparator called a hysteresis comparator was invented.
Hysteresis comparators are characterized by having two threshold values depending on the output state. When the output switches, it switches to another threshold value different from the previous threshold value, thus preventing unexpected noise-induced malfunctions.
The circuit configuration of the hysteresis comparator applies positive feedback from the output terminal of a conventional comparator to the input terminal via a resistor or the like. Incidentally, this circuit is called a Schmitt trigger after the inventor’s name (Otto Schmitt).
Schmitt triggers are generally combined with active elements such as Zener diodes to prevent supply voltage fluctuations, making the circuit more versatile. The hysteresis comparator threshold can be set symmetrically plus or minus with respect to 0 V, or asymmetrically, but the important point here is that the hysteresis width should not be too large.
This is because a large hysteresis width improves immunity to external noise, but deteriorates the sensitivity to the input value that you originally want to judge. Therefore, care should be taken not to increase the hysteresis width beyond the actual noise value. For a more balanced design, the ratio of the threshold voltage to the comparator supply voltage should also be considered.