Вы находитесь на странице: 1из 5

ECE154

Embedded Systems

Fall 2011

Lab 3 A/D conversion: digital thermometer


This will be due Friday 10/7/11. You should complete everything except the calibration portion by then; we will do the calibration together in the lab. Your report will be due Wednesday 10/12/11 as the results of the calibration are required for the write-up. Our objective is to build a digital thermometer that will display the current temperature on a 3-digit LED display in either Fahrenheit or Celsius. Our desired temperature range is 0-100 C (32-212 F). The thermometer will also keep track of the highest and lowest temperatures seen and display them on demand. You will use a toggle switch to select F or C and 2 momentary pushbutton switches to call up the minimum and maximum stored values, displaying them for 2s when the corresponding pushbutton is pressed, and then reverting to standard current-temperature mode. The LED display will use Time Division Multiplexing to display a 3-digit value. Some (but not all!) of you will need to modify your display designs from lab 2 to accommodate a 3 digit display that is bright enough to read in normal ambient light! Your display should also not suffer from noticeable flicker or ghosting. You must be within specifications on your selected display buffer or drive components! We have discussed the on-chip A/D converter on the 6811/12 microcomputers in class; we will need only a single analog channel in this lab, though you might think about making a system capable of monitoring several thermal sensors and displaying the desired channel on demand (i.e. and inside/outside thermometer!). We will operate this channel in single scan mode, so your code will need to poll CCF, the Conversion Complete Flag, every time you request a new scan to know when it is complete. I would like for you to write the first version of the software for this project with polling and delay loops; as a subsequent lab 4 we will rewrite this code to be interrupt driven, but for now please use polling. IF YOU WANT TO GET PRACTICE USING THE INTENDED MICROCONTROLLER FOR YOUR PROJECT (Pic, Atmega, ) INSTEAD OF THE 68HC711E9, TALK TO ME WE WILL WORK OUT MODIFICATIONS TO THESE DELIVERABLES.

9/28/2011 11:21 AM

186

ECE154

Embedded Systems

Fall 2011

For 2011 there will be two options for the temperature sensor. TEMEPEATURE SENSOR OPTION 1 Direct Voltage Sensor with student-designed auxiliary circuitry We have the Analog Devices AD22100KTZ temperature sensor, which outputs a voltage proportional to the current temperature. This sensor may be hooked up with just a simple R-C buffer (as on page 1 of its spec sheet) directly to the ADC input. The disadvantage of using this sensor as is is that it will only exploit a fraction of the available voltage range over the temperature range of interest. This will be unacceptable as is for our lab. If you choose to use the AD22100, you must devise a means for the full dynamic range of the 8-bit ADC to be exploited over the temperature range of interest. IF YOU CHOOSE TO USE THE AD22100: Q1: By studying the spec sheet, what do you expect the voltage range of the unmodified AD22100KTZ corresponding to temperatures between 0C and 100C to be? Q2: What does the range in Q1 imply about the precision of your thermometer compared with one that utilizes the full dynamic range of the ADC? (Quantitative statements please!) Q3: Design a voltage-to-voltage converter circuit or some other equivalent meqans to expand the dynamic range of your sensor to fully exploit the ADC range. TEMPERATURE SENSOR OPTION 2 High resolution current sensor with provided conversion circuit. This is the sensor we have used successfully in past years; along with the support circuit given below it has the advantage of exploiting the full dynamic range of our ADC over the temperature range of interest. We will use the Analog Devices AD590 temperature sensor, its data sheets are on the course web site, as are those for the op-amp referenced below. The AD590 is a 2-terminal device; the packaging we have has a third lead which you can leave unconnected, but better practice would be to ground 9/28/2011 11:21 AM 187

ECE154

Embedded Systems

Fall 2011

this third lead as this will allow the metal case to act as a shield against electrical interference. The AD590 produces a current proportional to the ambient temperature; according to its specifications it produces a linear current output varying by 1 A/K over a wide temperature range (-55C-+150C). Our A/D converter measures voltage, not current, so we will need to convert this temperature-varying current into a linearly varying voltage. We plan to use the on-board power supply (nominally 0-5V) so this specifies the range of our conversion from 0-100C. Thus we want a circuit whose voltage varies by 50 mV/C. Here is an analog signal processing circuit (Figure 1) to generate the desired voltage and a list of the required components (Table 1) (courtesy of EE324 at Penn State):

Figure 1. An analog signal processing circuit for the AD590. Table 1. Components list for the circuit in figure 1. Symbol Component Value or Device Name R1 10 K R2 470 K R3 1K R4 1 K Pot. R5 12 K U1 LMC660 Quad Op Amp

9/28/2011 11:21 AM

188

ECE154

Embedded Systems

Fall 2011

Note that the potentiometer is critical in calibrating the circuit. Operation is very sensitive to adjustment of potentiometer, so use 10-turn pots, not 1-turn pots. It is easy for thermometer to appear nonfunctional if the pot is far away from correct setting. Do your freezing calibration (below) to just above 32 (say 33) so we know we have not pegged the range. Prior to the calibration exercise, (solderlessly) attach your sensor to long lead wires (24 or more) so we can easily put the sensor in the hot and cold baths. Alligator clips with adequate insulation should be ok. Some questions to test your analog analysis capabilities: Q1: Assume that the op-amps are ideal and the component values listed in table 1 are exact; compute the transimpedance of the circuit, v T(t)/ iT(t). If the AD590 produces 1 A/ K as specified in its datasheet, does the circuit in figure 5 produce an output voltage with the desired scale factor, KT, of 50 mV/ C? Explain your answer and justify it by analyzing the operation of the relevant portion of the circuit. Q2: Explain the function of the voltage divider formed by R5 and the potentiometer R4. (Hint: Assume R1 is grounded. What is the output voltage vT(t) when the temperature is 0 C.) Why is the potentiometer output buffered with the voltage follower? Q3: Repeat the computations for Q1 with the actual resistor values and the measured value of your power supply (presumably slightly different from 5V). What is the expected transimpedance of the actual circuit? What is the expected scale factor, KT? Regardless of which sensor you used, you will need to calibrate your thermometer. To calibrate your thermometer, we need to use two known temperatures; two easy targets are waters freezing and boiling temperatures. We will actually use mineral oil for the bath since if we dip the temperature sensor in water we short it out..! We will do the calibration procedure in the lab as part of demonstrating your thermometer to me when it is due. Those who use the AD590 have both a hardware calibration (potentiometer) and a software calibration to make; those using the AD22100 are likely to do their calibration in software.

9/28/2011 11:21 AM

189

ECE154 The calibration procedure:

Embedded Systems

Fall 2011

Place the sensor in the ice bath and allow the device to reach thermal equilibrium. For the AD590, adjust the potentiometer so that the steady state output voltage vT(t) is 0V For the AD22100, note the measured voltage so you can adjust the appropriate constant in your code.. Q4: For the AD590, measure the voltage across R3 while the sensor is immersed in the ice bath. For the AD22100, measure the sensor output at ice temperature. What is the steady state voltage? Place the sensor in the boiling water bath and allow the device to reach thermal equilibrium. Record vT(t). WARNING! DO NOT move the sensor directly from the ice bath to the boiling water bath as the temperature shock could damage the device! Allow the sensor to come to room temperature before moving to the boiling water bath! Q5: For the AD590, measure the voltage across R3 while the sensor is immersed in the boiling water bath. What is the steady state voltage? What is the steady state value of vT(t)? For the AD22100, measure the senor output. What is the voltage? Q6: (BOTH SENSORS) Based on you measurement of R3 in the AD590 case and the measurements of questions 4 and 5, determine the actual temperature coefficient of your sensor. How does it compare with the specifications? Use this information to compute the actual temperature scale factor KT for your circuit, adjust your software to compensate for this difference, and test the functionality of your completed project. I will want to see this work! With the AD590, a source of problems in past years has been a saturated calibration at either the 0/32 or 100/212 ends; after calibration, do a sanity check at room temperature again as well to make sure the full range is being exercised. In your writeup, follow the same procedures as for earlier labs; dont forget your flowchart(s)!

9/28/2011 11:21 AM

190

Вам также может понравиться