Lab 5 Operational Amplifiers 1 Purpose The purpose of this lab is to examine the properties of the operational amplifier and learn to design practical op-amp circuits. The concepts and equations of the inverting and non-inverting amplifiers will be verified and the use of the operational amplifier as a comparator will be investigated. 2 Operational Amplifier An operational amplifier (op-amp) is a device with two inputs and a single output. The output of the amplifier vo is given by the formula: vo = A(v+ \Gamma v \Gamma ) (1) Where A is the open-loop voltage gain of the amplifier, v+ is the non-inverting input voltage and v \Gamma is the inverting input voltage. Both v+ and v \Gamma are node voltages with respect to ground. Typically, the open-loop voltage gain A is on the order of 105 \Gamma 106. A resistor is placed between the output node and the inverting input to provide feedback and adjust amplification. When an op-amp circuit behaves linearly, the op-amp adjusts its output current such that the voltage difference between the two inputs is nearly zero. v \Gamma = v+ (2) Another important feature of the op-amp is that its input resistance is very large and may be taken as infinite in many applications. The most common type of op-amp is the 741 which has an input resistance of 2 M\Omega . This is large enough to be considered infinite in most applications. Because of the high input resistance, only a very small current flows into either input of an op-amp. In practical op-amp circuits, the current flowing into either of the inputs is usually on the order of _A. In the case of an ideal op-amp, where the single assumption is made that the open-loop voltage gain A goes to infinity, ii = 0 (3) where ii is defined to be the current entering the non-inverting input and exiting the inverting input. Equations 2 and 3 can be used to analyze most of the properties of op-amp circuits. 3 Op Amp Symbol Figure 3 shows an operational amplifier with an open-loop voltage gain A. The terminals labeled +vcc and \Gamma vcc are power supply connections to the op-amp and set limits on the voltage which can be produced at the output node. The op-amp we will be using is the 747 as shown in Figure 4. The 747 is a dual op-amp integrated circuit (IC) containing two 741 op-amps. To use this IC, you must insert it into your board as shown in Figure 1. When properly positioned, the op-amp straddles the gap in the middle of the terminal strip with the 14 pins snuggly fit into individual holes in the terminal strip. Observe the notch at one end of the op-amp chip. This notch is used for orientation and identification of the pins. With the notch positioned as shown, pin 1 is always to the left of the notch. 4 Op Amp Configuration As discussed earlier, amplifier circuits that utilize op-amps as linear amplifiers require feedback circuits to control the voltage gain (amplification). The output voltage of the op-amp can never exceed the power 38 141 2 3 4 5 6 7 8 9 10 11 12 13 Figure 1: Proto Board with inserted 747. supply voltage levels, called "the rails" of the power supply. In this section, we shall examine two types of amplifier configurations for the op-amp (Inverting and Non-inverting) and the voltage gain provided by each. 4.1 Inverting Amplifier Figure 5 shows an op-amp in the inverting configuration along with the power supply connections +vcc and \Gamma vcc. Future circuit diagrams will show only the signal portion of the circuit with the understanding that the power supply connections are required for proper operation of the circuit. To analyze this circuit, we will use Kirchhoff's Current Law (KCL) to determine the output node voltage vo and the circuit voltage gain given by the formula voltage gain = vov s (4) It is important to distinguish between the voltage gain of the circuit and the open-loop voltage gain of the op-amp. The op-amp is only part of the amplifier circuit. The open-loop voltage gain A of the op-amp is the voltage gain from the two op-amp inputs to the op-amp output. While the output node of the whole amplifier circuit may be the output node of the op-amp, the input to the amplifier circuit will not be, in general, a voltage applied across the input terminals of the op-amp. To analyze an op-amp circuit we first look at the op-amp input nodes (2 and 3). Assuming an ideal op-amp, no current flows into either of the op-amp inputs (Equation 3). The current through R3 is zero and therefore v3 = 0. From Equation 2 we know that v2 = v3 = 0. From this, the current flowing through resistor R1 is iR1 = v1 \Gamma v2 R1 = vS \Gamma 0 R1 = vS R1 (5) From Equation 3 we know that iR1 = iR2 = vSR 1 . iR2 = 0 \Gamma vO R2 = iR1 = vS R1 (6) \Gamma vOR 2 = vS R1 (7) vO = \Gamma vS ` R2R 1 ' (8) 39 To find the voltage gain (of the amplifier circuit), we need to divide the output voltage by the input voltage: Gain = vOv S = \Gamma vS i R2R 1 j vS = \Gamma R2R 1 (9) Note that the final voltage gain is negative, thus the name inverting amplif ier. However, sometimes a negative voltage gain is not desired. In such a case, one could either use the output of the inverting amplifier as the input to a second inverting amplifier which would cause the total voltage gain to be positive. However, a simpler method would be to use the non-inverting amplifier configuration. 4.2 Non-inverting Op Amp The basic configuration for a non-inverting amplifier is shown in Figure 6. The voltage gain for this circuit is 1 + R2R 1 , it will be left to you as an exercise to verify this voltage gain in your lab report. 5 Op Amp as a Comparator In the previous section, we saw how the use of a feedback resistor can provide stability to an op-amp allowing it to operate as a linear amplifier. In this section, we shall look at an op-amp configuration which does not use feedback: the comparator. The purpose of the comparator is to compare two voltages and produce a signal that indicates which voltage is greater. Figure 7 shows an op-amp as a comparator. The principle of the comparator is based in Equation 1. Since the voltage gain, A, of an op-amp is very large, any difference will be magnified to the power supply rails \Sigma vcc, as was discussed in Section 2. If v1 is greater than v2 then the difference v+ \Gamma v \Gamma will be positive and the result will be amplified to +vcc. If, however, v2 is greater, then the difference is negative and the result will be amplified to \Gamma vcc. Finally, if the two voltages are exactly equal, then the difference will be zero and the output will also be zero. Special Note: Whenever you want to remove and op-amp from a breadboard, use the IC EXTRACTOR in the wire jumper box at your lab station. If you do not use the extractor, you will bend the pins of the chip making it unusable. 6 Experimental Procedure For this portion of the lab exercise, you will be using the springboard and breadboard mounted on the bench at your lab station. 6.1 Power supply For this experiment, you will need a power supply which can provide +10 volts, -10 volts and a common ground. However, the power supply at your station is not equipped to provide both positive and negative 10 volts relative to earth ground. So we are going to "trick" the op-amp circuit by a clever use of a single power supply. Assemble the circuit shown in Figure 8. From the standpoint of the bench (20 V) power supply, \Gamma vcc is ground, common is 10 volts and +vcc is 20 volts. However, from the standpoint of the op-amp, common will be used as ground (not the same as earth ground) so that +vcc is now only 10 volts and \Gamma vcc is -10 volts. We have switched reference frames so that +vcc is now only 10 volts and \Gamma vcc is -10 volts. Measure and record the values of \Gamma vcc and +vcc using common as the reference (ground) node. 6.2 Inverting Amplifier 1. Select, measure, and record the values of three resistors, R1 = 5k\Omega , R2 = 20k\Omega and R3 = 5k\Omega . Obtain a 747 op-amp. Assemble the circuit shown in Figure 5. Be sure to include the power connections +vcc 40 and \Gamma vcc from the power supply circuit of Figure 8 to +vcc and \Gamma vcc of the 747 chip as shown in Figure 4. In addition, the ground nodes shown in Figure 5 are to be connected to the common node of Figure 8. Note that Figure 4 shows two +vcc connections. There are two 741 op-amps in each 747 chip. There is a separate +vcc for each op-amp. Connect a wire between the two +vcc pins. Also note that the pins labeled NC are not connected to anything. 2. Using the function generator apply a 1 volt peak-to-peak, 10 kHz sine wave as vS. Note that you need to verify the peak-to-peak voltage using the oscilloscope. 3. Using the oscilloscope, display both the op-amp's input and output waveforms. You can do this by using channel 1 at the input and channel 2 for the output. Find the peak-to-peak voltage of the output waveform. 4. Record the peak-to-peak voltage of vO and find the voltage gain of this op-amp configuration (Equation 4.) 5. Increase the peak-to-peak voltage of the function generator until the top of the output sine wave is being cut off. This effect is called clipping, and it occurs when the desired amplification would produce an output voltage greater than the bounds of \Gamma vcc and +vcc dictated by the power supply. Measure the voltage of the top half of the sine wave and record this value. Do the same thing with the bottom half of the sine wave. How do these values compare to the values recorded for +vcc and \Gamma vcc? 6. Compare the voltage gain you found in Step 4 to the theoretical voltage gain of the inverting op-amp. Note: If you find yourself with an op-amp circuit that "won't work" and you have verified that the external wiring is correct, extract the op-amp from the breadboard carefully using the IC EXTRACTOR in the wire jumper box at your lab station, and then use the op-amp tester to determine if your chip is bad. 6.3 Non-Inverting Amplifier 1. Using the three resistors you acquired for Section 6.2, assemble the circuit shown in Figure 6. 2. Using the function generator apply a 1 volt peak-to-peak, 10 kHz sine wave as vS. Note that you need to verify the peak-to-peak voltage using the oscilloscope. 3. Using the oscilloscope, display the op-amp's output waveform. Find the peak-to-peak voltage of the output waveform. 4. Record the peak-to-peak voltage of vO and find the voltage gain of this op-amp configuration (Equation 4.) 5. Increase the peak-to-peak voltage of the function generator until you achieve clipping. Measure the voltage of the top half of the sine wave and record this value. Do the same thing with the bottom half of the sine wave. How do these values compare to the values recorded for +vcc and \Gamma vcc? 6. Compare the voltage gain you found in Step 4 to the theoretical voltage gain of the non-inverting op-amp. 6.4 Comparator 1. You will need two DC power supplies for this portion of the experiment. Get a second DC power supply from the cabinet in the back of the lab if needed. 2. Assemble the circuit in Figure 9 using the voltage divider op-amp power supply you used in the previous sections. 41 3. Set voltage supply P1 to 12 volts. 4. Measure the voltage at the inverting input of the op-amp. (Note: All voltages in this section should be measured with respect to the negative terminals of the two power supplies.) 5. Set voltage supply P2 to 0 volts initially. 6. Measure and record the output voltage vo. 7. While monitoring vo, slowly turn the voltage of P2 up until vo changes. 8. Record the voltage of P2 at the point at which vo changes. 6.5 Comparator with Triangle Wave Input 1. Replace P2 with the function generator set to produce a triangular wave with a frequency of 50 Hz and maximum peak-to-peak voltage. 2. Lower the voltage on P1 so that +vcc and \Gamma vcc are 3.0 and -3.0 volts respectively. 3. Use the oscilloscope to view the output voltage (with respect to the node connected to the negative terminals of P1 and P2). 4. While reducing the amplitude of the triangle wave, observe the waveform on the oscilloscope. 5. Draw the waveform shown on the oscilloscope screen for 3 different triangle wave amplitudes and explain what is happening. 7 Project Procedure (To Be Done on Project Board) Do NOT dismantle this circuit when you are through with this exercise. You should keep the entire circuit, including the op-amp IC, on your project board. For the wireless control system we will be using operational amplifiers in two of the three configurations presented: non-inverting amp and as a comparator. After the signal is received by the receiver, it will be converted from AC to DC (a later experiment). This DC value will be small, under 500 mV, and will need to be amplified in order to be useful. For that purpose, we will use a non-inverting op-amp configuration. The output of the amplifier will then be used as the input to a circuit which will control a servomotor, causing the servomotor to rotate. The servo controller utilizes a comparator. You will now design and build a non-inverting amplifier circuit. 1. Build the power splitter shown in Figure 8 on your project board. 2. Select resistors which will provide a voltage gain of 10 for your amplifier. 3. Measure and record the values of the resistors you have chosen. 4. Assemble a non-inverting amplifier circuit as was done in the previous section. 5. From the power splitter on your project board, connect +vcc to +10 volts and \Gamma vcc to \Gamma 10 volts. Note: since we are amplifying a DC voltage, we will not need more than a \Gamma 2 to +10 volt power supply, however for simplicity we have constructed the power supply with a \Gamma 10 to 10 volt range. 6. Test the circuit by providing a small voltage to the non-inverting input of the amplifier. Verify that the voltage gain of the amplifier is approximately equal to the theoretical voltage gain. Analyze this circuit in your lab report to verify that it will amplify a small positive DC voltage by a factor of 10. 42 8 PSpice (to be done outside of lab) Read Chapter 3 (Section 6 Dependent Sources) in Rashid. In order for you to analyze certain devices such +- 75 \Omega 2 M\Omega + - + 5. v 2 10 (v - v ) v -v + - o Figure 2: PSpice model for the 741 op-amp. as op-amps and transistors using PSpice, you must use controlled sources. The following controlled sources are available: Voltage Controlled Voltage Source (VCVS), Voltage Controlled Current Source (VCCS), Current Controlled Voltage Source (CCVS) and Current Controlled Current Source (CCCS). These sources are specified in the following manner: ffl VCVS: Ename n+ n\Gamma nc+ nc\Gamma gain ffl VCCS: Gname nfrom nto nc+ nc\Gamma gain( 1\Omega ) ffl CCVS: Hname n+ n\Gamma vname gain(\Omega ) ffl CCCS: Fname nfrom nto vname gain nc+ and nc\Gamma are the nodes of the controlling voltage for voltage controlled sources (either voltage or current sources). vname is the name of the voltage source through which the controlling current flows for current controlled sources (either voltage or current sources). Note that the voltage source through which the controlling current flows can be a dummy (zero voltage) voltage source. Simulate the circuit you built and tested in Section 6.3 using PSpice and the op-amp model shown in Figure 2. Use a 1 volt peak-to-peak, 10 kHz sine wave as vS. Include the PSpice output in your lab report. Compare the theoretical voltage gain, the voltage gain resulting from your PSpice simulation, and the voltage gain measured in lab. Note: The input resistance of the op-amp model of Figure 2 is 2 M\Omega . The PSpice designator for 106 is MEG not M! PSpice is not case sensitive and therefore takes M as m which designates 10 \Gamma 3 not 106. 9 Questions Answer the following questions in your lab report. 1. Verify that the voltage gain of the circuit shown in Figure 6 is 1+ R2R 1 , using the same general procedureas outlined in Section 4.1. You may assume the op-amp is ideal. 2. We have seen some examples of clipping in an operational amplifier circuit. Explain how and why clipping should be accounted for in designing an amplifier circuit. More specifically, discuss the possible effects of clipping due to poor design in a high-fidelity audio amp. 43 3. Explain why vo turned on when it did in Section 6.4. 4. List several practic uses for a comparator. Hint: Think of contexts in which a physical quantity is compared to a threshold and a decision made based on the comparison. Examples include: fuel level in a gas tank (if below a threshold a dashboard light is illuminated), heart rate monitored in a hospital (if below a threshold a warning tone is produced). cc + ii v v+ v +v o -v cc Figure 3: Operational Amplifier 5 11 7 - + - + +Vcc+Vcc NCNC NC NC NC-Vcc 8910121314 1 2 3 4 6 Figure 4: 747 Operational Amplifier +- R3s R1 R2 R1 +Vcc -Vccv voi Figure 5: Inverting operational amplifier circuit 44 +- R1 R2 o R3 s v v Figure 6: Non-inverting operational amplifier circuit v 1 2vv -+ o+ -+ Figure 7: Operational amplifier as a comparator +- \Omega 1 k \Omega 1 k +Vcc -Vcc 20 V COMMON Figure 8: Power supply circuit v cc+v cc-v+-1 k\Omega 1 k\Omega +- P1 P2 o-+ Figure 9: Operational amplifier comparator circuit 45