Electronic circuits are composed of various electronic devices, so in learning electronic circuits, we must be familiar with the performance of various electronic devices
1. Definition of comparator.
2. How the comparator works.
3. Comparator performance indicators.
Fourth, the application circuit of the comparator.
1. Definition of comparator.
A comparator is a circuit or device that can compare the magnitude of the current or voltage at two inputs. It has two inputs VI+ and VI-, and one output VOUT. The input is terminated with an analog signal, the output is a digital signal, and the output is either high or low, and the specific high level is arbitrarily determined by the external voltage amplitude.
Select the input as the reference point (ref) for comparison, for example, select the inverting input v2 as the reference, when the inverting input v1 is greater than v2, the vout output is low; When v1 is less than v2, vout outputs high. From this, we can see that the state of the output represents the sign of the net difference between the two inputs, and the reference voltage v2 is called the threshold voltage ut of the comparator. Since the comparator is actually a 1-bit digital-to-analog converter (ADC), it is a basic element in the ADC.
The output voltage Uo of a voltage comparator as a function of the input voltage UI is called its voltage transmission characteristic, i.e., UO=F (UI). Since the characteristics of the comparator are similar to those of the integrated op amp in the open loop, it is worth reviewing the voltage transfer characteristics of the op amp, as shown in Figure 2.
2. How the comparator works.
Comparators are developed from operational amplifiers, and comparator circuits can be regarded as a kind of application circuits of operational amplifiers. Due to the wide range of applications of comparator circuits, special comparator integrated circuits have been developed.
Fig. 4(a) A differential amplifier circuit composed of operational amplifiers, the input voltage VA is connected to the inverting terminal after dividing the voltage divider R2 and R3, VB is connected to the inverting terminal through the input resistor R1, and RF is the feedback resistor, if the input offset voltage is not considered, the relationship between the output voltage VOUT and VA, VB and the four resistors is: VOUT=(1+RF R1)·R3 (R2+R3)VA-(RF R1)VB. If R1=R2 and R3=Rf, then Vout=RF R1(VA-VB) and RF R1 is the gain of the amplifier. When r1=r2=0 (equivalent to r1, r2 short circuit), r3=rf= (equivalent to r3, rf open circuit), vout= . When the gain becomes infinity, the circuit diagram looks like Figure 3(b), and the differential amplifier is in the open-loop state, which is the comparator circuit. In fact, when the op amp is in the open-loop state, its gain is not infinity, and the vout output is the saturation voltage, which is less than the positive and negative supply voltages, and cannot be infinity.
As can be seen in Figure 3, the comparator circuit is a differential amplifier circuit in which the op amp circuit is in an open-loop state.
3. Comparator performance indicators.
1.0 hysteresis voltage: The voltage between the two inputs of the comparator will change when the output state crosses zero, because the input is often superimposed with small fluctuating voltages, and the differential mode voltage generated by these fluctuations will cause the output of the comparator to change continuously, in order to avoid output oscillation, the new comparator usually has a hysteresis voltage of a few mV. The presence of hysteresis voltage makes the comparator's switching point two: one to detect the rising voltage and one to detect the falling voltage, the difference between the voltage threshold (vtrip) is equal to the hysteresis voltage (vhyst), and the offset voltage of the hysteretic comparator is the average of the trip and vtrip-. The input voltage switching point of a comparator without hysteresis is the input offset voltage, not the zero voltage of the ideal comparator. The offset voltage generally changes with the change of temperature and supply voltage. The effect of a change in the supply voltage on the offset voltage is usually expressed in terms of the power supply rejection ratio.
2.0 Bias Current: The input impedance of an ideal comparator is infinite, so theoretically it has no effect on the input signal, while the input impedance of the actual comparator cannot be infinite, and there is a current at the input end that passes through the internal resistance of the signal source and flows into the comparator, resulting in an additional voltage difference. Bias is defined as the median of the input currents of the two comparators and is used to measure the effect of the input impedance. The MAX917 series comparators have a maximum bias current of only 2nA.
3.0 Super-Supply Swing: In order to further optimize the operating voltage range of the comparator, Maxim uses the NPN transistor and PNP transistor in parallel as the input stage of the comparator, so that the input voltage of the comparator can be extended, so that the lower limit can be as low as the lowest level, and the upper limit can be 250mV higher than the supply voltage, thus reaching the Beyond-TheRail standard. The input of such a comparator allows for a large common-mode voltage. 4.0 drain-to-source voltage: Since the comparator has only two different output states (zero level or supply voltage), and the output stage of the comparator with full supply swing characteristics is a emitter follower, the input and output signals have only a small voltage difference. This dropout voltage depends on the transmit junction voltage at saturation of the transistor inside the comparator, which corresponds to the drain-source voltage of the MOSFFET.
5.0 Output delay time: This includes the propagation delay of the signal through the component and the rise and fall time of the signal, which can be up to 4 for a high-speed comparator such as the MAX9615ns with a rise time of 23ns。When designing, it is important to pay attention to the influence of different factors on the delay time, including the influence of temperature, capacitive load, input overdrive, etc.
Fourth, the application circuit of the comparator.
Comparator night light circuit based on LM393 IC.
This circuit uses a photoresistor to control the voltage divider circuit. When this circuit absorbs bright light, the output device will be turned off. When the circuit absorbs the darkness, the output device will be turned off. The circuit works on the principle of a voltage comparator. If the inverting side of the IC voltage is higher than the inverting terminal, the output device is activated. Similarly, if the voltage of the inverting terminal of the IC is lower than that of the inverting terminal, the output device is deactivated. Here, the circuit uses LEDs as the output device.
The IC has two power inputs, VCC and GND, where VCC is a positive voltage supply up to 36V and GND is the ground wire of the voltage source. The power channel can be done with these two terminals and provide power for the operation.
3. Working principle.
After the IC is powered on, compare the voltage values. If the voltage at the inverting terminal is higher than the voltage at the noninverting terminal, the op amp output will be grounded and the current will flow from the positive supply to the GND. Similarly, if the voltage at the inverting terminal is lower than at the inverting terminal, the op amp output will remain at the positive supply voltage (VCC) and no current will flow because there is no potential difference across the load.
Therefore, when the voltage at the inverting terminal is high, the load will be turned on. When the voltage at the inverting terminal is low, the load will be shut down. Here LEDs are used as loads. The night light circuit using the LM393 is shown in the diagram above. The circuit uses LEDs as the load and the photoresistor is used to detect the light. The resistance of a photoresistor depends mainly on the light that hits its surface. When the photoresistor detects darkness, the resistance of the photoresistor becomes higher, and when the photoresistor detects bright light, its resistance decreases.
So, if we connect a voltage divider circuit with a photoresistor and a fixed resistor, if it detects darkness, the photoresist will utilize more voltage because it has less resistance in the dark. Similarly, if it detects bright light, the photoresistor will use less voltage.
If the input of the op amp in phase is a relatively stable reference voltage, and the voltage of the photoresistor is higher than the reference voltage in the dark and lower than the reference voltage in the light, a comparator is designed here when there is night and then there is light, the circuit functions differently. As a result, the LEDs light up in the dark and turn off in bright light.