Pros and cons of using an op-amp as a comparator
In this video we will discuss several extra features that are integrated into some comparators to help simplify your designs. We’ll move on to discussing the use of op amps as comparators, and the pros and cons of doing this. We will finish this video series on comparators by pointing to some useful TI Precision Designs built with comparators.
Resources
Hello and welcome to the TI Precision Labs video discussing comparator applications, part four. In this video, we will discuss several extra features that are integrated into some comparators to help simplify your designs. We'll move on to discussing the use of op amps as comparators and the pros and cons of doing this. We will finish this video series on comparators by pointing to some useful TI precision designs built with comparators.
One example of an extra feature integrated into some comparators is an internal voltage reference included in devices such as a TLV3011 and TLV3012. In these comparators, the internal 1.242 volt precision voltage reference can be very helpful when your applications require you to compare a voltage on one input to a fixed reference voltage level. In the example shown here, a voltage divider is used to adjust the reference voltage to one volt. The equations on the right show how to calculate the values of the divider resistors in order to achieve your desired effective V ref.
Note that using the internal reference voltage to generate V ref will generally be much more accurate than using the power supply. The TLV2302 and TLV2702 micropower comparators contain both a comparator and a rail-to-rail input and output op amp in the same package. The TLV2302 is an open-drain comparator, while the TLV2702 is a push-pull output comparator. For now, note that it is best to avoid trying to use an op amp as a comparator, so these devices are convenient if your application requires both a comparator and an op amp and minimizing printed circuit board space is critical. Also note that these devices have a wide power supply voltage range of 2.5 volts to 16 volts, can accept input common mode voltages up to five volts above the positive supply, and include reverse battery protection up to 18 volts.
The TL3016 ultrafast push-pull comparator is abundant with additional features. First, it offers complimentary outputs, meaning that an inverted version of the typical comparator output is also available. This can be very useful in applications where complimentary signals are needed.
This comparator also features a latch-enable, or LE, function. When the LE pin is biased between zero volts and 0.8 volts, the TL3016 will operate as a comparator. However, when the LE pin is biased to two volts or greater, the outputs latch and hold their current states until unlatched. The outputs will not change while the latch is active, even if the inputs to the comparator change.
The simulation waveforms on the right show the operation of this device. From time zero to 50 nanoseconds, the latch function is disabled, and the comparator operates normally. You can also observe the complimentary outputs Q and QB in this region. At time equal to 50 nanoseconds, the latch pin is set high and the latching function is enabled. From this point on, the outputs hold state, even as the input signal continues to change.
A common topic when discussing comparators is the use of op amps as comparators. There are both advantages and disadvantages to doing this, which we'll now discuss. Let's discuss the advantages first.
Perhaps the most common reason engineers wish to use op amps as comparators is because of the potential savings to both component cost and printed circuit board area. If a dual or quad package op amp is already used elsewhere in the system and some channels are left available, it may be more efficient to assign any remaining channels for comparator functions. Furthermore, most amplifiers offer better DC precision than comparators. A lower offset voltage, for example, can improve the accuracy of the comparator's trip point, as we discussed in part one of this video series. Finally, the rate of change of an op amp's output is limited by its slew rate, which may be advantageous if electromagnetic interference, or EMI, generated by the fast transition of comparators is a problem.
Let's now go over the disadvantages to using op amps as comparators. First, the power consumption of most op amps will be higher than the equivalent comparators. Also, the allowable differential input voltage may be limited by the presence of input clamping diodes, depending on the op amp topology. And many non-rail-to-rail op amps will have issues when operated beyond the allowable input common mode voltage range. Perhaps most importantly, an op amp's recovery time from saturation may not be characterized and can range from hundreds of nanoseconds all the way up to milliseconds, severely impacting the circuit's timing behavior.
Furthermore, the rise and fall time of an op amp is limited by the slew rate and will generally be much slower than a comparator. Finally, there is no op amp equivalent of an open-drain or open-collector comparator. All op amps actively source or stay current to create the required voltage at the load. In general, op amps are not intended to be operated in saturation, which is precisely what comparators are designed to do and excel at.
One of the biggest challenges to using an op amp as a comparator is dealing with the op amp's differential input voltage limits. Many op amps, especially bipolar input op amps, have anti-parallel input diodes, also called back-to-back input diodes, across input pins n plus and n minus. The purpose of these diodes is to protect the base-to-emitter junctions of the input transistors from entering reverse breakdown when large differential input voltages are present. Once broken down, the transistor's performance severely degrades, causing permanent changes to the op amp's offset voltage, input bias current, and noise characteristics.
This permanent degradation should be avoided, so the input clamps keep the differential input voltage limited to a safe level. If the limit is exceeded, one of the clamp diodes becomes forward biased and conducts current across the input pins and away from the input transistors. Some popular TI bipolar op amps with input clamps are the OPA209, OPA211, OPA227, and OPA1611. Since comparators normally have large differential voltages applied to their inputs, bipolar op amps in general are poorly suited to be used as comparators.
Here are some general guidelines about the presence or non-presence of input clamps relative to the semiconductor process types other than bipolar. Most high voltage CMOS amplifiers, such as the OPA171 and OPA172 do have input clamps. Most low voltage CMOS amplifiers, such as the OPA325 and OPA350, do not have input clamps. JFET amplifiers, including the OPA140 and OPA1641, do not have the clamp diodes.
Finally, chopper amplifiers do have parasitic input diodes that behave the same as the typical input clamp structure. Examples of this are the OPA333 and OPA188. Of course, there are exceptions to every rule, so use these guidelines as a starting point only.
Speaking of exceptions, let me show you some examples of bipolar amplifier designs without anti-parallel input diodes that can sustain high differential input voltages. These bipolar amplifiers are built with lateral PNP transistors, which have a reverse breakdown voltage of about 18 volts-- much higher than the typical NPN input transistors with the reverse breakdown voltages from two volts to seven volts. Some part numbers using these designs are the legendary UA741, as well as the LM358, OPA234, OPA244, and OPA2251.
Here's some more exceptions to the rules. While most high voltage CMOS amplifiers do have input clamps, some of our newest amplifiers of this type, such as the OPA192 and OPA197, have a patented, front-end design that does not require the clamps. Therefore, these op amps can also be configured as high performance comparators with a differential input range as large as the power supply voltage.
Both products have specs well-suited for comparator applications, with rail-to-rail input and output, very low offset, high bandwidth and slew rate, and fast overload recovery time of only 200 nanoseconds. In general, you can see whether or not an op amp can sustain large differential input voltages by reading the absolute maximum table in the amplifier datasheet. You should be cognizant of what the differential input limitations are before considering using an op amp as a comparator.
Several TI precision designs have been created specifically for comparator applications. TIPD106 details how to use a comparator for AC coupled applications over a bandwidth range of two kilohertz to 32 megahertz. TIPD130 shows how to connect a bipolar high voltage input to a single supply, low voltage comparator. TIPD141 describes how to configure an amplifier for hysteresis, a topic discussed in part two of this video series. Finally, TIPD178 details the design procedure for a window comparator, whose functionality is shown on the right hand of this slide.
Here we show a little more detail on TIPD130, which provides a method for interfacing a low voltage, single supply competitor with a high voltage, bipolar input. In this case, we use the term "bipolar" to mean a signal which swings both positive and negative. The bipolar input signals are plus or minus 15 volt peak sine waves, which if connected directly to the plus 3.3 volt single supply comparator would greatly exceed both the input common mode range and the absolute maximum input range of the device. Using a divider network made up of three resistors, the input signals are transformed to plus or minus 1.24 volts peak sine waves, centered about a plus 1.24 volt DC reference level. Now the two phase-differing input sine waves can be compared, with the TLV3201 setting the appropriate output level of zero volts or 2.3 volts.
Based on this schematic, can you tell if the TLV3201 is an open-drain or open-collector comparator or a push-pull comparator? Since there is no pull up resistor on the comparator output, it must be a push-pull output device which actively drives the output pin high or low.
That concludes this video series on comparators. Thank you for watching. Please try the quiz to check your understanding of this video's content.
This video is part of a series
-
Precision labs series: Comparators
video-playlist (5 videos)