A comparator is an electronic circuit, and is a device that compares two voltages or currents and outputs a digital signal indicating which is larger. Do you know the basic of it? Let's have a look.
1 Working Principle
Generally, in electronics, the comparator is used to compare two voltages or currents which are given at the two inputs of the comparator. A comparator circuit compares two voltages and outputs either a 1 (the voltage at the plus side; VDD in the illustration) or a 0 (the voltage at the negative side) to indicate which is larger. The operational amplifier can be used as a comparator theoretically without negative feedback. However, the open-loop gain of the operational amplifier is very high, so it can only process signals with a very small input differential voltage. Moreover, in general, the delay time of the op amp is long, which cannot meet the actual requirements. The comparator can be adjusted to provide a very small time delay, but its frequency response characteristics will be limited. To avoid output oscillation, many comparators also have internal hysteresis circuits. The threshold of the comparator is fixed, some have only one threshold, and some have two thresholds.
2 Main Parameters
2.1 Hysteresis Voltage
The voltage between the two input terminals of the comparator will change the output state when it crosses zero. Because the input terminal is often superimposed with a small fluctuation voltage, the differential mode voltage generated by it will cause the comparator output to change frequently. In order to avoid output oscillation, the new comparator usually has a hysteresis voltage of several mV. The existence of it requires two switching points of the comparator: one is used to detect the rising voltage, the other is used to detect the falling voltage. The difference of the voltage threshold (VTRIP) is equal to the hysteresis voltage (VHYST). The offset voltage of hysteresis comparator is the average of TRIP and VTRIP-. The input voltage switching point of the comparator without hysteresis is the input offset voltage, not the zero of the ideal comparator. In addition, the offset voltage generally varies with temperature and power supply voltage. And the power supply rejection ratio is usually employed to express the influence of power supply voltage changes on the offset voltage.
2.2 Bias Current
The input impedance of an ideal comparator is infinite. Therefore, there is no effect on the input signal theoretically. However, the actual input impedance of the comparator cannot be infinite. There is a current at the input end that flows through the internal resistance of the signal source and flows into the comparator, thereby generating an additional voltage difference. The bias current (Ibias) is defined as the median of the input currents of the two comparators and is used to measure the effect of input impedance.
2.3 Super Power Swing
To further optimize the operating voltage range of the comparator, Maxim uses the parallel structure of the NPN tube and the PNP tube as the input stage of the comparator. Thus the input voltage of the comparator can be expanded. In this case, the lower limit can be lower to the lowest level, and the upper limit is 250mV higher than the power supply voltage to reach the Beyond-the-Rail standard. The input of this comparator allows a larger common-mode voltage.
2.4 Drain-source Voltage
The comparator has only two different output states (zero level or power supply voltage). Its output stage of the comparator with full power swing characteristics is an emitter follower, which makes its voltage difference smaller between input and output signals. The voltage difference depends on the emitter junction voltage under the saturation state of the internal transistor of the comparator, which is equal to the drain-source voltage of the MOSFFET.
2.5 Output Delay Time
It includes the transmission delay of the signal through the components and the rise time and fall time of the signal. For high-speed comparators, such as MAX961, the typical value of the delay time can reach 4.5ns and the rise time is 2.3ns. Pay attention to the influence of different factors on the delay time when designing, including the influence of temperature, capacitive load, input overdrive and so on.
Although the comparator has different types. The design and construction of each should take care of ordinary uses without affecting its measuring accuracy. The instrument should be very sensitive and withstand a reasonable ill usage without permanent harm.
3 Comparator Classification
Comparators are classified into various kinds, such as electronic, electrical, mechanical, optical, sigma, digital and pneumatic comparators. These are used in various applications. Here we are talking about electronic comparator.
3.1 Voltage Comparator
A voltage comparator is a circuit that discriminates and compares input signals, and is a basic unit that forms a non-sine wave generating circuit. Voltage comparators are commonly used including single-limit comparators, hysteresis comparators, window comparators, and three-state voltage comparators. Voltage comparator can be used as an interface between analog circuits and digital circuits, as well as waveform generation and conversion circuits.
3.2 Window Comparator
Combine two comparators to form a "window comparator", which is widely used. The window comparator can set the upper limit voltage and lower limit voltage of the input at the same time, within limited voltage range, or outside the range, which we need. When the potential level of the high-level signal is higher than a certain specified value VH, it is equivalent to the positive saturation output of the comparator circuit. When the potential level of the low-level signal is lower than a certain specified value VL, it is equivalent to the negative saturation output of the comparator circuit. The comparator has two thresholds, and the transmission characteristic curve is window-shaped, so it is called a window comparator.
3.3 Hysteresis Comparator
It is a comparator with hysteresis loop transmission characteristics, and can be understood as a single-limit comparator with positive feedback. When the input voltage vI gradually increases from zero and VI is less than VT, the comparator output is a positive saturation voltage, and VT is called the upper threshold (trigger) level. When the input voltage VI>VT, the comparator output is a negative saturation voltage, and VT is called the lower threshold (trigger) level.
4 Comparator Applications
4.1 Zero-crossing Comparator
The zero-crossing comparator is used to detect whether an input value is zero. The principle is using a comparator to compare two input voltages. One of the two input voltages is the reference voltage Vr and the other is the voltage to be measured Vu. Generally, Vr is connected from the non-inverting input terminal, and Vu is connected from the inverting input terminal. According to the result of comparing the input voltage, the forward or reverse saturation voltage is output. When the reference voltage is known, the measured result of the voltage can be obtained. When the reference voltage is zero, it is a zero-crossing comparator.
4.2 Relaxation Oscillator (ROSC)
Comparators can construct relaxation oscillators by using positive feedback and negative feedback. Positive feedback is a Schmitt trigger, which forms a multivibrator. The RC circuit adds negative feedback to it, which causes the circuit to start to oscillate spontaneously, making the entire circuit from a latch to a relaxation oscillator.
Level shifting uses open-drain comparators (such as LM393, TLV3011, and MAX9028) to construct a level shifter to change the signal voltage. Choosing an appropriate pull-up voltage can flexibly get the converted voltage value.
4.3 A/D Converter
The function of the comparator is to compare whether an input signal is higher than a given value. So it can convert the input analog signal into a binary digital signal. Almost all digital-to-analog converters (including delta-sigma modulation) contain comparators circuit to quantize the input analog signal.
4.4 Voltage Comparator
The voltage comparator can be regarded as an operational amplifier with an infinite amplification factor. The function of the voltage comparator: compare the magnitude of two voltages (using the high or low level of the output voltage to indicate the magnitude relationship between the two input voltages): When the voltage at the "+" input terminal is higher than the "-" input terminal, the voltage comparator output is high level; when the "+" input terminal voltage is lower than the "-" input terminal, the voltage comparator output is low level.
How Does a Photoelectric Sensor Work?
As an important feature, a photoelectric sensor emits a light beam (visible or infrared) from its light-emitting element. And outputs from photoelectric sensors are typically either digital or analog. So why does it can do it? In other words, how does a photoelectric sensor work?How Does a Potentiometer as Voltage Divider?
Potentiometer is a variable resistor with a sliding contact which can be a voltage divider as we can apply a voltage across its terminals. How and why?