Comparator Opamp
Comparator Opamp
Comparator Opamp
Op-amp Comparator
The comparator is an electronic decision making circuit that makes use of an operational
amplifiers very high gain in its open-loop state, that is, there is no feedback resistor.
The Op-amp comparator compares one analogue voltage level with
another analogue voltage level, or some preset reference voltage, VREF and
produces an output signal based on this voltage comparison. In other
words, the op-amp voltage comparator compares the magnitudes of two
voltage inputs and determines which is the largest of the two.
We have seen in previous tutorials that the operational amplifier can be
used with negative feedback to control the magnitude of its output signal in
the linear region performing a variety of different functions. We have also
seen that the standard operational amplifier is characterised by its open-
loop gain AO and that its output voltage is given by the
expression: VOUT = AO(V+ – V-) where V+ and V- correspond to the voltages
at the non-inverting and the inverting terminals respectively.
Voltage comparators on the other hand, either use positive feedback or no
feedback at all (open-loop mode) to switch its output between two
saturated states, because in the open-loop mode the amplifiers voltage
gain is basically equal to AVO. Then due to this high open loop gain, the
output from the comparator swings either fully to its positive supply
rail, +Vcc or fully to its negative supply rail, -Vcc on the application of
varying input signal which passes some preset threshold value.
The open-loop op-amp comparator is an analogue circuit that operates in
its non-linear region as changes in the two analogue
inputs, V+ and V- causes it to behave like a digital bistable device as
triggering causes it to have two possible output states, +Vcc or -Vcc. Then
we can say that the voltage comparator is essentially a 1-bit analogue to
digital converter, as the input signal is analogue but the output behaves
digitally.
Consider the basic op-amp voltage comparator circuit below.
With reference to the op-amp comparator circuit above, lets first assume
that VIN is less than the DC voltage level at VREF, ( VIN < VREF ). As the non-
inverting (positive) input of the comparator is less than the inverting
(negative) input, the output will be LOW and at the negative supply
voltage, -Vcc resulting in a negative saturation of the output.
If we now increase the input voltage, VIN so that its value is greater than the
reference voltage VREF on the inverting input, the output voltage rapidly
switches HIGH towards the positive supply voltage, +Vcc resulting in a
positive saturation of the output. If we reduce again the input voltage VIN, so
that it is slightly less than the reference voltage, the op-amp’s output
switches back to its negative saturation voltage acting as a threshold
detector.
Then we can see that the op-amp voltage comparator is a device whose
output is dependant on the value of the input voltage, VIN with respect to
some DC voltage level as the output is HIGH when the voltage on the non-
inverting input is greater than the voltage on the inverting input, and LOW
when the non-inverting input is less than the inverting input voltage. This
condition is true regardless of whether the input signal is connected to the
inverting or the non-inverting input of the comparator.
We can also see that the value of the output voltage is completely
dependent on the op-amps power supply voltage. In theory due to the op-
amps high open-loop gain the magnitude of its output voltage could be
infinite in both directions, (±∞). However practically, and for obvious
reasons it is limited by the op-amps supply rails
giving VOUT = +Vcc or VOUT = -Vcc.
We said before that the basic op-amp comparator produces a positive or
negative voltage output by comparing its input voltage against some preset
DC reference voltage. Generally, a resistive voltage divider is used to set
the input reference voltage of a comparator, but a battery source, zener
diode or potentiometer for a variable reference voltage can all be used as
shown.
Window Comparator
A Window Comparator is basically the inverting and the non-inverting
comparators above combined into a single comparator stage. The window
comparator detects input voltage levels that are within a specific band
or window of voltages, instead of indicating whether a voltage is greater or
less than some preset or fixed voltage reference point.
This time, instead of having just one reference voltage value, a window
comparator will have two reference voltages implemented by a pair of
voltage comparators. One which triggers an op-amp comparator on
detection of some upper voltage threshold, VREF(UPPER) and one which triggers
an op-amp comparator on detection of a lower voltage threshold
level, VREF(LOWER). Then the voltage levels between these two upper and lower
reference voltages is called the “window”, hence its name.
Using our idea above of a voltage divider network, if we now use three
equal value resistors so that R1 = R2 = R3 = R we can create a very simple
window comparator circuit as shown. Also as the resistive values are all
equal, the voltage drops across each resistor will also be equal at one-third
the supply voltage, 1/3Vcc. So for ease in this simple window comparator
example, we can set the upper reference voltage to 2/3Vcc and the lower
reference voltage to 1/3Vcc.
Consider the window comparator circuit below.
Note that the arrows on the hysteresis graph indicate the direction of
switching at the upper and lower trip points.
Feedback Fraction:
Here, the open collector output from the voltage comparator is connected
to a voltage source via a single pull-up resistor (and an LED for indication)
which pulls the single output high to the power supply. When the output
switch is HIGH it creates a high impedance path, therefore no current flows
as VOUT = Vcc.
When the comparator changes state and the output switch is LOW, it
creates a low impedance path to ground and current flows through the pull-
up resistor (and LED) causing a voltage drop across itself with the output
being pulled to the lower supply level, ground in this case.
Then we can see that there is very little difference between the schematic
symbol of an op-amp comparator and a voltage comparator or their internal
circuits. The main difference is in the output stage with the open collector or
drain configuration is useful for driving relays, lamps, etc. By driving a
transistor from the output allows for a greater switching current capacity
than that of the comparators output alone.
Op-amp Multivibrator
The Op-amp Multivibrator is a non-inverting op-amp circuit that produces its own input
signal with the aid of an RC feedback network
The Operational Amplifier or Op-amp for short, is a very versatile device
that can be used in a variety of different electronic circuits and applications,
from voltage amplifiers, to filters, to signal conditioners. But one very simple
and extremely useful op-amp circuit based around any general purpose
operational amplifier is the Astable Op-amp Multivibrator.
We saw in our tutorials about Sequential Logic that multivibrator circuits
can be constructed using transistors, logic gates or from dedicated chips
such as the NE555 timer. We also saw that the astable multivibrator
switches continuously between its two unstable states without the need for
any external triggering.
But the problem with using these components to produce an astable
multivibrator circuit is that for transistor based astables, many additional
components are required, digital astables can generally only be used in
digital circuits, and the use of a 555 timer may not always give us a
symmetrical output without additional biasing components. The Op-amp
Multivibrator circuit however, can provide us with a good rectangular wave
signal with the use of just four components, three resistors and a timing
capacitor.
The Op-amp Multivibrator is an astable oscillator circuit that generates a
rectangular output waveform using an RC timing network connected to the
inverting input of the operational amplifier and a voltage divider network
connected to the other non-inverting input.
Unlike the monostable or bistable, the astable multivibrator has two states,
neither of which are stable as it is constantly switching between these two
states with the time spent in each state controlled by the charging or
discharging of the capacitor through a resistor.
In the op-amp multivibrator circuit the op-amp works as an analogue
comparator. An op-amp comparator compares the voltages on its two
inputs and gives a positive or negative output depending on whether the
input is greater or less than some reference value, VREF.
However, because the open-loop op-amp comparator is very sensitive to
the voltage changes on its inputs, the output can switch uncontrollably
between its positive, +V(sat) and negative, -V(sat) supply rails whenever
the input voltage being measured is near to the reference voltage, VREF.
To eliminate any erratic or uncontrolled switching operations, the op-amp
used in the multivibrator circuit is configured as a closed-loop Schmitt
Trigger circuit. Consider the circuit below.
The op-amp comparator circuit above is configured as a Schmitt trigger that
uses positive feedback provided by resistors R1 and R2 to generate
hysteresis. As this resistive network is connected between the amplifiers
output and non-inverting (+) input, when Vout is saturated at the positive
supply rail, a positive voltage is applied to the op-amps non-inverting input.
Likewise, when Vout is saturated to the negative supply rail, a negative
voltage is applied to the op-amps non-inverting input.
As the two resistors are configured across the op-amps output as a voltage
divider network, the reference voltage, Vref will therefore be dependant
upon the fraction of output voltage fed back to the non-inverting input. This
feedback fraction, β is given as:
Where +V(sat) is the positive op-amp DC saturation voltage and -V(sat) is
the negative op-amp DC saturation voltage.
Then we can see that the positive or upper reference voltage, +Vref (i.e.
the maximum positive value for the voltage at the inverting input) is given
as: +Vref = +V(sat)β while the negative or lower reference voltage (i.e. the
maximum negative value for the voltage at the inverting input) is given as: -
Vref = -V(sat)β.
So if Vin exceeds +Vref, the op-amp switches state and the output voltage
drops to its negative DC saturation voltage. Likewise when the input
voltage falls below -Vref, the op-amp switches state once again and the
output voltage will switch from the negative saturation voltage back to the
positive DC saturation voltage. The amount of built-in hysteresis given by
the Schmitt comparator as it switches between the two saturation voltages
is defined by the difference between the two trigger reference voltages
as: VHYSTERESIS = +Vref – (-Vref).
As the input waveform will be periodical and have an amplitude sufficiently
greater than its reference voltage, Vref, the output rectangular waveform
will always have the same period, T and therefore frequency, ƒ as the input
waveform.
By replacing either resistor R1 or R2 with a potentiometer we could adjust
the feedback fraction, β and therefore the reference voltage value at the
non-inverting input to cause the op-amp to change state anywhere from
zero to 90o of each half cycle so long as the reference
voltage, Vref remained below the maximum amplitude of the input signal.
Op-amp Multivibrator
We can take this idea of converting a periodic waveform into a rectangular
output one step further by replacing the sinusoidal input with an RC timing
circuit connected across the op-amps output. This time, instead of a
sinusoidal waveform being used to trigger the op-amp, we can use the
capacitors charging voltage, Vc to change the output state of the op-amp
as shown.
Where: R is Resistance, C is Capacitance, ln( ) is the Natural Logarithm of
the feedback fraction, T is periodic time in seconds, and ƒ is oscillation
Frequency in Hz.
Then we can see from the above equation that the frequency of oscillation
for an Op-amp Multivibrator circuit not only depends upon the RC time
constant but also upon the feedback fraction. However, if we used resistor
values that gave a feedback fraction of 0.462, (β = 0.462), then the
frequency of oscillation of the circuit would be equal to just 1/2RC as shown
because the linear log term becomes equal to one.
Then the frequency of oscillation is calculated as 1kHz. When β = 0.462,
this frequency can be calculated directly as: ƒ = 1/2RC. Also when the two
feedback resistors are the same, that is R1 = R2, the feedback fraction is
equal to 3 and the frequency of oscillation becomes: ƒ = 1/2.2RC.
We can take this op-amp multivibrator circuit one step further by replacing
one of the feedback resistors with a potentiometer to produce a variable
frequency op-amp multivibrator as shown.
By adjusting the central potentiometer between β1 and β2 the output
frequency will change by the following amounts.
Potentiometer wiper at β1