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
Switched-mode power supply wikipedia , lookup
Alternating current wikipedia , lookup
Electrical ballast wikipedia , lookup
Buck converter wikipedia , lookup
Stray voltage wikipedia , lookup
Voltage optimisation wikipedia , lookup
Mains electricity wikipedia , lookup
Potentiometer wikipedia , lookup
ECE 3300 Lab 2 ECE 1250 Lab 5 Resistive Sensors Background: In an earlier lab you used the MyDAQ to measure resistance. You will repeat those measurements for several types of resistive sensors, including some you will build. In an earlier lab you built an LED 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 Photoresistor (R changes with light) o Graphite resistor (R changes with width, length – use this as a moisture sensor) o Thermistor (R changes with temperature) Build two types of circuits that respond to changes in resistance: o Op amp switch (for your photoresistor and one other sensor of your choice) o Op amp inverting amplifier (for your photoresistor) 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 ECE 1250 Lab 5 I. Resistive Sensors (20 points) A. PhotoResistor A photoresistor changes resistance (R ) with light. Measure the resistance of your photoresistor in several conditions: Table 1: condition Totally covered (no light) Ambient light (room light) Bright light (flashlight) Resistance Range for PhotoResistor: Rmin = R (ohms) Rmax = B. Graphite Resistors / Moisture Sensor Print 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 left and right sides of the resistors you have made, as shown. For the third and fourth resistor patterns, connect the alligator clips to the lower part of the pattern on the left and right sides. For these patterns, you will be investigating what happens when a parallel resistance becomes connected to the original pattern when water is added, but make the dry measurements for all patterns before you add water. There is no going back! For the first two resistors, you are looking at how the shape and size of the resistor affects its resistance. Before you measure the first two resistors, think about what you would expect to happen to the resistance when you make the pattern twice as wide. For the third and fourth patterns, think about how the resistance might change when the other side of the pattern becomes a resistance parallel to the first pattern (when water is added). The analysis of the fourth pattern is non-trivial. Your measurement is one piece of the puzzle. To add water, use a drop of water from your finger placed on the center of the resistor. Make up and try an additional resistor configuration. Try to get the largest possible range of Rmin to Rmax. Measure Rdry and Rwet for your resistor. Largest Resistance Range for Moisture Sensors: Rmin = Rmax = 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 ECE 1250 Lab 5 Patterns for graphite resistors: Rdry = Rwet = 1. 2. Rdry = Rwet = 3. Rdry = Rwet = 4. Rdry = Rwet = Fold Fold 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 ECE 1250 Lab 5 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 cup warmer) Resistance Range for Thermistor: Rmin = Rmax = 1 http://media.digikey.com/pdf/Data%20Sheets/Thermometrics%20Global%20Business%20PDFs/RL0503%20 Series.pdf 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 ECE 1250 Lab 5 II. Op Amp Switch: (40 points) In the first part of the lab, you experimented with resistive sensors for light, moisture, and temperature. 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 photoresistor 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. Use an LM324N Op Amp, a +15V power supply (V1), and a ground (0V) as the ‘negative’ power supply, as shown. This circuit consists of two voltage dividers across V1. The first voltage divider is formed by R3 and R4. R4 is your sensor, which will be your photoresistor when you build the circuit. As the resistance of the photoresistor changes, the voltage coming out of its voltage divider will change. The second voltage divider is formed by potentiometer R2, which is a single resistor with a third contact that moves back and forth along the resistor. The total resistance is constant, but the resistance on the top portion and bottom portion change as the "wiper" is moved up and down (with a screwdriver adjustment in an actual circuit). This behavior allows a single potentiometer to form a voltage source. The output of this second voltage divider is a set point or reference point which will be compared by the LM324 with the output of the first voltage divider. Figure 1 Op Amp Switch (Note: it is okay 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 represents the photoresistor, NOT a potentiometer.) Start with the approximate room lighting value of your photoresistor R4 = 10 kΩ (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. 2 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 ECE 1250 Lab 5 R4 Is LED Vo (expect 0 on or off? or +15V) OFF Notes: 10kohms Adjust R2 to just past the point where the (R4 at 50%) LED turns on. R2 = k ohms <10k ohms > 10k ohms Now swap connections to Vp and Vn and repeat: R4 Is LED Vo (expect 0 Notes: on or off? or +15V) 10kohms OFF Adjust R2 to just past the point where the (R4 at 50%) LED turns on. R2 = k ohms <10k ohms > 10k ohms =============================================================== 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 breadboard, as shown in Fig. 2. 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’ is located. 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. Fig. 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 photoresistor in place of the R4 pot. Remember to place the flat part of the LED toward the ground. With the photoresistor exposed to 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 ECE 1250 Lab 5 room lighting, adjust R2 until the LED has just turned on. Cover the photoresistor to turn the LED off. Swap the connections to Vp and Vn. Cover the photoresistor 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? (note divot on top end of chip, shown in Fig. 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… III. Op-Amp Non-Inverting Amplifier (40 points) In this part of the lab, you will design, build, and test an inverting amplifier (see Fig. 3) for your photoresistor. The goal is to be able to get as large a voltage difference on Vo as possible for the range of resistances of your photoresistor. Fig. 3. Photoresistor Amplifier. RCdS is the photoresistor. 1) What is the resistance of your photoresistor with room lighting? (from part I) R_roomtemp = =R1 When you build the circuit, you will adjust R1 to be equal to R_roomlight, so Vo=0 with room light. Use this value for R1 for the rest of the design. 2) What is the range of resistances for your photoresistor (from part I)? Rmin = Rmax= 3) What is the range of input voltage Vp (between R1 and RCdS) for the range of resistances of your photoresistor? We may calculate this votage, Vp, using superposition with sources VCC and –VCC. We obtain the following result: 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 ECE 1250 Lab 5 æR - R4 ö Vp = VCC ç CdS ÷ è RCdS + R4 ø Vp_min = Vp_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 Vp_min or Vp_max larger? Use this value to determine the maximum allowed amplification. That is, we want to amplify this value until it reaches the rail voltage (+/- 15V), (item "a" below): a) For a non-inverting amplifier: Vo = Vp (1 + R3/R2). b) Vo = (+/-) 15V 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 Error! Reference source not found.. R4 photoresistor Rmin = Rroomlight = 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 Photoresistor 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. Demo to a TA. Have the TA initial your lab notebook when it works. EXTRA CREDIT (20 points): Redesign your photoresistor amplifier circuit using a noninverting amplifier. Demo to a TA. Have the TA initial your lab notebook when it works. EXTRA CREDIT (20 points): Design either an inverting or non-inverting amplifier for one of your other resistive sensors. Demo to a TA. Have the TA initial your lab notebook when it works. 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 ECE 1250 Lab 5 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) Find an expression for Vp, and calculate it for your starting and ending conditions: 3 For example, in Fig. 1, start with photoresistor and room lighting (Rsensor = 10kohm) with the LED on, and turn the LED off when it gets darker (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 ECE 1250 Lab 5 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. 7) 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. 8) Report your results. Have the TA initial your lab notebook that it worked! 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