- Trained on our vast library of engineering resources.
Electronics I Laboratory Manual

# Comparators

Operational amplifiers can be used as comparators to compare the amplitude of two voltages.  A comparator determines whether an input voltage is greater than a fixed reference voltage.  In this type of function the op-amp is used generally in the open-loop configuration, with the input voltage on one input terminal and the reference on the other.  As you know, when used in open-loop mode, the output voltage reaches either its positive saturation level (when the differential voltage1 is positive) or its negative saturation voltage (when the differential voltage is negative).  These ideas are shown in Figure 24.1.  In part (a) of this figure we see the symbol of a comparator (i.e., an op-amp in open-loop mode), and in part (b) we show the relationship between the input voltage (VD) and the output voltage (Vo).  Notice that the output voltage does not change instantaneously as soon as the input is applied.  This behavior is due to the fact that the slew rate of the amplifier is not (ideally) infinite.  For practical purposes, however, in this experiment we will assume that there is no delay in the output.

 Figure 24.1: A comparator

There are several configurations used for the purpose of comparing two voltages.  Here we will study some of them.

 1 Recall that the differential voltage is the voltage difference between the input at the non-inverting terminal and the voltage at the inverting terminal.  In equation form we have vd = v+ - v-

Zero-Crossing Detector

A zero-crossing detector2 is a circuit that determines (or indicates) when an input voltage is larger than or less than zero (0V).  Figure 24.2 shows two op-amp circuits that can be used to indicate these conditions:

Figure 24.2: Non-inverting and Inverting zero-crossing detectors

1. In Fig. 24.2(a) we present a non-inverting comparator circuit.  In this arrangement an input voltage (the signal that we want to test3) is applied at the non-inverting input, and the inverting input is kept at 0V (ground, in this case).  As you know the amplifier output will depend on the polarity of the differential voltage Vd,

 (24.1)

Because V_, as you can see, is zero, the output voltage will depend only on V+.  Also, given that the op-amp is being used in open-loop, the output will always be the negative or positive op-amp saturation value.  Therefore, the following equations apply to this circuit.

 (24.2)

2. Figure 24.2(b) shows an inverting comparator.  In this case the output voltage will be positive when the differential voltage is negative and vice-versa.  In other words, the indications here are opposite to the indications given by the non-inverting comparator. The output equation can be written as
 (24.3)

2 Also known as zero-level detector.
3 As you can see this is an arbitrary voltage.

Nonzero-Crossing Detectors

A circuit that can detect when an input voltage is bigger than or smaller than a given reference voltage (Vref) is called a non-zero crossing detector4.  There are many types of circuits that can perform this function.  Here we will present three basic circuits.  The difference among them is in the type of reference voltage used in the circuit.

4 Also known as a non-zero level detector

Battery Reference

 Figure 24.3: Non-zero level detector: power supply reference

A non-zero crossing detector using a battery or a power supply as the reference voltage is shown in Figure 24.3.  Notice that this is a modification of the zero-level detector.  Instead of grounding the non-inverting input (you can have an inverting comparator as well) a fixed voltage is applied to the inverting input.  In Fig. 24.3 we are using a power supply or battery for this purpose.

When the input voltage is bigger than the reference voltage, then the differential voltage, given by Eq. 24.1, is positive and the output voltage will reach its positive saturation value.  If, on the other hand, the input voltage is smaller than the fixed reference voltage, the differential voltage, Vd, is negative and the output of the op-amp reaches its negative saturation value.  In equation form we have:

 (24.4)

Voltage-Divider Reference

 Figure 24.4: Non-zero level detector: voltage-divider reference

A more practical arrangement is shown in Figure 24.4.  In this case the reference voltage is supplied through a voltage-divider circuit.  The reference voltage, which is the voltage at the inverting input, is given by

 (24.5)

In real situations the supply voltage for the divider circuit is taken from the positive bias voltage needed to drive the op-amp (+Vcc).

 Figure 24.5:  Non-zero level detector: zener diode reference

Zener Diode Reference

Another way to provide the reference is through a zener diode in reverse bias, as is shown in Figure 24.5.  In this case the reference voltage Vref is VZ, the Zener voltage.  This arrangement produces a more stable reference voltage than the last case.

Window Comparator

 Figure 24.6:  Window Comparator

Many times it is required to determine when a given voltage is between an upper and a lower limit.  This task can be accomplished by a window comparator.

Figure 24.6 shows a basic window comparator.  The upper and lower limits (VU and VL, respectively) can be set using any of the methods presented in the last section of this experiment.  The input voltage is applied as shown.  Notice that the input voltage is applied to both the non-inverting input of the top op-amp and to the inverting input of the lower op-amp.  When this voltage is less than VU and bigger than VL the output of each op-amp (comparator) is at its negative saturation value.  This forces the two diodes into reverse bias and the output voltage Vo is zero.  When the input voltage is larger than VU or is smaller than VL the output of each op-amp reaches its positive saturated value.  This condition forward-bias the diodes, and the output is a constant positive voltage.  This voltage, Vo, is equal to the saturation value of the op-amp minus the forward-bias voltage of the diode D2 (0.7V).  To summarize,

 (24.6)