6.4 Open Loop Voltage Comparator
A common op amp application making deliberate use of saturation is the voltage comparator. This circuit compares two input voltages and produces a binary output voltage (that is, a voltage that can have only one of two possible values) to indicate which input voltage is higher. Consider the circuit shown in Fig. 6.17, with unipolar supply voltage
. Assume the op amp is ideal, with infinite open-loop gain, A. The output voltage hits the positive voltage supply rail,
volts, whenever the differential input voltage is positive, i.e., whenever
. Likewise, the output voltage sits at the ground rail,
volts, whenever the differential input voltage is negative, i.e., when
. If we consider a real op amp, with finite open loop gain, such as
, then the output would sit at the positive supply rail whenever
exceeds
by
, a very small value.
Neglecting this small value, we can write
when
and
when
. A numerical example follows.

Examples
Example: Design an op amp comparator circuit that determines whether a test voltage,
, exceeds a reference voltage,
. The circuit should cause an LED to glow whenever
.
Solution: The op amp is set up as a voltage comparator with inputs
and
. (We are not concerned with where these voltages come from in this circuit; in the next chapter, we will examine this using a more detailed circuit.) When powered with a unipolar supply voltage of
, the op amp output will be high (
) when
and low (
or
potential) otherwise. An LED at the output of the op amp serves as an indicator, glowing when
. The 100Ω resistor between the LED anode and the op amp output was chosen to provide a current of
mA in the LED circuit, which would result in a bright LED.

Question: in the example just discussed, what value resistor should be used in the output circuit, in place of the 100Ω resistor, if the voltage supply rail of
is used instead of
? Assume, for this case, that the LED drops
and should be operated at a current of
mA.
Answer: The high-level output from the op amp would be
. The resistor would drop
V, and the appropriate resistance would be
.
Note that the output voltage was assumed to saturate at the voltage supply rail, 5 and 12 volts, in these two examples. We are ignoring the ~ 1 V voltage drop between the supply rail and the saturated output in these examples.
Fig. 6.19 shows how the previous circuit might be developed using a pair of voltage dividers at the op amp inputs. Op amp voltage rails
and ground are connected to the
and
terminals of a
volt battery, respectively. Two voltage dividers, each comprised of a pair of resistors in series, are connected in parallel with the battery. In this circuit,
and
is determined by the setting of variable resistor
. When
, for example,
and the output LED will glow.

Figure 6.20 is a view of the same circuit schematic with the ground symbol used in place of the lower node.

In Fig. 21, we show a wiring drawing of the circuit using an LM358 Dual Op Amp IC. Only one of the two op amps on this IC is used in the circuit.

Feedback/Errata