Comparator Amplifier (OPAMP) / Op-amp Comparator

The op-amp comparator compares one analog voltage level to another analog voltage level or VREF, a preset reference voltage, and generates an output signal based on this voltage comparison. In other words, the op-amp voltage comparator compares the magnitudes of the two voltage inputs and determines which of the two is the largest.

In previous tutorials, we have seen that the transactional amplifier can be used with negative feedback to control the size of the output signal in the linear region, which performs various different functions. We also found that the standard transactional amplifier's open loop gain is characterized by AO and the output voltage is given as follows: VOUT = AO(V+ – V-) corresponds to V+ and V-, non-V-voltages.

Voltage comparators, on the other hand, either use positive feedback or do not restore at all (open loop mode) to change their output between two saturated states. Because in open loop mode, the amplifier's voltage gain is basically equal to AVO. Then, due to this high open loop gain, the output from the comparator is released either to the completely positive feed rail, +Vcc or to the completely negative feed rail, -Vcc in the application of the variable input signal, which exceeds a predetermined threshold value.

The open-cycle op-amp comparator is an analog circuit that operates in its nonlinear region. Because changes in the two analog inputs cause V+and v – triggering to have two possible output states, it acts as a digital bistable device.

Consider the basic op-amp voltage comparator circuit below.

Op-amp Comparator Circuit

Op-amp Comparator Circuit

Referring to the op-amp comparator circuit above, let's first assume that the VIN is lower than the DC voltage level in VREF ( VIN < VREF ). Since the comparator's inverted (positive) input is less than the inverted (negative) input, the output will be LOW. At negative feed voltage – Vcc causes negative saturation of the output.

If we increase the VIN value to be greater than the VREF reference voltage in the inverted input, the output voltage rises rapidly towards the positive supply voltage, causing the positive saturation of the +Vcc output. If we lower the VIN input voltage again, slightly less than the reference voltage, the output of the op-amp returns to the negative saturation voltage, which acts as a threshold detector.

Then we can see that the output of the op-amp voltage comparator is a device that depends on the value of the VIN input voltage according to some DC voltage levels, since the output is higher when the voltage in the non-inverting input is larger. lower than the voltage at the inverting input and low when the inverted input is lower than the inverted input voltage. This condition is true regardless of whether the input signal depends on the inverter or inverted input of the comparator.

We can also see that the value of the output voltage depends entirely on the op-amp power supply voltage. In theory, due to the high open loop gain of op-amps, the magnitude of the output voltage can be infinite in both directions (±∞). However, practically and for obvious reasons, VOUT = +Vcc or VOUT = -Vcc is limited to op-amp feed rails.

We have previously said that the basic op-amp comparator produces positive or negative voltage output by comparing the input voltage with some preset DC reference voltage. In general, a resistant voltage divider is used to adjust the input reference voltage of a comparator. However, a battery source, zener diode or posiometer can be used for a variable reference voltage as shown.

Comparator Reference Voltages

Comparator Reference Voltages

In theory, the comparator reference voltage can be adjusted anywhere between 0v and the feed voltage. However, depending on the op-amp comparator used, there are practical limitations in the actual voltage range.

Positive and Negative Voltage Comparators

A basic op-amp comparator circuit can be used to detect an input voltage that goes positive or negative, depending on which input of the transactional amplifier we connect to the fixed reference voltage source and input voltage. In the examples above, we used the inverter input to adjust the reference voltage with the input voltage connected to the inverted input.

Only in the same way can we connect the inputs of the comparator in the other way by reversing the output signal to the one shown above.

Positive Voltage Comparator

The basic configuration of the positive voltage comparator, also known as an inverted comparator circuit, the input signal detects that the VIN is HIGHER or more positive than the reference voltage, VREF produces a HIGH output, as shown in VOUT.

Inverted Comparator Circuit


In this inverted configuration, the reference voltage is connected to the home input of the operational amplifier with the input signal connected to the inverted input. To keep things simple, we assumed that the two resistances that make up the potential dividing network were equal, and R1 = R2 = R. This will produce a constant reference voltage, which is half the feed voltage. So vcc / 2, the input voltage is variable from zero to feed voltage.

When vin is larger than VREF, the op-amp comparator output becomes saturated with the VCC positive feed rail. When the VIN is smaller than VREF, the op-amp comparator output will change and saturate the situation on the 0v negative feed rail, as shown.

Negative Voltage Comparator

The basic configuration of the negative voltage comparator, also known as the inverter comparator circuit, the input signal detects that the VIN is ALT or more negative than the reference voltage, and VREF produces a HIGH output, as shown in VOUT.

Inverting the Comparator Circuit


In the inverter configuration, which is the opposite of the positive configuration above, the reference voltage is connected to the inverted input of the transactional amplifier when the input signal is connected to the inverter input. Then, when the VIN is smaller than VREF, the op-amp comparator output will become saturated with the Vcc positive feed rail.

Likewise, the opposite is true. When the VIN is larger than VREF, the op-amp comparator output will change the situation and become saturated towards the 0v negative feed rail.

Then, depending on which op-amp inputs we use for signal and reference voltage, we can produce an output that DOES NOT EVIREN or EVİR. By combining the above two op-amp comparator circuits to produce a window comparator circuit, we can take the idea of detecting a signal that goes negative or positive a step further.

Window Comparator

A Window Comparator is basically the consolidation of the above inverter and non-inverted comparators into a single comparator tier. Instead of specifying that a voltage is preset or greater or lower than a fixed voltage reference point, the window comparer detects input voltage levels within a specific voltage band or window.

This time, instead of having only one reference voltage value, a window comparator will have two reference voltages applied by a pair of voltage comparators. One triggers an op-amp comparator in the detection of the upper voltage threshold, VREF(UPPER), and the other triggers an op-amp comparator in the detection of a lower voltage threshold level, VREF (LOWER). Then the voltage levels between these two upper and lower reference voltages are called "windows", hence the name.

Using our idea of the voltage divider network above, if we now use three equal value resistances, R1 = R2 = R3 = R, we can create a very simple window comparator circuit, as shown. In addition, since all resistance values are equal, voltage drops in each resistance will be equal at 1/3Vcc, one-third of the feed voltage. For convenience in this simple window comparator example, we can adjust the upper reference voltage to 2/3Vcc and the lower reference voltage to 1/3Vcc.

Consider the window comparator circuit below.

Window Comparator Circuit

Window Comparator Circuit

The first switching condition of the circuit is equal to "OFF" with the open collector output of op-amp A1, open collector output of op-amp A2, "ON" (sinking current) i.e. VOUT 0V.

When the VIN is below the VREF (LOWER) lower voltage level equal to 1/3Vcc, VOUT will be LOW. When vin exceeds this 1/3Vcc low voltage level, its first op-amp comparator detects it and changes the open collector output to HIGH. This means that the outputs of both op-amps are HIGH at the same time. Tensile resistance does not flow through the RL, so VOUT is equal to Vcc.

As vin continues to increase, it exceeds VREF (UPPER), the upper voltage level at 2/3Vcc. At this point, the second op-amp comparator detects this and changes its output to LOW and equals VOUT 0V.

Then the difference between VREF(UPPER) and VREF(LOWER) (which in this example is 2/3Vccc – 1/3Vcc) creates the switching window for the positive outgoing signal.

Now let's say that the VIN is at its maximum value and equal to Vcc. As the VIN decreases, it exceeds the VREF (UPPER) upper voltage level of its second op-amp comparator, which changes the output to HIGH. As vin continues to decrease, the VREF (LOWER) of its first op-amp comparator once again changes its lower voltage level to LOW.

The difference between VREF(UPPER) and VREF(LOWER) then creates the window for the negative outgoing signal. Thus, as the VIN passes above or below the upper and lower reference levels set by the two op-amp comparators, we can see that the VOUT output signal will be HIGH or LOW.

In this simple example, we set the top opening level to 2/3Vcc and the lower opening level to 1/3Vcc (because we used three equal-value resistors), but by setting the input thresholds we can have any value that we choose. As a result, the window width can be customized for a specific application.

If we use a dual power supply and set the upper and lower opening levels to ±10 volts, and the VIN is a sinusoidal waveform, then we could use this window comparator circuit as a zero transition detector that will produce an output of the sinus wave, every time the HIGH or LOW sinus wave crosses the zero volt line from positive to negative or negative to positive.

By connecting a number of different op-amp comparators using a common input signal, but each comparator can further the idea of detecting voltage levels, using a different reference voltage set by our now familiar network of voltage dividers throughout the feed. . Consider the voltage level detector circuit below.

Comparator Voltage Level Detector


As above, the voltage divider network provides a number of reference voltages for individual op-amp comparator circuits. Five resistors are required to produce four reference voltages. The connection in the lower resistance pair will produce a reference voltage of 1/5Vcc, one-fifth of the feed voltage, using equal value resistors. The second pair is 2/5Vcc, a third 3/5Vcc pair and so on, these reference voltages increase towards 5/5Vcc, which is actually Vcc with a fixed amount of one-fifth (1/5).

As the common input voltage increases, the output of each op-amp comparator circuit is switched in order, thereby turning the LED off, starting with the lower comparator A4 and connected upward towards the A1 as the input voltage increases. Thus, by adjusting the values of the resistors in the voltage divider network, the comparators can be configured to detect any voltage level. A good example of the use of voltage level detection and display can be for a battery status monitor by turning the LEDs over and connecting them to 0V (soil) instead of VCC.

More trigger points can also be created by increasing the number of op-amp comparators in the set. For example, if we had eight op-amp comparators in the chain and fed the output of each comparator from 8 to 3 line Digital Encoder, we can make a very simple analog-to-digital converter (ADC). converts the analog input signal to 3-bit binary code (0 to 7).

Positive Feedback Op-amp Comparator

Here we have seen that transactional amplifiers can be configured to work as comparators in open loop mode, and this is good if the input signal changes rapidly or is not too noisy. However, if the input signal is slow to change the VIN or there is electrical noise, the op-amp comparator can oscillate by changing its output back and forth between two saturation statuses, +Vcc and -Vcc, while the input signal hovers around the reference. voltage, VREF level. One way to overcome this problem and prevent op-amp from oscillating is to provide positive feedback around the comparator.

As the name suggests, positive feedback is a technique for feedbacking part or part of the output signal in phase to the nonververting input of the op-amp through a potential divider established by two resistances with the amount of feedback. proportions.

The use of positive feedback around an op-amp comparator means that when the output is triggered at any level of saturation point, there must be a significant change in the input signal VIN before the output returns to the original saturation point. This difference between the two switching points is often called hysteresis, which produces what is called the Schmitt triggering circuit. Consider the inverter comparator circuit below.

Reversing the Hysteresis Op-amp Comparator

Reversing the Hysteresis Op-amp Comparator

For the inverter comparator circuit above, vin is applied to the inverting input of the op-amp. Resistors R1 and R2 form a voltage dividing network along the comparator and provide positive feedback by appearing at the input, where part of the output voltage does not reverse. The amount of feedback to the non-inverter inlet is determined by the resistance ratio of the two resistances used and given as follows:

Voltage Divider Equation

Voltage Divider Equation

Where: β (beta) can be used to indicate the feedback fraction.

Input signal reference voltage, VIN < VREF'den düşük olduğunda, çıkış voltajı YÜKSEK, VOH olacaktır ve pozitif doyma voltajına eşit olacaktır. Because the output is HIGH and positive, the value of the reference voltage on the inverted input will approximately equal: +β*V is called Top Opening Point or UTP.

As an input signal, as the VIN increases, this is equal to the upper opening point voltage, the VUTP level in the inverted input. This causes the comparator output to equal negative saturation voltage as LOW, VOL, and previous.

But the difference this time is the creation of a second opening point voltage value, since a negative voltage equal to that appears at the input that no longer reverses: -β*V as a result of the negative saturation voltage in the output. Then the input signal must fall below this second voltage level, called The Lower Opening Point or LTP, in order for the voltage comparator output to change or return to its original positive state.

Thus, when the output state changes, we can see that the reference voltage on the inverted input also changes by creating two different reference voltage values and two different switching points. One point is called the Top Trip Point (UTP), while the other is called the Lower Trip Point (LTP). The difference between these two opening points is known as Hysteresis.

The amount of hysteresis is determined by the feedback fraction of the output voltage, which is fed back into the inverted input, β. The advantage of positive feedback is that the resulting comparator Schmitt trigger circuit is immune to irregular triggering caused by noise or slowly changing input signals within the hysteresis band, which produces a cleaner output signal, since the op-amp comparator output is triggered only once.

That is, VREF = +β Vcc for positiveoutput voltages, but VREF = -βVcc for negative output voltages. Then we can say that the amount of tension hysteria will be given as follows:


By replacing the input and reference terminals as shown, we can also produce an op-amp comparator circuit with built-in hysteresis that does not invert:

Hysteresis Inverter Op-amp Comparator

Hysteresis Inverter Op-amp Comparator

Notice that the arrows in the Hysteresis chart indicate the switching direction at the top and bottom opening points.

Voltage Comparator

Although we can use transactional amplifiers such as 741 as a basic comparator circuit, the problem with this is that op-amps are optimized only for linear processing. This is where the input terminals are at almost the same voltage level, and the output stage is designed to produce an unsaturated linear output voltage for long periods of time. In addition, standard transactional amplifiers are designed for use in closed loop applications with negative feedback from output to inverter input.

On the other hand, a special voltage comparator is a nonlinear device that allows heavy saturation due to its very high gain, when input signals differ in a relatively small amount. The difference between an op-amp comparator and a voltage comparator is in the output stage due to the fact that a standard op-amp has an output stage optimized for linear operation, while the output stage of a voltage comparator is optimized for continuous saturated operation. it is always intended to be close to one feeding track or another and not in between.

Commercial comparators such as the LM311 single comparator, LM339 quad comparator, or LM393 dual differential comparator are voltage comparators that come in a standard IC package running from single or dual sources. These special voltage comparators are designed to change output from one saturated state to another very quickly, since transistors used for a voltage comparator output stage are usually switching transistors.

Voltage comparators are often used to connect two different electrical signals with different feed or reference voltages, since they convert a linear input signal into a digital output signal. As a result, the output stage of the voltage comparator is usually configured as a single open collector (or Discharge) transistor switch with on or off states rather than actual output voltages, as shown.

Voltage Comparator Circuit

Voltage Comparator Circuit