KAHIBARO
Discord Login Register
Up
9.2.3 Operational Amplifiers

9.2.3.3 Comparators

Purpose of a Comparator

A comparator is a circuit that compares two voltages and produces an output that indicates which one is larger. In its simplest form, it answers a yes or no question. Is the input voltage above a reference voltage, or below it?

This makes the comparator one of the most useful building blocks in electronics. It turns an analog input, which can vary continuously, into a digital-like output, which is usually near a high voltage level or a low voltage level.

If we call the two input voltages $V_+$ and $V_-$, then the ideal comparator behaves like this:

$$
V_{\text{out}} =
\begin{cases}
V_{\text{high}}, & \text{if } V_+ > V_- \\
V_{\text{low}}, & \text{if } V_+ < V_-
\end{cases}
$$

The exact values of $V_{\text{high}}$ and $V_{\text{low}}$ depend on the power supply and the comparator circuit.

A comparator does not try to produce an amplified linear output. Its purpose is to switch to one of two output states depending on which input is larger.

Comparator Using an Op-Amp

An operational amplifier can be used as a comparator when it is operated without negative feedback. In this case, even a very small difference between the two input voltages is multiplied by the large open-loop gain, driving the output close to its maximum positive or negative value.

The open-loop relation is

$$
V_{\text{out}} = A\left(V_+ - V_-\right)
$$

where $A$ is the open-loop gain, usually very large. Because $A$ is so large, the output saturates quickly. If $V_+ - V_-$ is positive, the output goes high. If $V_+ - V_-$ is negative, the output goes low.

This is why an op-amp can act as a voltage comparator.

Non-Inverting and Inverting Comparison

There are two common ways to connect a comparator.

In a non-inverting comparator, the signal is applied to the non-inverting input and the reference voltage is applied to the inverting input. The output goes high when the signal exceeds the reference.

$$
\text{If } V_{\text{in}} > V_{\text{ref}}, \quad V_{\text{out}} \to V_{\text{high}}
$$

In an inverting comparator, the signal is applied to the inverting input and the reference voltage is applied to the non-inverting input. The output goes low when the signal exceeds the reference.

$$
\text{If } V_{\text{in}} > V_{\text{ref}}, \quad V_{\text{out}} \to V_{\text{low}}
$$

The behavior is summarized below.

ConfigurationSignal inputReference inputOutput condition
Non-inverting comparator$V_+$$V_-$High when $V_{\text{in}} > V_{\text{ref}}$
Inverting comparator$V_-$$V_+$Low when $V_{\text{in}} > V_{\text{ref}}$

Reference Voltage

A comparator needs a comparison level, usually called the reference voltage. This reference may be zero volts, a fixed DC voltage, or a voltage produced by a divider network.

If the reference is $V_{\text{ref}}$, then the comparator switches when the input crosses that value. This is called the threshold.

For example, if $V_{\text{ref}} = 2.5\ \text{V}$, then the output changes state when the input passes through $2.5\ \text{V}$.

The switching point of a basic comparator is set by the reference voltage. The comparator changes output state when the input crosses that threshold.

Typical Operation

Suppose a comparator is powered so that its output can go near $0\ \text{V}$ for low and near $5\ \text{V}$ for high. Let the reference voltage be $2\ \text{V}$.

If the input is $1.5\ \text{V}$, then in a non-inverting comparator the output is low.

If the input rises to $2.3\ \text{V}$, the output switches high.

This makes comparators useful wherever a circuit must detect whether a signal is above or below a chosen level.

Basic comparator action

Practical Output Behavior

An ideal comparator switches instantly, but real devices take a finite time to change output state. Also, many op-amps are not designed specifically for comparator use. Their output may recover slowly from saturation, and their switching may not be very sharp in fast circuits.

For this reason, dedicated comparator integrated circuits are often preferred in practical digital interfacing and threshold detection.

Still, the op-amp comparator is excellent for learning the idea of voltage comparison.

Comparator with Zero Reference

A very common case is when the reference voltage is $0\ \text{V}$. Then the comparator simply tells whether the input is positive or negative.

This is called a zero-crossing detector.

For a non-inverting arrangement,

$$
V_{\text{out}} =
\begin{cases}
V_{\text{high}}, & V_{\text{in}} > 0 \\
V_{\text{low}}, & V_{\text{in}} < 0
\end{cases}
$$

This is useful for detecting the instant when an AC signal crosses zero.

Zero-crossing detection

Sensitivity to Noise

If the input voltage is very close to the reference voltage, small unwanted fluctuations can cause the output to switch back and forth rapidly. This unwanted behavior is called chatter or noise-induced switching.

For example, if $V_{\text{in}}$ is supposed to be near the threshold, a tiny disturbance may make

$$
V_{\text{in}} > V_{\text{ref}}
$$

for one moment, and then

$$
V_{\text{in}} < V_{\text{ref}}
$$

the next moment. The output then flips repeatedly.

This is one reason why practical comparator circuits often use hysteresis, although that belongs to a more advanced treatment of comparator design.

When the input is near the threshold, noise can cause repeated unwanted switching. A simple comparator can be unstable near the switching point.

Common Applications

Comparators are used whenever a circuit must make a decision based on voltage level. They appear in level detectors, battery monitors, sensor threshold circuits, zero-crossing detectors, waveform shaping, and analog-to-digital interfacing.

A temperature sensor, for example, may produce a voltage proportional to temperature. A comparator can switch on a fan when that voltage exceeds a preset reference. A light sensor can trigger a lamp when the ambient light falls below a threshold.

In each case, the key idea is the same. The comparator checks whether one voltage is larger than another and then drives the output to one of two states.

Essential Idea

A comparator is a threshold detector. It compares an input voltage with a reference voltage and produces a high or low output depending on which is greater.

Ideal comparator rule:
$$
V_{\text{out}} =
\begin{cases}
V_{\text{high}}, & V_+ > V_- \\
V_{\text{low}}, & V_+ < V_-
\end{cases}
$$
For a non-inverting comparator, the output goes high when the input rises above the reference.

Understanding this switching behavior is the foundation for many electronic control and digital interface circuits.

Up
9.2.3 Operational Amplifiers

Views: 4

Comments

Please login to add a comment.

Don't have an account? Register now!