Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
ECE 3300 Lab 2 ECE 1250 Lab 4 Name __________________________ Lab Section ___ Student Folder # ____ Resistive Sensors Background: In Lab 1 you used the MyDAQ to measure resistance. You will repeat those measurements for several types of resistive sensors, including some you will build. In Lab 2 you built an LED/Zener diode resistance indicator. In this lab you will build a different kind of circuit – an op amp switch to respond to changes in resistance. Overview: In this lab you will: Test several types of resistive sensors: o Thermistor (R changes with temperature) o Photoresistor (R changes with light) o Graphite resistor (R changes with width, length – use this as a moisture sensor) Build two types of circuits that respond to changes in resistance: o Op amp switch (for your thermistor and one other sensor of your choice) o Op amp inverting amplifier (for your thermistor) Equipment List: MyDAQ board with cables. (You can hook them to the lab computers if you don’t want to bring your laptop.) Multisim software. (This is also running on the lab computers) Protoboard & wire kit 2 Alligator clips (to clip onto hand-drawn resistors) Small amount of tap water in a cup. Thermistor RL0503-5820-97-MS Photoresistor PDV-P8103 LM324N Op Amp (or other op amp, look up the data sheet online to find pin diagram) Graphite pencil, paper Resistors: 1k, 10k ohm (from previous labs) Potentiometers: 50k,100k (ok to substitute smaller pots in series with regular resistors) LED (any color) (from previous lab) Instructions & Reference Material: (See Online Lab Page for data sheets, etc.) 1 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu I. Resistive Sensors (20 points) A. Thermistor A thermistor changes resistance (R ) with temperature. Measure the resistance of your thermistor in several conditions. Estimate the temperature of each measurement above using the data sheet1 for the thermistor. Table 1: condition R (ohms) Measured Approx T(C) (from data sheet) Room Temp (about 25 C) Body Temp (hold between your fingers) Cold (use ice, please don’t pop ice pack) Hot (use hot pack) Resistance Range for Thermistor: Rmin = Rmax = B. PhotoResistor A photoresistor changes resistance (R ) with light. Measure the resistance of your photoresistor in several conditions: Table 1: condition Totally covered (no light) Half covered (use paper or tape) Totally uncovered (full light) Resistance Range for PhotoResistor: Rmin = R (ohms) Rmax = C. Graphite Resistors / Moisture Sensor Tear out the following page. Use a graphite pencil to fill in the rectangular boxes to create graphite resistors. Fold the paper over to make it easy to clip alligator clips onto the resistors you have made, as shown. Measure the dry resistance of each configuration. Make up and try an additional configuration. Repeat with a drop of water (from your finger) in the center of the resistor. This gives you Rwet. Resistance Range for Moisture Sensor: Rmin = Rmax = 1 http://media.digikey.com/pdf/Data%20Sheets/Thermometrics%20Global%20Business%20PDFs/RL0503%20 Series.pdf 2 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu Test Sheet for Graphite Resistors (Remove from report before wetting) Rdry = Rwet = 1. Rdry = Rwet = 2. 3. Rdry = Rwet = 4. Rdry = Rwet = Fold 5. Fold Your choice (make one up). Try to get the largest possible range of Rmin to Rmax 3 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu 4 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu II. Op Amp Switch: (40 points) In the first part of the lab, you experimented with resistive sensors for temperature, light, and moisture. In this part of the lab, you will design, build, and test an op amp switch that can turn on an LED or other device when resistance changes. We will experiment with the thermistor first, but the switch (section II) and amplifier circuits (section III) you build can be used for other sensors, too, which you will do in section IV. A. Simulate an Op Amp Switch:2 Simulate the op amp switch below. You should have simulated something very similar to this in your op amp homework. Use an LM324N Op Amp, a +15V power supply (V1), and a ground (0V) as the ‘negative’ power supply, as shown. Figure 1 Op Amp Switch (Note: it is ok to substitute a 10k or 20k pot for the 50k pot if needed, but your tuning will be less sensitive. Also Note: The 20k pot shown here is actually the thermistor, NOT a pot.) Start with the room temperature value of your thermistor R4 = 10kohms (the R4 potentiometer at 50%). Tune (adjust) the R2 potentiometer until the LED is barely off. Then increase and decrease the sensor resistance (adjust the R2 potentiometer), and notice when the LED is on/off. R4 Is LED Vo (expect 0 on or off? or +15V) OFF 10kohms (R4 at 50%) <10k ohms > 10k ohms Now swap Vp and Vn and repeat: R4 Is LED Vo (expect 0 on or off? or +15V) 10kohms OFF (R4 at 50%) <10k ohms > 10k ohms 2 Notes: Adjust R2 so LED is barely off R2 = k ohms Notes: Adjust R2 so LED is barely off R2 = k ohms Multisim file is available on the lab 4 canvas page. 5 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu =============================================================== EXTRA CREDIT (10 points) Use the Multimeter tool (shown above for voltage) to ‘test’ all of the currents in this circuit. It is pretty cool to put down 2 different voltage sources (one for the input attached to R2 and R4, one for the op amp and output (attached to Vcc and R1)) and see where the current is coming from in the circuit. =============================================================== B. Build and test the Op Amp Switch: 1) Start by placing the op amp in your protoboard, as shown. Note the small circular cutout at the top of the op amp DIP package. Sometimes this is just a small round dot in the upper left corner. This tells you which side is up, and where pin ‘1’ starts. Pin numbers always start in the upper left and proceed counter clockwise to the upper right. The LM324N package has FOUR op amps in one package. For example, use pins 1(1OUT as your Vo), 2 (1IN- as your Vn), and 3 (1IN+ as your Vp). Note that Multisim will indicate which pins to hook up if you have chosen the correct package in your simulation. + Figure 2 LM324 Op Amp Pin Out Diagram (See online video for details on hooking up an op amp) 2) Connect power. Vcc (+15V) is pin 4. Gnd (AGND=0V) is pin 11. Wire these up to your MyDAQ. 3) Build the circuit in Figure 1. Put the Thermistor in place of the R4 pot. Remember to place the flat part of the LED pointing down to the ground. With the thermistor at room temperature, adjust R2 until the LED is barely off. Cool the thermistor to turn the LED on. Swap Vp and Vn. Warm the thermistor to turn the LED on. It works! Ok, what if it doesn’t? Debug: Check Vcc and Gnd at every point where you expect them to be (top/bottom of each voltage divider, at the op amp chip, and in the LED circuit). Especially be sure you powered your op amp (pin 4 = 15V and pin 11 = 0V). Is your op amp in the right direction ? (see dibet at top, shown in Figure 2) Is your LED in the right direction? (flat side towards ground) Check Vp and Vn. They should be approximately equal at room temp. Multisim will tell you the values to expect throughout the circuit. Check Vo. If Vp>Vn, Vo should be +15V. If Vp<Vn, Vo should be 0V. Is your op amp burned out? Try another one… 6 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu III. Op Amp Inverting Amplifier (40 points) In this part of the lab, you will design, build, and test an inverting amplifier (see Figure 3) for your thermistor. The goal is to be able to get as large a voltage difference on Vo as possible for the range of resistances of your thermistor. Figure 3 Thermistor Amplifier. The values of components indicated here are approximate. Record on this figure the actual values you use. 1) What is the resistance of your thermistor at room temp? (from part I) R_roomtemp = =R1 When you build the circuit, you will adjust R1 to be equal to R_roomtemp, so Vo=0 at room temp. Use this value for R1 for the rest of the design. 2) What is the range of resistances for your thermistor (from part I)? Rmin = Rmax= 3) What is the range of input voltage Va for the range of resistances of your op amp? Calculate Va from the bipolar voltage divider (See Voltage Divider Cookbook in your course notes): 2 R1 Va V 1 1 R1 R 4 Va_min = Va_max = 4) We want to get the largest possible swing (change) in Vo for the range of input voltages above. Is the absolute value of Va_min or Va_max larger? Use this value to design the amplification. We want to amplify this value until it reaches the rail voltage (+/- 15V). a) For an inverting amplifier: Vo = Va (-R3/R2) = (+/-) 15V 7 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu b) There is one other important consideration for R2,R3, and that is to limit the current going through them. If you don’t limit the current, it will change the voltage divider (R1-R4), and mess up your calculation for Va. Choose R2+R3 > 100kohms. Choose values for R2 and R3. Use either standard value resistors or potentiometers. R2 = R3= 5 ) Simulate your circuit with Multisim to be sure it will work. (the file for Figure 3 is on the lab website) . Adjust the values for R4 (thermistor) to be Rmin, Rmax, and Rroom temp, and measure the associated Vo values. Record the values of components used in Figure 3 above. R4 thermistor Rmin = Rroomtemp = Rmax = Va expected Vo expected 0V 5) Build and test your circuit. For this circuit, use +15V on pin 4 of the op amp and -15V on pin 11. Note that -15V is used at the bottom of the voltage divider (connected at the bottom of R1) Be sure to include the values of the components you use in Figure 3. R4 thermistor Rmin = Rroomtemp = Rmax = Va measured Vo measured Note: Here are several other extra credit options. You may want to try them at home, which is fine. To receive credit, either demo them to any TA, or your TA at the start of the next lab, or take a video of your working circuit and turn it in online. EXTRA CREDIT (20 points): Create a 3-LED voltage indicator (similar to Lab 3) for your Thermistor Amplifier. You can put Vo either at the top of your indicator (as in Lab 3) or the bottom (as in the op amp switch in part II of this lab). Remember Vo now goes from negative to positive, and you will probably have to adjust the ranges of resistances used. Depending on your design, you may also want different voltage values of zener diodes, and the stockroom has several choices. Demo to a TA: initial here_______ EXTRA CREDIT (20 points): Redesign your thermistor amplifier circuit using a noninverting amplifier. Demo to a TA: initial here_______ EXTRA CREDIT (20 points): Design either an inverting or non-inverting amplifier for one of your other resistive sensors. Demo to a TA: initial here ______ 8 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu EXTRA CREDIT (20 points) Design an Op Amp Switch for one of your other sensors. Here is how to do it: 1) Specify your system: From Part I: Which Sensor? (you choose) Rmin = Rmax = What do you want your system to do?3 Start at _____________________(Initial condition) Rsensor = _________ LED on /off Change to(end)_____________________________ Rsensor = _________ LED on / off 2) Sketch your circuit below, specify the value of all components (described in the sections below): 3) The resistive sensor (R4) and R3 form a voltage divider to create Vp. General design rule #1: Make R3 and R4 roughly equal (or at least similar) over the range (Rmin to Rmax) of your sensor, so that Vp will be approx. half of V1. Choose R3 = ______________ (=Rsensor at your start condition is a good initial choice) 3 For example, in Figure 1, start with thermistor at room temperature (Rsensor = 10kohm) with the LED off, and turn the LED on when it gets colder (Rsensor increases)…. 9 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu Find an expression for Vp, and calculate what it will be at your starting and ending conditions: Vp = Vp (start) = Vp (end) = General design rule #2: Be sure the combination of R3 and R4 is high enough that the current won’t burn them out. Find an expression for I3, and calculate what its minimum and maximum value will be for your sensor. I3 = I3min = I3max = Calculate the maximum power delivered to R3, and be sure it is under ¼ Watt: P3 max = (I3max)(Vpmax) = 4) The potentiometer (R2) is used to tune Vn so it is = Vp at your initial condition. The two sides of the pot create a voltage divider that produces Vn. Choose R2 > (R3+R4_max). HINT: When you tune your circuit (see section II step 3), tune R2 so that the LED is barely on/off depending on you start condition. It should be barely at the start condition, whichever that is.) Potentiometer R2 = 5) LED circuit: Remember from Lab 2, the maximum current through the LED is 20mA. For Vcc = 15V and Vo = 0V, the LED will be on. The voltage drop across the LED is about 1.8V, so the total voltage across R1 is about 13.2V. Choose a standard resistance value R1 so Iled < 20 mA: R1 = 6) Design Vo. This circuit has no feedback. Use the ideal op amp equation: Vo = A (Vp-Vn) where 0 < Vo < +15V. For a switch,use the two Vo ‘rails’: Input Vp > Vn Vp < Vn Vo +15V 0 LED off on Decide which way to hook up Vp and Vn (Vp-Vn as in Figure 1or swapped). Draw your circuit below, and use Multisim to check to see if it will work. 10 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu 7) Use Multisim to be sure the current supplied by your power supply (V1) is within the range of the MyDAQ (<32mA). If it is higher, the MyDAQ voltage will be drawn down (reduced). 8) Build your circuit. Tune the circuit by adjusting the R2 pot so that your LED is barely at your starting condition (on/off). Test the circuit. 9) Report your results below. Have the TA initial here ______ that it worked! 11 UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu