Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
university:courses:electronics:electronics-lab-opamp-comparator [31 Oct 2019 13:49] Pop Andreeauniversity:courses:electronics:electronics-lab-opamp-comparator [16 May 2022 15:22] (current) – [The op-amp as a "comparator":] Doug Mercer
Line 1: Line 1:
-====== Activity: Op Amp as Comparator ======+======Activity: Op Amp as Comparator, For ADALM2000======
  
 ===== Objective: ===== ===== Objective: =====
  
-In this lab we introduce the operational amplifier (op amp) in switching mode configuration, obtaining a op-amp voltage comparator behavior. The voltage comparator circuit has the purpose of highlighting via two different states of the output voltage, the relative state of the two input voltage. The comparison is made using the sign of the difference between the two input voltages, while response is one of the two possible output values, dependent on the sign of that specific difference. +In this lab we introduce the operational amplifier (op amp) in switching mode configuration, obtaining a op-amp voltage comparator behavior. The voltage comparator circuit has the purpose of highlighting via two different states of the output voltage, the relative state of the two input voltage. The comparison is made using the sign of the difference between the two input voltages, while response is one of the two possible output values, dependent on the sign of that specific difference
 + 
 +=====Background:===== 
 + 
 +====The op-amp as a "comparator":==== 
 + 
 +Consider an op-amp used to amplify a signal without feedback as shown in figure 1a. Because no feedback is used, the input signal is amplified by the full open-loop gain of the op-amp. Even a very small input voltage (less than a millivolt either side of Vth) will be enough to drive the output to either the minimum or maximum output voltage, as shown in the plots of Vin and Vout. Thus, in this case because the op-amp -Input is connected to Vth, the output represents the sign of Vin ( "0" if Vin < Vth, "1" if Vin > Vth ) 1, and the circuit is like a one-bit analog to digital converter (ADC), and functions like a voltage comparator. 
 + 
 +{{ :university:courses:alm1k:alm-lab-comp-f7.png?500 |}} 
 + 
 +<WRAP centeralign>Figure 1a, An op-amp used as a comparator</WRAP> 
 + 
 +Op Amps and comparators may seem interchangeable at first glance based on their symbols and pinouts. The Analog Parts Kits is supplied with a variety of op-amps and the AD8561 high speed voltage comparator that was used in other activities. Some designers might be tempted to use or substitute readily available op amps as voltage comparators in their projects. There are very important differences however. Comparators are designed to work without negative feedback or open-loop, they are generally designed to drive digital logic circuits from their outputs, and they are designed to work at high speed with minimal instability. Op amps are not generally designed for use as comparators, their input structures may saturate if over-driven which may cause it to respond comparatively slowly. Many have input stages which behave in unexpected ways when driven with large differential voltages or beyond the specified common mode range. In fact, in many cases, the differential input voltage range of an op amp is limited or clamped to prevent damage to the input stage devices. Note this article on "[[adi>en/analog-dialogue/articles/amplifier-input-protection-friend-or-foe.html|Amplifier Input Protection... Friend or Foe?]]" for more background on this issue. 
 + 
 +<note important>Warning: Using op-amps with built-in input clamps as a voltage comparator may damage the IC!</note> 
 + 
 +Yet many designers still try to use op amps as comparators. While this may work in some cases at low speeds and low resolutions, many times the results are not satisfactory. Not all of the issues involved with using an op amp as a comparator can be resolved by reference to the op amp datasheet, since op amps are not intended for use as comparators. 
 + 
 +The most common issues are speed (as we have already mentioned), the effects of input structures (protection diodes, phase inversion in FET amplifiers such as the ADTL082, and many others), output structures which are not intended to drive logic, hysteresis and stability, and common-mode effects.
  
 For an op-amp comparator we can consider a single input v<sub>D</sub> as the difference betwee v<sup>+</sup> and v<sup>-</sup>. Therefore, the output voltage V<sub>O</sub> can get one of the two possible values: For an op-amp comparator we can consider a single input v<sub>D</sub> as the difference betwee v<sup>+</sup> and v<sup>-</sup>. Therefore, the output voltage V<sub>O</sub> can get one of the two possible values:
Line 19: Line 37:
 ADALM2000 Active Learning Module\\ ADALM2000 Active Learning Module\\
 Solder-less breadboard, and jumper wire kit\\ Solder-less breadboard, and jumper wire kit\\
-2 1 kΩ resistor\\ +10 kΩ resistor\\
-10 kΩ resistor\\+
 1 20 kΩ resistor\\ 1 20 kΩ resistor\\
 1 OP97 ( Low slew rate amplifier supplied with the recent versions of ADALP2000 Analog Parts Kit )\\ 1 OP97 ( Low slew rate amplifier supplied with the recent versions of ADALP2000 Analog Parts Kit )\\
Line 119: Line 136:
 <WRAP centeralign> Figure 7. Non-Inverting hysteresis comparator XY plot </WRAP> <WRAP centeralign> Figure 7. Non-Inverting hysteresis comparator XY plot </WRAP>
  
-In Figure 7. you can observe the voltage transfer charactersitic of the non-inverting hysteresis comparator (the arrows drawn indicate the flow of the signal with respect to the thresholds). Compare the computed threshold voltage values  with the measured ones.+In Figure 7. you can observe the voltage transfer charactersitic of the non-inverting hysteresis comparator (the arrows drawn indicate the flow of the signal with respect to the thresholds).
  
 ===== Inverting Hysteresis Comparator ===== ===== Inverting Hysteresis Comparator =====
Line 167: Line 184:
 <WRAP centeralign> Figure 11. Inverting hysteresis comparator XY plot </WRAP> <WRAP centeralign> Figure 11. Inverting hysteresis comparator XY plot </WRAP>
  
-In Figure 11. you can observe the voltage transfer characteristic of the non-inverting hysteresis comparator (the arrows drawn indicate the flow of the signal with respect to the thresholds). Compare the computed threshold voltage values with the measured ones.+In Figure 11. you can observe the voltage transfer characteristic of the non-inverting hysteresis comparator (the arrows drawn indicate the flow of the signal with respect to the thresholds).
  
 ===== Inverting Hysteresis Comparator with asymmetric thresholds===== ===== Inverting Hysteresis Comparator with asymmetric thresholds=====
Line 213: Line 230:
 <WRAP centeralign> Figure 15. Inverting hysteresis comparator with asymmetric thresholds XY plot </WRAP> <WRAP centeralign> Figure 15. Inverting hysteresis comparator with asymmetric thresholds XY plot </WRAP>
  
-In Figure 15. you can observe the voltage transfer characteristic of the non-inverting hysteresis comparator (the arrows drawn indicate the flow of the signal with respect to the thresholds). Compare the computed threshold voltage values with the measured ones.+In Figure 15. you can observe the voltage transfer characteristic of the non-inverting hysteresis comparator (the arrows drawn indicate the flow of the signal with respect to the thresholds). 
 + 
 +===== Questions ===== 
 + 
 +  - Compute the threshold voltages for all four comparator setups (simple, non-inverting hysteresis, inverting hysteresis, asymmetric thresholds) and compare the results with the ones obtained from the experimental setups.
  
 ===== Extra Activities ===== ===== Extra Activities =====
Line 253: Line 274:
 <WRAP round download> <WRAP round download>
 ** Lab Resources:** ** Lab Resources:**
-  * LTSpice files: [[ https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/analogdevicesinc/education_tools/tree/master/m2k/ltspice/opamp_comp_ltspice | opamp_comp_ltspice]] +  * LTSpice files: [[downgit>education_tools/tree/master/m2k/ltspice/opamp_comp_ltspice | opamp_comp_ltspice]] 
-  * Fritzing files: [[ https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/analogdevicesinc/education_tools/tree/master/m2k/fritzing/opamp_comp_bb | opamp_comp_bb]]+  * Fritzing files: [[downgit>education_tools/tree/master/m2k/fritzing/opamp_comp_bb | opamp_comp_bb]]
 </WRAP> </WRAP>
  
Line 260: Line 281:
  
 Some additional resources on Op Amps as Comparators: Some additional resources on Op Amps as Comparators:
-  * [[http://www.analog.com/media/en/technical-documentation/application-notes/AN-849.pdf|AN-849 - Using Op Amps as Comparators]] +  * [[adi>media/en/technical-documentation/application-notes/AN-849.pdf|AN-849 - Using Op Amps as Comparators]] 
-  * [[http://www.analog.com/en/analog-dialogue/articles/amplifiers-as-comparators.html|Ask The Applications Engineer—31: Amplifiers as Comparators?]] +  * [[adi>en/analog-dialogue/articles/amplifiers-as-comparators.html|Ask The Applications Engineer—31: Amplifiers as Comparators?]] 
-  * [[http://www.analog.com/en/analog-dialogue/articles/curing-comparator-instability-with-hysteresis.html|Curing Comparator Instability with Hysteresis]] +  * [[adi>en/analog-dialogue/articles/curing-comparator-instability-with-hysteresis.html|Curing Comparator Instability with Hysteresis]] 
-  * [[http://www.analog.com/en/analog-dialogue/raqs/raq-issue-11.html|Comparators & Op Amps—May They Never Meet]]+  * [[adi>en/analog-dialogue/raqs/raq-issue-11.html|Comparators & Op Amps—May They Never Meet]]
  
  
 **Return to Lab Activity [[university:courses:electronics:labs|Table of Contents]]** **Return to Lab Activity [[university:courses:electronics:labs|Table of Contents]]**
  
university/courses/electronics/electronics-lab-opamp-comparator.1572526156.txt.gz · Last modified: 31 Oct 2019 13:49 by Pop Andreea