Non Linear Circuits Comparators Lesson: Non Linear Circuits Comparators Lesson Developer: Dr.Arun Vir Singh College/Department: Physics Department, Shivaji College, University of Delhi 1 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Table of Contents Chapter :Applications of Operational Amplifier: Nonlinear Circuits Lesson –II Comparators 1.1 Introduction 1.1.1Basic comparator 1.2.Noninverting Comparator 1.2.1 (i) Noninverting Comparator with positive reference voltage 1.2.2(ii) Noninverting Comparator with negative reference voltage 1.3 Inverting Comparator 1.3.1(i) Inverting Comparator with positive reference 1.3.2(ii) Inverting Comparator with negative reference 1.4 Applications of Comparators 1.5 Zero Crossing Detectors 1.5.1 Inverting Zero-Crossing Detector 1.5.2 Noninverting Zero-Crossing Detector 1.4 Inverting comparator with positive feed back Summary Exercises Glossary References 2 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Comparators 1.1 Introduction Op-amp in open-loop configuration can be used a comparator. A comparator, as the name implies, compares the amplitude of one voltage (signal voltage) with another fixed voltage (reference voltage).These are used as digital interfacing, Schmitt triggers, discriminators, voltage-level detectors and oscillators. Op-amp as a comparator is shown in figure.1 Fig.1 Op-amp as a comparator In this application, these two voltage are compared and output ) may be + or , depending upon which input is the larger. Depending upon to which terminals, the input is applied; the comparators are classified as, (i) Noninverting and (ii) Inverting Comparator The reference voltage may be positive or negative. 1.2 Comparator in Noninverting Configuration For this configuration, time-varying signal ( ) is applied at noninverting ‘+’ (pin-3) terminal and a fixed voltage or reference voltage ( ) is applied to inverting ‘-‘(pin-2). If the positive reference voltage is applied then it is called noninverting Comparator with positive reference voltage and if the reference voltage is negative then it is called noninverting Comparator with negative reference voltage. 1.2.1 (i) Noninverting Comparator with positive reference voltage Figure 2 shows an op-amp used as a comparator in noninverting mode with positive reference voltage. A time-varying signal/ sinusoidal input voltage ( ) is applied at noninverting ‘+’ (pin-3) terminal and a fixed reference voltage ( ) is applied to inverting ‘-‘(pin-2) terminal. From figure and Output voltage is given by the expression 3 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators [1.1] Fig: 2 Noninverting comparator with positive reference voltage. Where is open-loop gain =105 very high. So output will be saturated and will depend upon the relative values of and . For , For , and [1.2] [1.3] Operation: Reference voltage, input and output waveforms are displayed in figure 3. When , ( For points a to b and c to d) the output voltage is at ,because the voltage at the noninverting terminal is lower than at the inverting terminal. 4 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Figure 3: Plot of reference voltage, input and output wave forms for a noninverting op-amp. On the other hand, when ,the inverting (+) input ( points b to c, d to e) the becomes more positive with respect to the inverting (-) input and output voltage goes to + , because the voltage at the noninverting terminal is higher than at the inverting terminal. Thus output voltage changes to . 1.2.2(ii) Noninverting Comparator with negative reference voltage Noninverting Comparator with positive reference voltage can be converted into noninverting comparator with negative reference voltage, if the reference voltage source shown in Fig. [1] is replaced by a negative voltage source.i,e Vref is negative with respect to ground. Figure 4: Reference voltage, input and output waveforms for noninverting comparator with negative reference voltage. Working: Plot of input and output waveforms along with the negative reference voltage (-3V) is displayed in figure 4. When (between points a to b and c to d ) the output voltage is at ,because the voltage at the inverting terminal is higher than at the noninverting terminal. When (between points b and c) the output voltage goes to is at , because the voltage at the noninverting terminal is higher than at the inverting terminal. Thus output voltage changes to. This comparator is a type of analog to digital converter. 5 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators This comparator is sometimes also called a voltage level detector because, for a desired value of ,the voltage level of can be detected. 1.3. Inverting Comparator In this configuration, a fixed voltage ( ) or reference voltage is applied to noninverting ‘+’ (pin-3) terminal and the other, time-varying signal ( ) is applied at inverting ‘-‘ (pin-2) terminal 1.3.1 Inverting Comparator with negative reference voltage The circuit for the inverting comparator with negative reference voltage is shown in figure 5. A reference voltage ( ) is applied to noninverting ‘+’ (pin-3) terminal and the other, timevarying signal ( ) is applied at inverting ‘-‘ (pin-2) terminal .It can be seen from the Fig.5:Inverting comparator with negative reference voltage. figure and Output voltage is given by the expression [1.4] For , [1.5] For , [1.6] 6 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Fig.6: Reference voltage, input and output waveforms for inverting op-amp for negative reference voltage. Working: Reference voltage, input and output waveforms are plotted in figure 6. When (for points b to c) the output voltage is at + . When (for points a to b, and c to d) the output voltage goes to . So output voltage changes to . 1.3.2 Inverting Comparator with positive reference voltage Inverting comparator with positive reference voltage can be obtained by replacing the negative reference voltage , with a positive reference voltage source , shown in figure 5. So and and the output voltage is given by the expression [1.7] For , [1.8] For , [1.9] Working: Positive reference voltage, input and output waveforms are shown in figure 7. For (between points a and b, c and d ) the output voltage is at + . When (points b to c, and d to e ) the output voltage goes to is at . Thus output voltage changes to . 7 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Figure 7 : Wave forms for inverting op-amp for positive reference voltage. The characteristics of these comparators are summarized in the table. Comparator configuration Ref. Voltage Non-inverting Non-inverting Inverting Inverting positive Negative positive negative Output for Vin < Vref -Vsat + Vsat + Vsat -Vsat Vin > Vref + Vsat -Vsat -Vsat + Vsat Value addition : FAQ Limiting Value of differential input voltage Body Text For an open-loop configuration (i) (ii) Supply voltage ±15 V. For a ±15 V supply ,the saturated voltage are approximately ±13 V. Max differential voltage + Max differential voltage Hence input voltage greater than ±65μV produces saturated output voltages. This value of input is the limiting value. Source: Op-Amps and Linear Integrated Circuits : Ramakant A. Gayakwad 8 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators 1.4 Applications of Comparators (i) Zero crossing Detectors (ii)Level detector (iii)Window detector (iv) Duty cycle controller 1.5 Zero-Crossing Detectors An immediate application of the op-amp is the zero-crossing detector or sine to square wave converter. The basic comparator shown in Fig.[2] and Fig.[5] can be used as the zero-crossing detector provided that Vref is set to zero ( 1.5.1 Inverting Zero-Crossing Detector Fig. 8 Zero crossing detector The op-amp in figure 8 operates as a zero-crossing detector in which reference voltage is applied to noninverting ‘+’ (pin-3) terminal and sinusoidal input voltage ( ) is applied at inverting ‘-’ (pin-2) terminal of op-amp. The input voltage ( is compared with a reference voltage of 0V .Output of zero-crossing detector is given by the equation [1.10] In figure Hence and . [2] For ideal op-amp Ao is very high, so output will be saturated and If is positive, output will be saturated at .i.e is equal to . and for negative The output wave forms along input signal and reference voltage are shown in figure 8 . 9 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Fig:9 The output wave forms along input signal and reference voltage. In the regions ‘ a to b’ and ‘c to d’, input signal passes through zero to positive direction, the output is driven into –Vsat. Conversely when input signal passes through zero to negative direction ( b to c), the output switches to +Vsat.This circuit is also called sine to square wave generator 1.3.1 Noninverting Zero-Crossing Detector Fig.8- Noninverting Zero-Crossing Detector 10 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Noninverting zero-crossing detector is illustrated in figure 10. A triangular wave instead of sinusoidal input voltage ( ) is applied to noninverting ‘+’ (pin-3) terminal and reference voltage is applied to inverting ‘-’ (pin-2) terminal of op-amp. The op-amp’s (+) input compares with a reference voltage of 0V .Output of noninverting zerocrossing detector is given by the equation [1] In figure Hence and . [2] For ideal op-amp Ao is very high, so output will be saturated and is equal to .If is positive and for negative . Plot of output wave form, input signal and reference voltage as a function of time is shown in figure 9. Fig.9:Plot of output wave form, input signal and reference voltage as a function of time is shown in In the regions ‘ a to b’ and ‘c to d’, input signal passes through zero to negative direction, the output is driven into +Vsat. Conversely i.e when input signal passes through zero to positive direction ( b to c,d to e ), the output switches to –Vsat. So a triangular wave is also converted into square wave. 11 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Value Addition Do you know ? Effect of noise on comparator circuits and how to reduce it ? Body Test In many practical situations, noise (unwanted voltage fluctuations) appears on the input line. This noise voltage becomes superimposed on the input voltage, as shown in figure A, below for the case of a sine wave. Figure A: Noise voltage superimposed over sine wave In order to understand the potential effects of noise voltage, a low-frequency sinusoidal voltage is applied to the noninverting (+) pin of an op-amp comparator used as a zero-level detector, as shown in Figure 8. The op-amp’s input signal voltage is drawn both with and without noise in figure B. In the figure C the resulting output are shown. When Vin approaches Vref very slowly or actually hovers close to Vref, =0 V,(a to b, c to d , e to f and f to g ), Vo can either follow all the noise voltage oscillations or burst into high frequency oscillation or we can say that the fluctuations due to noise may cause the total input to vary above and below 0 several times, thus producing an erratic output voltage. 12 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Fig:C: Effect of noise on zero-crossing ` If no noise is present (g to i) ,the circuit operates as an inverting zero-crossing detector because Vref=0 This false crossing can be eliminated by positive feed back. Source: Electronics Devices . Thomas L. Floyd Value Addition Do you know ? How a zero crossing detector is used as time marker generator Body Text: Time marker generator: It may be used for triggering the SCR, sweep voltage of CRT etc. A comparator can be used as a time marker generator by differentiating the output of the zero crossing detectors shown in figure 10. (RC <<T) . The Time marker circuit ,Fig ---input wave forms (b) Output of comparator (c) differentiated output and output pulses are shown The negative portion is clipped off after passing through the diode, the sin wave gets converted into a train of positive pulses of spacing T . This T can be adjusted as per requirement Source: Linear Integrated circuits By. D.Roy Chudhary & Shail B . Jain 13 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators 1.4 Inverting comparator with positive feed back A comparator with positive feedback is shown in Figure 10. Positive feedback is accomplished by taking a fraction of the output voltage Vo and applying it to the (+) input. The output voltage Vo divide between Rf and R1. A fraction of Vo is fed back to the (+) input and creates a reference voltage that depends on Vo. Now we will study how positive feedback is used to eliminate the false output changes due to noise. Fig.10 A comparator with positive feedback The input voltage triggers (change of state) the output every time it exceeds certain voltage levels called the upper threshold voltage and lower threshold voltage as shown in figure 11. and are calculated using voltage dividing rule. Upper- threshold voltage When , the voltage across is called upper threshold voltage. This voltage is divide between and and fraction of it is fed back to the (+) input and is given by . For [1.13] , the voltage at the (+) input is above the voltage at the (-) is locked at . values below input. Therefore If is made slightly more positive than , the polarity of reverses and begins to decrease . As fraction of fed back to the positive input is smaller, so becomes larger. Vo then is driven to . Lower- threshold voltage 14 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators When , the voltage across is referred to as lower threshold voltage. This voltage is divide between and and fraction of it is fed back to the (+) input and is given by [1.14] Output will stay at as long as is above, or positive with respect to , . will goes more negative than ,or below, .This circuit is called switch back to if Schmitt trigger. Input and output wave forms are exhibited in figure 11. Figure 11. Input and output wave form of Schmitt trigger. The comparator with positive feedback is said to exhibit hysteresis. When the input of the comparator exceeds hysteresis voltage. ,its output switches from to and reverts back to its original state, , when the input goes below ,shown in figure 12 15 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators Figure 12. Plot of Vs. plot of hysteresis voltage. The hysteresis voltage is, of course, equal to the difference between and Therefore Substituting for and [1.15] [1.16] and made larger than input noise voltages, the positive feedback will eliminate the false output transitions. Also, the positive feedback, because of its regenerative action, will make Vo switch faster between +Vsat and -Vsat. Thus, if Value Addition: FAQ How the noise is eliminated using Schmitt Trigger. Body Text: Output of Schmitt trigger for a sine wave input having noise is illustrated in figure below. 16 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators It triggers only once when UTP or LTP is reached; thus, there is immunity to noise that is riding on the input signal. Source: Electronics Devices. Thomas L. Floyd Summary: After completing this section, you should be able to Describe and analyze the operation of several types of comparator circuits Discuss the operation of a zero-level detector Describe the operation of a nonzero-level detector Calculate the reference voltage Discuss how input noise affects comparator operation Calculate the upper and lower trigger points Explain what a Schmitt trigger is Mention examples of comparator applications Exercise Question Number Type of question 1 Multiple choice questions 17 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators 1. In a zero-level detector, the output changes state when the input (a) is positive (b) is negative (c) crosses zero (d) has a zero rate of change 2. The zero-level detector is one application of a (a) comparator (b) differentiator (c) summing amplifier (d) diode 3. Noise on the input of a comparator can cause the output to ( a) hang up in one state (b) go to zero (c) change back and forth erratically between two states (d) produce the amplified noise signal 4. The effects of noise can be reduced by (a) lowering the supply voltage (b) using positive feedback negative feedback (d) using hysteresis (e) answers (b) and (d) Correct answers (1). (2). (3). (4). (c) using C A C B and D Question Number Type of question 2 Fill in the blanks 1.The difference between the UTP and the LTP is the -------------- voltage. 2. In an op-amp comparator, when the ------- voltage exceeds a ------------ voltage, the output changes state. 3. Hysteresis gives an op-amp ----- immunity. 4. The output of a comparator has ------- states. Correct answers (1). (2). (3). (4). hysteresis input, reference noise two 18 Institute of Lifelong Learning, University of Delhi Question Number Type of question 3 Subjective questions Non Linear Circuits Comparators 1.What is a comparator? 2. What is voltage limiting, and why is it needed? 3.List important characteristics of the comparator. 4.Sketch a zero-crossing detector and describe its theory of operation 5.What is a Schmitt trigger? How it is different from a zero-crossing detector? 6. Mention the similarities and differences between comparator and Schmitt trigger. 7.To which input would you connect e reference voltage to make an inverting level detector? Question Number Type of question 4 Unsolved questions Comparators 1. A certain op-amp has an open-loop gain of 80,000. The maximum saturated output levels of this particular device are ± 12V when the dc supply voltages are ± 15V .If a differential voltage of 0.15 mV rms is applied between the inputs, what is the peak-topeak value of the output? 2. Draw the output voltage waveform for each circuit in shown below with respect to the input. Show voltage levels. 3.If , Correct answers in figure 10. What are the trip points? What is the hysteresis? 1. 24 V,distorted 2. 19 Institute of Lifelong Learning, University of Delhi Non Linear Circuits Comparators 3.=+10.8V,-10.8V ,21.6V 4. Glossary: Noise: Unwanted signals in input and output Feedback: A fraction of output is mixed with input Schmitt trigger A comparator with built-in hysteresis./or with positive feedback Hysteresis: Characteristic of a circuit in which two different trigger levels create an offset or lag in the switching action References Electronics Devices and Circuit Theory by Robert. L Boylestad and L. Nashelsky Op-Amps and Linear Integrated Circuits : Ramakant A. Gayakwad Electronics Devices . Thomas L. Floyd 20 Institute of Lifelong Learning, University of Delhi