0% found this document useful (0 votes)
92 views9 pages

Comparators

The document provides an overview of comparators, explaining their function of comparing two input voltages to determine which is greater, and their applications in circuits such as square wave generators and oscillators. It details the implementation of basic comparators using op-amps, the conversion of sine waves to square waves, and methods for setting reference voltages using potential dividers and Zener diodes. Additionally, it introduces the Schmitt Trigger as a solution for noise issues in level detection, highlighting its hysteresis effect.

Uploaded by

Azmat Ameen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views9 pages

Comparators

The document provides an overview of comparators, explaining their function of comparing two input voltages to determine which is greater, and their applications in circuits such as square wave generators and oscillators. It details the implementation of basic comparators using op-amps, the conversion of sine waves to square waves, and methods for setting reference voltages using potential dividers and Zener diodes. Additionally, it introduces the Schmitt Trigger as a solution for noise issues in level detection, highlighting its hysteresis effect.

Uploaded by

Azmat Ameen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Part II

EEEE2044 – Comparators

1
Lecture 1 – Comparators

2.1 What is an comparator?

A comparator has two inputs and one output. Its function is compare the inputs to see which has the greatest
voltage. The circuit symbol for a comparator is shown in Figure 2.1, the symbol is identical to that of an
op-amp.

VS+

v− −
vo
v+ +

VS−

Figure 2.1: Circuit diagram symbol for comparator with supply pins.

If the + input is greater than the − pin then the output will be VS+ and if the − input is greater than the +
then the output will be VS− . This can be useful in many applications.
Comparators are used in many applications including:
• Square Wave generators
• Zero crossing detectors
• Data Converters (A/D and D/A converters)
• Oscillators

2.2 Basic comparator

A basic comparator can be implemented using an op-amp.


Recall that the relationship between the input and output voltages of an op-amp is given by:

vo = G (v+ − v− ) (2.1)

where G is the gain.


If v+ > v− and G is chosen to be large (as it is in an op-amp), then the amplifier will be driven into saturation
and so vo = VS+ .
If v+ < v− and G is chosen to be large, then the amplifier will be driven into saturation and so vo = VS− .

2
2.3. Converting Sine Waves to Square Waves 3

Top tip
It is not usually wise to drive an op-amp into saturation for prolonged periods of time as they are not
designed for this. Dedicated comparator devices are designed to be run in saturation (but are not very
good at amplification). So, avoid using op-amps as comparators and never use a comparator as an
op-amp.

2.3 Converting Sine Waves to Square Waves

In the example shown in Figure 2.2, a sinusoidal oscillator is attached to the + input of the comparator. When
vi > 0, the output goes to VS+ and when vi < 0 the output goes to VS− .

As a sine wave is greater than zero for the same period that it is less than zero, the comparator is converts a
sine wave to a square wave.

VS+ vi 0


vo
+ VS+

vo 0
vi VS−
VS−

time
(a) Circuit for converting sine waves to square waves. (b) Input (top) and output signal (bottom).

Figure 2.2: Sine to square wave converter.

2.4 Non-Zero Level Detection

Suppose that we wish to switch comparator output voltages dependent on whether vi is greater than or less
than a reference dc voltage VREF rather than 0 V. Assuming vi is connected to the + pin of the comparator,
the threshold is set by the voltage on the − pin of the comparator (which in Figure 2.2a is 0 V).

All of the circuits in Figure 2.3 achieve this.

2.4.1 Voltage Supply Reference

It should be clear how the supply voltage can be used to set the reference voltage. However, how do we set the
voltage of the supply? If the supply is a battery, what happens to the reference voltage as the battery voltage
decreases?

EEEE2044: Part II – Comparators – Lecture 1


4 Comparators

VS+


vo
VREF + +

vi VS−

(a) Reference derived from another supply.


VS+ VS+

R1 VS+ R1 VS+

VREF − VREF −
vo vo
R2 + +

vi VS− vi VS−

(b) Reference derived from a potential divider. (c) Reference derived from a Zener diode.

Figure 2.3: Comparator reference circuits.

EEEE2044: Part II – Comparators – Lecture 1


2.4. Non-Zero Level Detection 5

2.4.2 Potential Divider Reference

In Figure 2.3b, assuming no current enters the comparator input pins (Op-amp Golden Rule 2), we can say
that
R2
VREF = VS+ (2.2)
R1 + R2
So, by careful selection of R1 and R2 any reference can be generated. However, if VS+ changes, for example if
it is from a battery that is running flat, VREF will also change.

2.4.3 Zener Diode Reference

To see how the Zener diode works in this circuit, recall that it is a diode that acts in reverse, as well as forward,
bias. So long as the voltage is above a threshold, current can flow from the cathode to the anode, or the anode
to the cathode (depending on the biasing). The circuit symbol for a Zener diode is shown in Figure 2.4 and
the relationship between the current through and the voltage across is shown in Figure 2.5.

anode cathode

Figure 2.4: Circuit diagram symbol for a Zener diode.

current (I)

−VZ (Zener voltage) (at IZT ) voltage (V)

IZK (Zener knee current)

IZT (Zener test current)

IZM (Zener maximum current)

Figure 2.5: Voltage-Current (V–I) curve for a Zener diode.

Figure 2.6 shows the Zener diode and resistor connected in series. If VA − VC > 0.7 V, then the Zener diode will
be forward biased and can be modeled as a dc source, with a voltage of 0.7 V, as in Figure 2.7.
If VC − VA > VZ , then the Zener diode will be reverse biased and can also be modeled as a dc source, this time
with a voltage of VZ , as in Figure 2.8. Bear in mind that because the current is reversed, the polarity of the
source in the model is also reversed.
The resistor, R1 , is required to set the current, i, between IZK and IZM . If the resistor is not present or has a
very low resistance, the current will be greater than the Zener maximum current.

EEEE2044: Part II – Comparators – Lecture 1


6 Comparators

VB R1
VA VC

Figure 2.6: Zener diode and resistor in series.

0.7 V
VB R1
i
VA VC

+

Figure 2.7: Model of forward biased Zener diode in series with resistor. (VA − VC > 0.7 V, therefore VA − VB =
0.7 V)

Placing the reverse diode model into Figure 2.3c, gives the circuit shown in Figure 2.9. Now, so long as the
current is between IZK and IZM , the reference voltage will be very close to the Zener voltage, VZ , regardless
to the value of VS+ (of course, assuming that VS+ is greater than VZ ).

2.5 Level detection in the presence of Noise – Schmitt Trigger

Problems with level detection occur when there is noise on the input signal. For example, see Figure 2.11,
which shows a noisy signal, vi , being level detected with a reference of 0 V (Figure 2.2a). As you can see from
the output signal, vo , there are glitches in the square wave where the signal drops below or rises above zero
because of the noise.
A method of avoiding this is to have two thresholds rather than one. For the output to transition from low
to high, the input must be larger than an upper trigger point voltage (VU T P ), which will be greater than 0 V
and to transition from high to low, the input must be below a lower trigger point voltage (VLT P ), which will
be less than 0 V. Put another way, we want to delay the changing of the output until the absolute value of vi
is larger than the maximum voltage of the noise. That is, the absolute value of VU T P and VLT P needs to be
greater than the absolute maximum value of the noise. A noisy input signal and the output we are aiming the
achieve is shown in Figure 2.12.
A circuit that can achieve this is shown in Figure 2.13, and is called a Schmitt Trigger. This looks similar to
an inverting amplifier, but it is not, because the feedback is into the non-inverting input, rather than the
inverting input. This circuit uses positive feedback.
Also note that the reference voltage, VREF , is connected to the non-inverting input and the input is connected
to the inverting input. Large positive input voltages give large negative output voltages and large negative
input voltages give large positive output voltages.
The value of vo can be calculated as follows:



⎪VS+ if vi < VREF ,
vo = ⎨
⎪ if vi > VREF .
⎩VS−

However, changing the value of vo immediately changes the value of VREF , which can be calculated via the
potential divider equation:

R2
VREF = vo
R1 + R2

EEEE2044: Part II – Comparators – Lecture 1


2.5. Level detection in the presence of Noise – Schmitt Trigger 7

VZ
VB R1
i
VA VC


+
Figure 2.8: Model of forward biased Zener diode in series with resistor. (VC − VA > VZ , therefore VB − VA = VZ )

VS+

R1 VS+

VREF −
vo
+
VZ +

vi VS−

Figure 2.9: Reference derived from a Zener diode in reverse bias modeled as a voltage source.

VREF
vi 0

VS+

vo 0

VS−

time

Figure 2.10: Input and output signals from a comparator with a non-zero reference voltage.

vi 0

VS+
vo 0

VS−

time

Figure 2.11: Input (with noise, vi ) and output (vo ) signals from a comparator with a reference voltage of 0 V.
The signal without noise is shown as the grey line.

EEEE2044: Part II – Comparators – Lecture 1


8 Comparators

VU T P
vi 0
VLT P

VS+

vo 0

VS−

time

Figure 2.12: Input (with noise) and output signals from a comparator with different trigger points for high-to-
low and low-to-high transitions.

VS+

vi −
vo
+
R1
VS−
VREF

R2

Figure 2.13: Schmitt Trigger Circuit.

EEEE2044: Part II – Comparators – Lecture 1


2.5. Level detection in the presence of Noise – Schmitt Trigger 9

To see how the circuit works it is a useful to follow the inputs and output through a cycle. Suppose that vi is
a larger than any possible value of VREF , then

vo = VS−
R2
VREF = VS− .
R1 + R2
Now, the output, vo , will only change when the input is below VREF . At this moment in time, VREF = VLT P .
When vi drops below VREF (or VLT P ), the value of vo will change,

vo = VS+
R2
V+ = VS+ .
R1 + R2
The output, vo , can now only change if the input is above the new value of VREF . Now, VREF = VU T P . When
vi rises above VREF (or VU T P ), the value of vo will change to VS− again, and the cycle continues. The way in
which VREF changes with the input signal can be seen in Figure 2.14.
There are no fluctuations in the output signal, however there is a drawback in that the output will always
switch later than when the clean signal crosses zero. The circuit has hysteresis, that is the output depends on
the previous values of the input as well as the current value. The voltage hysteresis of a Schmitt trigger as
defined as the difference beween the voltage levels at the two different thresholds.

VHY S = VU T P − VLT P .

VU T P
VREF 0
VLT P

VU T P
vi 0
VLT P

VS+

vo 0

VS−

time

Figure 2.14: Input (with noise) and output signals from Schmitt Trigger, showing VREF at each time point.

EEEE2044: Part II – Comparators – Lecture 1

You might also like