Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits 1. Learning Outcomes In this lab, the students evaluate characteristics of the non-ideal operational amplifiers. Students use a simulation tool (LTspice) to simulate the two most popular configurations op-amp circuits: inverting and non-inverting amplifiers. Students also build, predict the results, and observe the gain and frequency response of the amplifiers. 2. Health and Safety Any laboratory environment may contain conditions that are potentially hazardous to a person s health if not handled appropriately. The Electrical Engineering laboratories obviously have electrical potentials that may be lethal and must be treated with respect. In addition, there are also mechanical hazards, particularly when dealing with rotating machines, and chemical hazards because of the materials used in various components. Our LEARNING OUTCOME is to educate all laboratory users to be able to handle laboratory materials and situations safely and thereby ensure a safe and healthy experience for all. Watch for posted information in and around the laboratories, and on the class web site. 3. Lab Report Students work in groups of 2 with laboratories being on alternative week (in 2C80/82). Each student must have a lab book for the labs. The lab book is used for lab preparation, notes, record, and lab reports. The lab books must be handed before 5:00 pm on the due date (same day of the following week) into the box labeled for your section across from 2C94. The lab books are marked and returned before the next lab. Marking Scheme All labs must be performed and a lab write-up submitted in order to pass the class. If one or more labs have not been performed, then a grade of INC (incomplete) will be submitted. You will be required to demonstrate correct operation of various parts of the lab to a lab instructor during your scheduled lab period (these parts are highlighted in the lab procedure section) to be considered as having "completed" the lab. A mark for each lab will be assigned based upon your submitted lab book. Lab books can be considered to be fulfilling the same functions as logbooks in industry. Logbooks are used to record the results of all tests performed on systems, subsystems and equipment during the various phases of a project including R&D, design, systems integration, etc. Logbooks are official, permanent documents, and can be used in court to prove ownership of a design! The following points must be followed when writing up lab reports: The first page must contain a table of contents. All pages in the lab book must be numbered. Formal structure is not critical; logical order is important. Rev D Copyright 2015 University of Saskatchewan Page 1 of 16
Try to use pen, avoid pencil. Legibility and neatness are important, as is orderly notes. The lab book is standalone. There should be no references to any outside documents. Remember that you may be allowed to bring in your lab books for the final exam. They are your cheat sheets make sure they re complete! Theory and background information must be completed prior to the lab. Cross out unwanted or erroneous material with a single large X. Do not remove any pages from your lab book. The left-hand page can be used for rough calculations, notes, measurements, etc. This page is not considered part of the official write-up, unless you ask that it be considered. Do not cut and paste any material from the lab manual into your lab book; only graphs, plots, experimental waveforms, and schematics can. Use glue wherever possible; tape is acceptable, but staples are not! One lab partner must have the original of any experimental waveform; his/her partner may have a photocopy of that waveform. Label all diagrams and schematics; include an equipment list. Schematic diagrams and waveforms without explanation are not acceptable. Discussion of results and/or conclusions resulting from each portion of the lab should be found with that portion. The end of the lab should have a short summary of all conclusions. The instructors may request you to hand-in your lab books at the end of the term for accreditation purposes. If in doubt about what to include (and how), remember that it should be clear, concise and complete. 4. Material and Equipment Material (supplied by department) TL081 op-amp Resistors: 2 x 1 kω, 1 x 10 kω Capacitors: 1 x 470 pf Equipment (supplied by student) Analog Discovery Module Waveforms software Breadboard and wiring kit Rev D Copyright 2015 University of Saskatchewan Page 2 of 16
5. Prelab The TL081 Op-Amp is used for this lab. The pin-out diagram for the TL081 op-amp IC is shown in Figure 5-1. 8 dot 1 4 Figure 5-1: TL081 Op-Amp 1. Check a TL081 datasheet (google "TL081") and make note of the following ratings: Rating Maximum Positive Supply Voltage Maximum Negative Supply Voltage Maximum Input Voltage Power Dissipation (@ 25C) Input Resistance Value 2. Determine the gain of the inverting amplifier shown in Figure 6-1 (ignore the Capacitor C1). 3. Simulate the inverting amplifier shown in Figure 6-1 using SPICE (see Appendix A on how to run LTSpice) and include a screen shot of the output plot. A SPICE circuit file for the inverting amplifier is shown in Figure 5-2. An on-line SPICE Reference Manual can be found at http://www.eecg.toronto.edu/~kphang/teaching/spice/index.html 4. Determine the gain of the non-inverting amplifier shown in Figure 6-6 (ignore the Capacitor C1). 5. Simulate the non-inverting amplifier shown in Figure 6-6 using SPICE and include a screen shot of the output plot. You will need to modify the SPICE circuit file from the inverting amplifier. Rev D Copyright 2015 University of Saskatchewan Page 3 of 16
Inverting Amplifier ** Subcircuit: ideal_opamp ** Voltage controlled voltage source.subckt ideal_opamp 1 2 3 Evcvs 1 0 2 3 1e6 ; V_1_0 = V_2_3 * 1e6.ends ideal_opamp ** Inverting Amplifier Circuit Vin Vin 0 DC 0 AC 100mV ; Input voltage 100 mv AC signal R1 Vin 2 1k ; 1 kohm input resistor R2 2 Vo 10k ; 10 kohm feedback resistor C2 2 Vo 470pF ; 470 pf feedback capacitor R3 Vo 0 1k ; 1 kohm load resistor on output XA1 Vo 0 2 ideal_opamp ; Op Amp subcircuit set up with negative feedback ** Analysis.AC LIN 100 1Hz 100kHz ; AC analysis from 1 Hz to 100 khz.end Figure 5-2: Inverting Amplifier SPICE Circuit File Rev D Copyright 2015 University of Saskatchewan Page 4 of 16
6. Lab Procedures Debugging (or What To Try When Things Aren't Working) There are a number of things/procedures you should use to debugging circuits when things are not working correctly. These include (but are not limited to): Check that all component pins are correctly inserted in the breadboard (sometimes they get bent underneath a component). Make sure that components are not "misaligned" in the breadboard (e.g. off by one row). Double check component values (you can measure resistors, capacitors, and inductors). Try a different section in the breadboard (in case there is a bad internal connection). Measure the source voltages to verify power input. Measure key points in the circuit for proper voltage/waveform (i.e. divide-and-conquer). Inverting Amplifier One of the most common applications of the op-amp is the simple inverting amplifier. The output is inverted relative to the input and the amplification gain is determined by the ratio of the feedback resistor (R2) to the input resistor (R1). 1. Construct the circuit shown in Figure 6-1 on your breadboard. A Resistor Colour Chart can be found in Appendix B and an ADM Pin Out in Appendix C: 1.1. The +5 V supply is provide by V+ of the ADM (red wire) and the -5 V supply is provided by V- of the ADM (white wire). 1.2. V in is supplied by the Arbitrary Waveform Generator W1 (yellow wire), make sure to include at least one ground (black wire). 1.3. An example of a circuit layout is shown in Figure 6-2. C1 470 pf R2 10 kω R1 1 kω +5 V _ TL081 + Vo Vin -5 V R3 1 kω Figure 6-1: Inverting Amplifier Circuit Schematic Rev D Copyright 2015 University of Saskatchewan Page 5 of 16
2. Use the "Voltage" tool (available on the main screen of the WaveForms software) to turn on the V+ and V- supplies. 3. Set "Vin" to be a 100 mv 1 khz sine wave using the "WaveGen" tool as shown in Figure 6-3 and turn on by pressing "Run AWG 1". 4. Connect "Channel 1" to measure the input voltage "Vin" (relative to ground). Channel 1 is the voltage difference between 1+ (orange wire, also called "Scope Channel 1 Positive") and 1- (orange/white wire, also called "Scope Channel 1 Negative"). 5. Connect "Channel 2" to measure the output voltage "Vo" (relative to ground). Channel 2 is the voltage difference between 2+ (blue wire, also called "Scope Channel 2 Positive") and 2- (blue/white wire, also called "Scope Channel 2 Negative"). Figure 6-2: Inverting Amplifier Example Layout Rev D Copyright 2015 University of Saskatchewan Page 6 of 16
Figure 6-3: Arbitrary Waveform Generator 1 Setting 6. Bring up the Oscilloscope window by selecting "Scope" from the WaveForms main screen. Press "AutoSet" and the Oscilloscope window should look similar to Figure 6-4 if everything is working correctly. 7. To be able to better see and measure the waveforms: 7.1. Set "C1 Offset" = "C2 Offset" = 0 V, set "Time Base" = 200 us/div, set "C1 Range" = 50 mv/div and set "C2 Range" = 500 mv/div. 7.2. Click on the "Measure" option and "Add": 7.2.1. "Channel 1 Horizontal Frequency Average" 7.2.2. "Channel 1 Vertical Amplitude" 7.2.3. "Channel 2 Vertical Amplitude" 7.3. The Oscilloscope window should look similar to Figure 6-5. Include a screen capture in your report. REQUIRED: Demonstrate to a lab instructor and make sure your demonstration is recorded by the lab instructor. Figure 6-4: Oscilloscope Window After AutoSet Rev D Copyright 2015 University of Saskatchewan Page 7 of 16
8. Measure and fill in the values for the table below (be sure to include units). You will need to adjust "Time Base" so that the sine waves are discernable as you change frequency. You can click on "Single" if you want to freeze the capture and read off the Measurements. Frequency Vin Amplitude Vo Amplitude Gain = Vo/Vin Modeled Vo from Prelab 1 khz 5 khz Every 5 khz until 100 khz 9. Comment on what happens to the relative "phase" (delay) between the input and output voltages when the frequency is changed from 1 khz to 100 khz. Figure 6-5: Oscilloscope Window With Measurements 10. Determine the frequency at which the gain equals 0.707 of the maximum gain: 10.1. This is most easily accomplished by determining the target Vo, and using the slider on the Frequency parameter in AWG1, move the slider until the "C2 Amplitude" closely matches as possible to the target Vo. Note that setting appropriate "Max" and "Min" value for the slider makes it easier. You may need to adjust "Time Base" so that you only see a few cycles of the sine waves (to get reasonable measurements) as you change frequency. 10.2. Include a screen capture of the Oscilloscope window showing the found 0.707 gain point. 10.3. Is there a specific name for this frequency? Rev D Copyright 2015 University of Saskatchewan Page 8 of 16
11. Remove Capacitor C1. Measure and fill in the values for the table below (be sure to include units): Frequency Vin Amplitude Vo Amplitude Gain = Vo/Vin 1 khz 5 khz 10 khz 20 khz 50 khz 100 khz 12. Plot the output voltage Vo versus Frequency for the measured Vo from step 6.2.8 and step 6.2.11 and the simulated Vo from Prelab 5.3. Rev D Copyright 2015 University of Saskatchewan Page 9 of 16
Non-Inverting Amplifier 1. Construct the circuit shown in Figure 6-6 on your breadboard. C1 470 pf R2 R1 1 kω 10 kω +5 V _ TL081 + Vo Vin -5 V R3 1 kω 2. Set "Vin" to be a 100 mv 1 khz sine wave. Figure 6-6: Non-Inverting Amplifier Circuit Schematic 3. Connect "Channel 1" to measure the input voltage "Vin" and connect "Channel 2" to measure the output voltage "Vo". 4. Similar to section 6.2, bring up the Oscilloscope window and adjust its parameters (including the Measurement functions) to provide a good picture of the input and output voltages. Include a screen capture in your report. REQUIRED: Demonstrate to a lab instructor and make sure your demonstration is recorded by the lab instructor. 5. Measure and fill in the values for the table below (be sure to include units): Frequency Vin Amplitude Vo Amplitude Gain = Vo/Vin Modeled Vo from Prelab 1 khz 5 khz Every 5 khz until 100 khz 6. Comment on what happens to the relative "phase" (delay) between the input and output voltages when the frequency is changed from 1 khz to 100 khz. 7. Determine the frequency at which the gain equals 0.707 of the maximum gain. Include a screen capture of the Oscilloscope window showing the found 0.707 gain point. Rev D Copyright 2015 University of Saskatchewan Page 10 of 16
8. Remove Capacitor C1. Measure and fill in the values for the table below (be sure to include units): Frequency Vin Amplitude Vo Amplitude Gain = Vo/Vin 1 khz 5 khz 10 khz 20 khz 50 khz 100 khz 9. Plot the output voltage Vo versus Frequency for the measured Vo from step 6.3.5 and step 6.3.8 and the simulated Vo from Prelab 5.5. Rev D Copyright 2015 University of Saskatchewan Page 11 of 16
Appendix A SPICE "SPICE (Simulation Program with Integrated Circuit Emphasis) is a general-purpose, open source analog electronic circuit simulator. It is a powerful program that is used in integrated circuit and board-level design to check the integrity of circuit designs and to predict circuit behavior" (from Wikipedia). There are a number of freeware SPICE simulation programs available. "LTspice IV" is available on the Engineering computers in the "Electrical Engineering" folder under the Start menu. It can also be downloaded to your home computer from http://www.linear.com/designtools/software/#ltspice. To run a simulation: 1. Create a text file with the SPICE circuit description with a ".cir" extension (a good Windows text editor is Notepad++ can be found at https://notepad-plus-plus.org). 2. Run "LTspice IV" and "File Open" the file from step 1 (make sure you select "Files of type: Netlists (*.cir, *.net, *.sp)"). Your screen should look similar to Figure A-1. Figure A-1: LTspice IV Circuit Description 3. Select the "Simulate Run" menu item to run the simulation. A blank plot window should be opened as shown in Figure A-2. 4. Select the "Plot Settings Add trace" menu item. Select the "V(vin)" and "V(vo)" traces to plot as shown in Figure A-3. 5. Maximize the plot window. The screen should look similar to Figure A-4. Note that the vertical scale is in "db". Change the range using the "Plot Settings Manual Limits" menu item to match what is shown in Figure A-5. The final plot window should now look similar to Figure A-6. Rev D Copyright 2015 University of Saskatchewan Page 12 of 16
Figure A-2: Initial Plot Window Figure A-3: Add Traces Dialog Figure A-4: Maximized Plot Window Rev D Copyright 2015 University of Saskatchewan Page 13 of 16
Figure A-5: Plot Limits Dialog Figure A-6: Final Plot Rev D Copyright 2015 University of Saskatchewan Page 14 of 16
Appendix B - Resistor Colour Codes http://itll.colorado.edu/electronics_center/resistor_chart/ Rev D Copyright 2015 University of Saskatchewan Page 15 of 16
Appendix C - ADM Pin Out Rev D Copyright 2015 University of Saskatchewan Page 16 of 16