This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
university:courses:electronics:electronics-lab-opamp-comparator [25 Oct 2018 16:26] – [Further Reading] add LTSpice files Antoniu Miclaus | university: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: |
===== Objective: ===== | ===== Objective: ===== | ||
- | In this lab we introduce the operational amplifier (op amp) in switching mode configuration, | + | In this lab we introduce the operational amplifier (op amp) in switching mode configuration, |
+ | |||
+ | =====Background: | ||
+ | |||
+ | ====The op-amp as a " | ||
+ | |||
+ | 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 ( " | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | 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, | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | Yet many designers still try to use op amps as comparators. While this may work in some cases at low speeds and low resolutions, | ||
+ | |||
+ | 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< | For an op-amp comparator we can consider a single input v< | ||
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\\ | + | 3 10 kΩ resistor\\ |
- | 2 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 30: | Line 47: | ||
The high intrinsic gain of the op-amp and the output saturation effects can be exploited by configuring the op-amp as a comparator as in figure 1. This is essentially a binary-state decision-making circuit: if the voltage at the “+” terminal is greater than the voltage at the “-” terminal, Vin > Vref , the output goes “high” (saturates at its maximum value). Conversely if Vin < Vref the output goes “low”. The circuit compares the voltages at the two inputs and generates an output based on the relative values. Unlike all the previous circuits there is no feedback between the input and output; we say that the circuit is operating “open-loop”. | The high intrinsic gain of the op-amp and the output saturation effects can be exploited by configuring the op-amp as a comparator as in figure 1. This is essentially a binary-state decision-making circuit: if the voltage at the “+” terminal is greater than the voltage at the “-” terminal, Vin > Vref , the output goes “high” (saturates at its maximum value). Conversely if Vin < Vref the output goes “low”. The circuit compares the voltages at the two inputs and generates an output based on the relative values. Unlike all the previous circuits there is no feedback between the input and output; we say that the circuit is operating “open-loop”. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 40: | Line 58: | ||
Start by shutting off the power supplies and assemble the circuit. As with the summing amplifier circuit earlier, use the second waveform generator output for the DC source Vref , and turn the amplitude to zero and the output offset all the way down so that you can adjust up from zero during the experiment. | Start by shutting off the power supplies and assemble the circuit. As with the summing amplifier circuit earlier, use the second waveform generator output for the DC source Vref , and turn the amplitude to zero and the output offset all the way down so that you can adjust up from zero during the experiment. | ||
- | Again configure the waveform generator Vin for a 2V amplitude sine wave at 1 kHz. With the power supply on and Vref at zero volts, export the output waveform. | + | Again configure the waveform generator Vin for a 2V amplitude |
Now slowly increase Vref and observe what happens. Record the output waveform for Vref = 1V. Keep increasing Vref until it exceeds 2V and observe what happens. Can you explain this? | Now slowly increase Vref and observe what happens. Record the output waveform for Vref = 1V. Keep increasing Vref until it exceeds 2V and observe what happens. Can you explain this? | ||
Line 46: | Line 64: | ||
Repeat the above for a triangular input waveform and record your observations for your lab report. | Repeat the above for a triangular input waveform and record your observations for your lab report. | ||
- | {{: | + | {{ : |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 52: | Line 70: | ||
=== Procedure: === | === Procedure: === | ||
- | Use the first waveform generator as source Vin to provide a 2V amplitude, 1 kHz sine wave excitation to the circuit. Supply the op amp to +/- 5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2. | + | Use the first waveform generator as source Vin to provide a 2V amplitude |
A plot example is presented in Figure 3. | A plot example is presented in Figure 3. | ||
Line 63: | Line 81: | ||
===== Hysteresis Comparator ===== | ===== Hysteresis Comparator ===== | ||
- | Hysteresis is considered to be a phenomenon according to which the actual value of a quantity (material) depends | + | Hysteresis is the dependence |
In this configuration, | In this configuration, | ||
Line 77: | Line 95: | ||
Consider the circuit presented in Figure 4. | Consider the circuit presented in Figure 4. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 99: | Line 117: | ||
Build the following breadboard circuit for the non-inverting hysteresis comparator. | Build the following breadboard circuit for the non-inverting hysteresis comparator. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 105: | Line 123: | ||
=== Procedure: === | === Procedure: === | ||
- | Use the first waveform generator as source Vin to provide a 6V amplitude, 1 kHz sine wave excitation to the circuit. Supply the op amp to +/- 5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2. | + | Use the first waveform generator as source Vin to provide a 6V amplitude |
A plot example is presented in Figure 6. | A plot example is presented in Figure 6. | ||
Line 118: | Line 136: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | 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 | + | 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 126: | Line 144: | ||
Consider the circuit presented in Figure 8. | Consider the circuit presented in Figure 8. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 147: | Line 165: | ||
Build the following breadboard circuit for the inverting hysteresis comparator. | Build the following breadboard circuit for the inverting hysteresis comparator. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 153: | Line 171: | ||
=== Procedure: === | === Procedure: === | ||
- | Use the first waveform generator as source Vin to provide a 6V amplitude, 1 kHz sine wave excitation to the circuit. Supply the op amp to +/- 5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2. | + | Use the first waveform generator as source Vin to provide a 6V amplitude |
A plot example is presented in Figure 10. | A plot example is presented in Figure 10. | ||
Line 166: | Line 184: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | 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 174: | Line 192: | ||
Consider the circuit presented in Figure 12. | Consider the circuit presented in Figure 12. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 193: | Line 211: | ||
Build the following breadboard circuit for the inverting hysteresis comparator. | Build the following breadboard circuit for the inverting hysteresis comparator. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 199: | Line 217: | ||
=== Procedure: === | === Procedure: === | ||
- | Use the first waveform generator as source Vin to provide a 6V amplitude, 1 kHz sine wave excitation to the circuit and second waveform generator as constant 1V voltage reference. Supply the op amp to +/- 5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2. | + | Use the first waveform generator as source Vin to provide a 6V amplitude |
A plot example is presented in Figure 14. | A plot example is presented in Figure 14. | ||
Line 212: | Line 230: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | 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). | + | 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 | ||
===== Extra Activities ===== | ===== Extra Activities ===== | ||
Line 220: | Line 242: | ||
You can also extend the above example to a circuit with multiple voltage levels as the circuit presented in Figure 16. | You can also extend the above example to a circuit with multiple voltage levels as the circuit presented in Figure 16. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 242: | Line 264: | ||
2. Build the breadboard circuit. Supply the op amp to +/- 5V from the power supply. Use the first channel of the Signal Generator to generate the variable input voltage (V< | 2. Build the breadboard circuit. Supply the op amp to +/- 5V from the power supply. Use the first channel of the Signal Generator to generate the variable input voltage (V< | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 250: | Line 272: | ||
This type of circuit is also known as Window Comparator. An an application on this subject can be found in the activity: [[university: | This type of circuit is also known as Window Comparator. An an application on this subject can be found in the activity: [[university: | ||
- | ==== Further Reading ==== | + | <WRAP round download> |
** Lab Resources: | ** Lab Resources: | ||
- | * LTSpice files: [[ https://minhaskamal.github.io/DownGit/#/home? | + | * LTSpice files: [[downgit> |
+ | * Fritzing files: [[downgit> | ||
+ | </ | ||
+ | |||
+ | ==== Further Reading ==== | ||
Some additional resources on Op Amps as Comparators: | Some additional resources on Op Amps as Comparators: | ||
- | * [[http:// | + | * [[adi>media/ |
- | * [[http:// | + | * [[adi>en/ |
- | * [[http:// | + | * [[adi>en/ |
- | * [[http:// | + | * [[adi>en/ |
**Return to Lab Activity [[university: | **Return to Lab Activity [[university: | ||