Op Amp Comparator Circuit

- it is possible to use an op amp as a comparator although operational amplifiers are not intended for this use, with care they can perform tolerably well.

Comparator circuits find a number of applications in electronics.

Effectively a comparator compares two voltages and switches its output accordingly.

Comparators are used in many areas of electronics where levels need to be detected and in many cases op-amps used as comparators can be seen in many circuits.

What is a comparator?

As the name implies they are used to compare two voltages. When one is higher than the other the comparator circuit output is in one state, and when the input conditions are reversed, then the comparator output switches.

These circuits find many uses as detectors. They are often used to sense voltages. For example they could have a reference voltage on one input, and a voltage that is being detected on another. While the detected voltage is above the reference the output of the comparator will be in one state. If the detected voltage falls below the reference then it will change the state of the comparator, and this could be used to flag the condition. This is but one example of many for which comparators can be used.

In operation the op amp goes into positive or negative saturation dependent upon the input voltages. As the gain of the operational amplifier will generally exceed 100 000 the output will run into saturation when the inputs are only fractions of a millivolt apart.

Op amp vs comparator

There are many ICs that are specifically intended as comparators. These are very similar in many respects to op amps. Not only is the circuit symbol the same, but many of the internal circuits appear very similar. However their performance is very different.

  • Open and closed loop operation:   The comparator is optimised for open loop operation whereas the op amp is intended for closed loop operation with negative feedback. The operation of an op amp is not guaranteed for open loop operation.
  • Digital vs analogue operation:   The comparator is intended for operation in one of two states, high and low, whereas the op amp is intended for analogue operation between the voltage power two rails. The transistors in a comparator are designed for digital operation, whereas the op amp is intended for analogue operation.
  • Output stages:   The output stages of comparators and operational amplifiers are very different. The op amp is optimised for linear operation within the rail voltages, whereas the comparator is optimised for operation at high and low states. Often a comparator will have an open collector output.

    Comparison of the op amp and comparator output circuitry showing the open collector output of a comparator chip
    Comparison of op amp and comparator output circuitry
  • Response time:   One characteristic often required for a comparator circuit is a fast response time. The transistors used in op amps are not developed to provide switching, instead they are designed for analogue performance. As a result they will not provide the fast switching performance of a comparator.
  • Latch-up:   On some occasions it has been known for the output of an op amp to latch up when driven hard into the rail. Comparators are designed to operate in this mode and should not ever latch up.

In view of these reasons it is always best to use a comparator chip, rather than an operational amplifier for comparator applications.Nevertheless there are occasions where it is more convenient to use an op amp, or one may already be in use in a circuit. Under these circumstances, the circuit should be used or designed with care, not expecting the optimum performance.

However the overall circuit configuration and concept of operation are exactly the same whether an op amp or a special comparator chip is used. The main difference may be that an open collector output may be present on the comparator.

Comparator circuit

Although op amps are widely used as comparator, special comparator chips are often used. These integrated circuits offer very fast switching times, well above those offered by most op-amps that are intended for more linear applications. Typical slew rates are in the region of several thousand volts per microsecond, although more often figures of propagation delay are quoted.

A typical comparator circuit will have one of the inputs held at a given voltage. This may often be a potential divider from a supply or reference source. The other input is taken to the point to be sensed.


Circuit for a basic operational amplifier comparator

Within this circuit the resistors R1 and R2 form a potential divider between the two voltage rails. The voltage at the junction of the two resistors is the switching voltage for the circuit.

Op amp comparator notes

There are a number of points to remember when using comparator circuits.

  • Ensure differential input not exceeded:   As there is no feedback the two inputs to the circuit will be at different voltages. Accordingly it is necessary to ensure that the maximum differential input is not exceeded.
  • Input current change:   Again as a result of the lack of feedback the load will change. Particularly as the circuit changes there will be a small increase in the input current. For most circuits this will not be a problem, but if the source impedance is high it may lead to a few unusual responses.
  • Input signal noise:   The main problem with this circuit is that new the changeover point, even small amounts of noise will cause the output to switch back and forth. Thus near the changeover point there may be several transitions at the output and this may give rise to problems elsewhere in the overall circuit. The solution to this is to use a Schmitt Trigger as described on another page.

Use of a comparator chip

When there is a need for a comparator circuit, it is always best to opt for a specific comparator chip as the basis of the circuit.

Comparator chips are much better at handling switching between two values and may often have output stages that can more easily interface with logic than analogue operational amplifiers.

In terms of the basic circuit operation, the main difference is that most comparators have an open collector output and require an external pull-up resistor or other circuity.

As they employ this form of output, it means that it is very easy for them to interface with logic circuitry.

By Ian Poole


    << Previous     |     Next >>


Want more like this? Register for our newsletter









Whitepapers
Redefining LTE for IoT
ARM and NextG-Com explain how LTE with its high data rates, complexity and capacity can be used to provide effective communications for IoT with its lower complexity and data rate requirements.

More whitepapers

Training
Modern Digital Radio Techniques (RF6-1114)
Obtain a thorough grounding digital radio techniques that form the basis of much of today's wireless communications.

More training courses

From Machine to Machine to the Internet of Things
From Machine to Machine to the Internet of Things

Vlasios Tsiatsis, Ioannis Fikouras, Stefan Avesand, Stamatis Karnouskos, Catherine Mulligan, David Boyle, Jan Holler
Machine to machine communications is set to grow at a very fast rate. New...
Read more . .

USA bookstore UK bookstore









Radio-Electronics.com is operated and owned by Adrio Communications Ltd and edited by Ian Poole. All information is © Adrio Communications Ltd and may not be copied except for individual personal use. This includes copying material in whatever form into website pages. While every effort is made to ensure the accuracy of the information on Radio-Electronics.com, no liability is accepted for any consequences of using it. This site uses cookies. By using this site, these terms including the use of cookies are accepted. More explanation can be found in our Privacy Policy