We are Apogeeweb Semiconductor Electronic

WELCOME TO OUR BLOG

Home arrow Semiconductor Information arrow What is a Comparator in Electronics?

arrow left

arrow right

What is a Comparator in Electronics?

Author: Apogeeweb Date: 9 Mar 2021  711

comparator op amp

Introduction

In electronics, a comparator is an electronic circuit that compares two voltages (or currents) and outputs a digital signal indicating which is larger. Comparing two or more data to determine the number size and arrangement order between them. In addition, it is a circuit that compares an analog voltage signal with a reference voltage. The two inputs of the comparator are analog signals, and the output is a binary signal 0 or 1, and the output is ideally. When the difference of the input voltage changes and the positive and negative sign remains constant, the output remains unchanged. Comparators play an essential role in designing electrical and electronic projects.

What is A Comparator?

Catalog

Introduction

Ⅰ Working Principle

Ⅱ Main Parameters

2.1 Hysteresis Voltage

2.2 Bias Current

2.3 Super Power Swing

2.4 Drain-source Voltage

2.5 Output Delay Time

Ⅲ Comparator Classification

3.1 Voltage Comparator

3.2 Window Comparator

3.3 Hysteresis Comparator

Ⅳ Comparator ICs

Ⅴ How Do You Select a Comparator?

Ⅵ Comparator Applications

6.1 Zero-crossing Comparator 

6.2 Relaxation Oscillator (ROSC)

6.3 A/D Converter

6.4 Voltage Comparator

Ⅶ Op Amp Comparator


Ⅰ Working Principle

Generally, in electronics, the comparator is used to compare two voltages or currents which are given at the two inputs of the comparator. A comparator circuit compares two voltages and outputs either a 1 (the voltage at the plus side; VDD in the illustration) or a 0 (the voltage at the negative side) to indicate which is larger. The operational amplifier can be used as a comparator theoretically without negative feedback. However, the open-loop gain of the operational amplifier is very high, so it can only process signals with a very small input differential voltage. Moreover, in general, the delay time of the op amp is long, which cannot meet the actual requirements. The comparator can be adjusted to provide a very small time delay, but its frequency response characteristics will be limited. To avoid output oscillation, many comparators also have internal hysteresis circuits. The threshold of the comparator is fixed, some have only one threshold, and some have two thresholds.

comparator symbol

Comparator Symbol

Ⅱ Main Parameters

2.1 Hysteresis Voltage

The voltage between the two input terminals of the comparator will change the output state when it crosses zero. Because the input terminal is often superimposed with a small voltage fluctuation, the differential mode voltage generated by it will cause the comparator output to change frequently.  In order to avoid output oscillation, the new comparator usually has a hysteresis voltage of several mV. The existence of it requires two switching points of the comparator: one is used to detect the rising voltage, the other is used to detect the falling voltage. The difference of the voltage threshold (VTRIP) is equal to the voltage hysteresis (VHYST). The offset voltage of hysteresis comparator is the average of TRIP and VTRIP-. The input voltage switching point of the comparator without hysteresis is the input offset voltage, not the zero of the ideal comparator. In addition, the offset voltage generally varies with temperature and power supply voltage. And the power supply rejection ratio is usually employed to express the influence of power supply voltage changes on the offset voltage.

2.2 Bias Current

The input impedance of an ideal comparator is infinite. Therefore, there is no effect on the input signal theoretically. However, the actual input impedance of the comparator cannot be infinite. There is a current at the input end that flows through the internal resistance of the signal source and flows into the comparator, thereby generating an additional voltage difference. The bias current (Ibias) is defined as the median of the input currents of the two comparators and is used to measure the effect of input impedance.

2.3 Super Power Swing

To further optimize the operating voltage range of the comparator, Maxim uses the parallel structure of the NPN tube and the PNP tube as the input stage of the comparator. Thus the input voltage of the comparator can be expanded. In this case, the lower limit can be lower to the lowest level, and the upper limit is 250mV higher than the power supply voltage to reach the Beyond-the-Rail standard. The input of this comparator allows a larger common-mode voltage.

2.4 Drain-source Voltage

The comparator has only two different output states (zero level or power supply voltage). Its output stage of the comparator with full power swing characteristics is an emitter follower, which makes its voltage difference smaller between input and output signals. The voltage difference depends on the emitter junction voltage under the saturation state of the internal transistor of the comparator, which is equal to the drain-source voltage of the MOSFFET.

2.5 Output Delay Time

It includes the transmission delay of the signal through the components and the rise time and fall time of the signal. For high-speed comparators, such as MAX961, the typical value of the delay time can reach 4.5ns and the rise time is 2.3ns. Pay attention to the influence of different factors on the delay time when designing, including the influence of temperature, capacitive load, input overdrive and so on.
Although the comparator has different types. The design and construction of each should take care of ordinary uses without affecting its measuring accuracy. The instrument should be very sensitive and withstand a reasonable ill usage without permanent harm.

high gain comparator

Ⅲ Comparator Classification

Comparators are classified into various kinds, such as electronic, electrical, mechanical, optical, sigma, digital and pneumatic comparators. These are used in various applications. Here we are talking about electronic comparator.

3.1 Voltage Comparator

A voltage comparator is a circuit that discriminates and compares input signals, and is a basic unit that forms a non-sine wave generating circuit. Voltage comparators are commonly used including single-limit comparators, hysteresis comparators, window comparators, and three-state voltage comparators. Voltage comparator can be used as an interface between analog circuits and digital circuits, as well as waveform generation and conversion circuits.

3.2 Window Comparator

Combine two comparators to form a "window comparator", which is widely used. The window comparator can set the upper limit voltage and lower limit voltage of the input at the same time, within limited voltage range, or outside the range, which we need. When the potential level of the high-level signal is higher than a certain specified value VH, it is equivalent to the positive saturation output of the comparator circuit. When the potential level of the low-level signal is lower than a certain specified value VL, it is equivalent to the negative saturation output of the comparator circuit. The comparator has two thresholds, and the transmission characteristic curve is window-shaped, so it is called a window comparator.

3.3 Hysteresis Comparator

It is a comparator with hysteresis loop transmission characteristics, and can be understood as a single-limit comparator with positive feedback. When the input voltage vI gradually increases from zero and VI is less than VT, the comparator output is a positive saturation voltage, and VT is called the upper threshold (trigger) level. When the input voltage VI>VT, the comparator output is a negative saturation voltage, and VT is called the lower threshold (trigger) level.

analog voltage comparator circuit

Ⅳ Comparator ICs

Common chips are LM324, LM358, uA741, TL081\2\3\4, OP07, OP27, which can all be made into voltage comparators (without negative feedback). LM339 and LM393 are professional voltage comparators with fast switching speed and small delay time, which can be used in special voltage comparison occasions.

 

Ⅴ How Do You Select a Comparator?

The working principle of a comparator is simple and straightforward. It has a positive pin and a negative pin. When the voltage on the positive pin is high, the output drives a signal. When using open-collector output, the output pin of the comparator is the collector of a transistor or the drain of a FET. When using push-pull output, the comparator has a complementary NPN/PNP stage, like in an operational amplifier. The open-collector output is used when the load and the comparator use different power supplies. This kind of scheme can realize the solenoid of 12V, although the comparator may only work at 3.3V. Another function of the open-collector output is to minimize the quiescent current when the output is turned off. Among them, no base current flows in the N-type output transistor, and some base current always flows through one of the two output transistors.
However, open-collector output also has some disadvantages. For example, they require external pull-up resistors. These resistors must complete the pull-up task during the high-impedance period, so that when the output is lower than turn-off, the comparator can switch faster, and the pull-up resistor makes the output high. Therefore, when you need a symmetrical waveform, it is not suitable to use an open collector output, such as a clock recovery circuit. If your circuit does not require level conversion, you should choose push-pull output, such as ALD2321APC, it can provide 24mA output drive capacity, quiescent current is 90μA.

The high-speed comparator may also have a latched output, so that the output can be kept in a known state to meet the set-up and hold time requirements of the digital input behind it. Once the digital part has read the output of the comparator, the latch pin can be released and the output can track the input.
High-speed comparators may also use ECL (emitter coupled logic) levels from -5V to 0V. PECL (positive emitter coupled logic) outputs have the same voltage swing, from 0V to 5V. There is also RSPECL (reduced amplitude PECL) output. The two output pins of some high-speed comparators use LVDS (low-voltage differential signaling) output, which converts 300mV around a 1.2V common-mode voltage in a complementary manner. You can send these outputs directly to the LVDS input pins of FPGA (field programmable gate array) and other digital circuits.
In production, CMOS technology is generally used to build low-power devices, while bipolar devices are used to build high-speed devices. This represents a basic compromise: high-power high-speed, accurate devices, and low-power, low-speed devices. Another compromise is gain and high speed. The low-power comparator may take 70µs conversion time and consume less power. The response time of the high-speed comparator is 150ps. Some devices can overcome the trade-off between speed and power consumption. When converting at the highest rate, the power consumed by the comparator is much higher than its static power consumption. In the static state, the current is low. When the comparator is operated at a higher speed, it must be able to charge the capacitor. In dynamic mode, the current increases as the working speed increases. Another factor in power consumption is the load on the chip. For a switching current, the capacitance will also become a load, and the capacitive and resistive components in the load must be considered. Many devices are related to broken pins, which can reduce the power consumption to less than 1µA.
As with all simulation, the declared propagation delay is meaningful only under strictly defined conditions, because the degree to which the input pin is driven directly affects the propagation delay. The greater the overdrive, the faster the device. Dispersion is the range of propagation delay values of a device under various overdrive levels. The relationship between overdrive and speed is one reason why some engineers are reluctant to consider comparator speed as a function of slew rate. It necessary to define the output level that is quantized as a valid transition, usually the maximum output level is 10% to 90%. The slew rate also represents a requirement for overdrive, that is, to keep the propagation delay as short as possible.

Another parameter to consider when choosing a comparator is noise. However, manufacturers often omit noise specifications of the comparators and instead use random jitter to measure noise. In addition to the noise signal passing through the device gain, the input aperture error and the output rise and fall time can also affect jitter. A clock-driven device is nothing but a lower gain comparator optimized for noise. Designers can use larger input transistors in a CMOS device to reduce flicker noise, but this method increases the input capacitance.
The next consideration should be the rated voltage of the comparator. One factor related to the power supply interval is the allowable common-mode voltage at the input pins of the comparator. Some devices allow you to pull the output to a voltage range higher or lower than the power supply. For other devices, when you pull the input pin below the negative power rail, the output will be inverted. Comparator with rail-to-rail input stage expands the range of input common-mode mode. These devices have a dual-input stage, using N-type transistors or FETs in parallel with the P-type input stage. The input voltage of the P-type input stage operates at near the ground or the negative voltage rail, and the N-type input stage works when the input swings to the positive voltage rail. IC designers generally make the device switch between level 1 or 2V below the positive voltage rail. When sweeping over the rail-to-rail devices, some structures can minimize the offset voltage.

Another important specification of the comparator is the input offset current, that is, the amount of current flowing into or out of the input pin when the device is working. CMOS products have a low offset current, which represents a mismatch in the leakage of the input pin ESD (electrostatic discharge) structure. For every 10°C increase in temperature, the input offset current doubles. The offset current of high-speed comparators can be obvious, but it is not a problem because low-impedance circuits are generally used to drive these high-speed comparators. The input offset current of a bipolar device depends on the relationship between the two inputs. In a comparator, a 60mV difference in the base voltage of a differential input pair will get a 10 times higher difference between the pair's collector current and the input offset current. Therefore, one pin can pull or sink twice the rated input offset current, while the other pins have almost no input offset current, depending on which pin has a higher voltage.

LM393 voltage comparator module

Ⅵ Comparator Applications

6.1 Zero-crossing Comparator 

The zero-crossing comparator is used to detect whether an input value is zero. The principle is using a comparator to compare two input voltages. One of the two input voltages is the reference voltage Vr and the other is the voltage to be measured Vu. Generally, Vr is connected from the non-inverting input terminal, and Vu is connected from the inverting input terminal. According to the result of comparing the input voltage, the forward or reverse saturation voltage is output. When the reference voltage is known, the measured result of the voltage can be obtained. When the reference voltage is zero, it is a zero-crossing comparator.
The zero-crossing comparator has a small measurement error. When the product of the voltage difference between the two input terminals and the open-loop magnification is less than the output threshold, the detector will give a zero value. For example, when the open-loop magnification is 106 and the output threshold is 6v, if the voltage difference between the two input stages is less than 6 microvolts, the detector outputs zero. This can also be considered the uncertainty of measurement.

6.2 Relaxation Oscillator (ROSC)

Comparators can construct relaxation oscillators by using positive feedback and negative feedback. Positive feedback is a Schmitt trigger, which forms a multivibrator. The RC circuit adds negative feedback to it, which causes the circuit to start to oscillate spontaneously, making the entire circuit from a latch to a relaxation oscillator.
Level shifting uses open-drain comparators (such as LM393, TLV3011, and MAX9028) to construct a level shifter to change the signal voltage. Choosing an appropriate pull-up voltage can flexibly get the converted voltage value. For example, use the MAX972 comparator to convert ±5V signals into 3V signals.

6.3 A/D Converter

The function of the comparator is to compare whether an input signal is higher than a given value. So it can convert the input analog signal into a binary digital signal. Almost all digital-to-analog converters (including delta-sigma modulation) contain comparators circuit to quantize the input analog signal.

6.4 Voltage Comparator

The voltage comparator can be regarded as an operational amplifier with an infinite amplification factor. The function of the voltage comparator: compare the magnitude of two voltages (using the high or low level of the output voltage to indicate the magnitude relationship between the two input voltages): When the voltage at the "+" input terminal is higher than the "-" input terminal, the voltage comparator output is high level; when the "+" input terminal voltage is lower than the "-" input terminal, the voltage comparator output is low level.
It can be used as an interface between analog circuits and digital circuits, and can also be used as a waveform generation and conversion circuit. A simple voltage comparator can change the sine wave into a square wave or rectangular wave with the same frequency. The simple voltage comparator has a simple structure and high sensitivity, but its anti-interference ability is poor, so people have to improve it. The improved voltage comparators include: hysteresis comparator and window comparator. Operational amplifiers are used to determine "operational parameters" through feedback loops and input loops, such as magnification. The feedback amount can be part or all of the output current or voltage. The comparator does not need feedback and directly compares the quantity of the two input terminals. If the non-inverting input is greater than the inverted phase, the output is high, otherwise it outputs low. The input of the voltage comparator is a linear quantity, and the output is a switch (high and low level). In typical applications, a linear op amp can sometimes be used to form a voltage comparator without negative feedback.

 

Ⅶ Op Amp Comparator

In principle, operational amplifier can be used as comparator without negative feedback. However, because of its high open-loop gain, it can only process signals with very small input differential voltage. Moreover, in this case, the response time of the operational amplifier is much slower than that of the comparator, and it also lacks some special functions, such as hysteresis, internal reference and so on. Comparator usually can not be used as an operational amplifier. Comparator can provide minimal time delay after adjustment, but its frequency response characteristics are limited to some extent. Operational amplifier makes use of the advantage of frequency response correction to become a flexible and versatile device. In addition, many comparators also have internal hysteresis circuit, which can avoid output oscillation, but it can not be used as an op amp.

 

Frequently Asked Questions about Comparator Electronics

1. What is a comparator and its application?
A comparator is an electronic component that compares two input voltages. Comparators are closely related to operational amplifiers, but a comparator is designed to operate with positive feedback and with its output saturated at one power rail or the other.

 

2. How does a comparator circuit work?
The comparator circuit work by simply taking two analog input signals, comparing them and then produce the logical output high “1” or low “0“. ... When the analog input on non-inverting is less than the analog input on inverting input, then the comparator output will swing to the logical low.

 

3. What is the purpose of a comparator in op amp?
Op-amp window comparators are a type of voltage comparator circuit which uses two op-amp comparators to produce a two-state output that indicates whether or not the input voltage is within a particular range or window of values by using two reference voltages. An upper reference voltage and a lower reference voltage.

 

4. How do you use comparator electronics?
A comparator circuit compares two voltages and outputs either a 1 (the voltage at the plus side; VDD in the illustration) or a 0 (the voltage at the negative side) to indicate which is larger. Comparators are often used, for example, to check whether an input has reached some predetermined value.

 

5. What is comparator and its types?
Comparators are classified into various kinds, such as electronic, electrical, mechanical, optical, sigma, digital and pneumatic comparators, these are used in various applications. Comparators play an essential role in designing electrical and electronic projects.

Ordering & Quality

Photo Mfr. Part # Company Description Package PDF Qty Pricing
(USD)
MMSZ4699T1G MMSZ4699T1G Company:ON Semiconductor Remark:Zener Diodes 12V 500mW Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $0.21000
10+: $0.18300
100+: $0.06300
1000+: $0.04400
3000+: $0.03400
9000+: $0.02900
24000+: $0.02700
45000+: $0.02300
99000+: $0.02100
Inquiry
STW4N150 STW4N150 Company:STMicroelectronics Remark:MOSFET N-channel 1500 V PowerMesh Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $6.62000
10+: $5.70000
100+: $4.73000
250+: $4.45000
500+: $4.17000
1000+: $3.75000
2500+: $3.61000
Inquiry
NRVBS3200T3G Company:ON Semiconductor Remark:Schottky Diodes & Rectifiers 3A, 200V SCHOTTKY RECT. Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $1.08000
10+: $0.92300
100+: $0.69200
250+: $0.67200
500+: $0.58700
1000+: $0.47800
2500+: $0.46400
5000+: $0.42800
10000+: $0.40900
Inquiry
2N5551 Company:Central Semiconductor Remark:Bipolar Transistors - BJT NPN Gen Pur SS Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $0.83000
10+: $0.68100
100+: $0.56700
500+: $0.43800
1000+: $0.39500
2500+: $0.35100
10000+: $0.33700
25000+: $0.32700
Inquiry
6A10-T Company:Diodes Incorporated Remark:Rectifiers 1000V 6A Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $0.42000
10+: $0.34300
100+: $0.21000
500+: $0.21000
1000+: $0.16200
2500+: $0.13800
Inquiry
STPS1545D STPS1545D Company:STMicroelectronics Remark:Schottky Diodes & Rectifiers 15 Amp 45 Volt Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $0.90000
10+: $0.76600
100+: $0.57500
250+: $0.55700
500+: $0.48700
1000+: $0.39700
2000+: $0.38500
5000+: $0.35600
10000+: $0.33900
Inquiry
ULN2003ADR ULN2003ADR Company:Texas Instruments Remark:Darlington Transistors Darlington Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $0.57000
10+: $0.45500
100+: $0.32200
500+: $0.26400
1000+: $0.21500
2500+: $0.20200
5000+: $0.18200
10000+: $0.16900
25000+: $0.16600
Inquiry
MMSZ4684T1G MMSZ4684T1G Company:ON Semiconductor Remark:Zener Diodes 3.3V 500mW Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $0.21000
10+: $0.18300
100+: $0.06300
1000+: $0.04400
3000+: $0.03400
9000+: $0.02900
24000+: $0.02700
45000+: $0.02300
99000+: $0.02100
Inquiry

Related Articles

Analog to Digital Converters (ADC) Overview: Working, Types and Applications

Apogeeweb 19 Jan 2021  1051

Ⅰ IntroductionIn an analog world, surrounded by digital devices, we exist. In nature, everything we see, feel or measure is identical, such as light, temperature, speed, pressure, etc. But most o...

Continue reading »

Blood Oxygen Measurement on Smartwatches: Is it Reliable?

Apogeeweb 21 Nov 2020  968

IntroductionIn September of this year, Apple's new generation of watch Apple watch series 6 launched the blood oxygen measurement function. In the following month or two, smart watches with blood oxyg...

Continue reading »

Iris Recognition Technology:Principle and Application

Apogeeweb 5 Nov 2018  2869

Warm hints: The word in this article is about 3000 words and reading time is about 15 minutes. SummaryBiometric recognition is the most convenient and safe identification technology at present. It do...

Continue reading »

What is the Difference Between MOSFET and IGBT

Apogeeweb 9 Feb 2018  9575

SummaryThis article is mainly about the differences between MOSFET and IGBT, including their respective advantage and disadvantage and structure difference, how to choose MOSFET or IGBT etc.. In addit...

Continue reading »

What will ON Semiconductor focus on in 2021?

Apogeeweb 7 Jan 2021  407

CatalogⅠ IntroductionⅡ The Layout of the Car MarketⅢ The Layout in the Industrial FieldⅣ The Layout on the Internet of ThingsⅤ ConclusionⅠ IntroductionON Semiconductor: In 2021, it will focus on the a...

Continue reading »

Microcontroller Applications and Its Principle

Apogeeweb 17 Jan 2018  8750

Warm hints: The word in this article is about 3200 and reading time is about 20 minutes. SummaryA microcontroller is a single chip microcomputer that integrates the main parts of a microcomputer on a...

Continue reading »

pinglun 3 comments

    • pingluntus
    • RachelYe on 2021/6/7 15:33:28

    I am trying to using LM741 to compare two voltages, and essentially then use this as a thermostat. Once V+ > V-. the output voltage is 1.3 -1.6 v, but not 0 volts. Do I need to add offset? I am only using the 5 pins atm.

      • pingluntu
      • author on 2021/6/8 11:40:02
        author

      Re:

      Hi,
      My recommendation: If you want a comparator, then use a comparator.
      There's a good reason why they designed comparators as well as amplifiers.

    • pingluntus
    • Mason on 2021/6/11 10:20:22

    I'm working on a circuit that has a PWM input signal and my goal is to control a 24V relay coil. So when the filtered voltage on the PWM drops below 18V (Vref) I want to energize the coil. But the issue is when I add the coil in the ouput of U1 remains hi. Also I'm not familiar with the strobe and offset signal, so I left them open, what are those really used for?

      • pingluntu
      • author on 2021/6/15 9:43:26
        author

      Re:

      Hi, 😊

      The LT1011 comparator has a maximum allowed output current of 50mA so with your 24V supply the circuit has a minimum relay coil resistance of 24V/50mA= 480 ohms when its output voltage will be a maximum of 2.5V.
      And you do not need to buffer it with a transistor. The comparator has a maximum allowed output current of 50mA and the 1440 ohm relay coil draws a little less than only 24/1440= 16.7mA.
      The 1uF capacitor at the output of the comparator should be removed because it might destroy the comparator when it tries to discharge it with unlimited current.

    • pingluntus
    • Michellen on 2021/6/17 10:09:01

    Haveyou found this to be difficult in general? I imagine unless the op amp used internally to the comparator IC is a rail to rail op amp this could be an issue?

      • pingluntu
      • author on 2021/6/18 10:30:49
        author

      Re:

      No.
      There are plenty of comparator ICs whose input common mode range includes ground (or their negative supply terminal). Three of them are the LM393 dual comparator, its quad version the LM339, and the LT1116.
      A visit to the website of any of the major IC manufacturers will yield many more. Browse through their offerings, read the data sheets, and pick the best one for your job.

Leave a Reply

Your email address will not be published.

 
 
   
 
code image
Rating: poor fair good very good excellent

# 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z