You are on page 1of 9

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17 Overview

Spring 2014

Temperature is one of the most commonly measured variables. While it is straight forward to explain that temperature is a measure of the average kinetic energy of particles in matter, it is incredibly difficult to measure with great accuracy or precision. This week, you will use a thermistor (a thermally sensitive resistor) to measure temperature. You will then use that thermistor with LabVIEW to build a crude thermostat to control a fan. Useful background information regarding thermistors can be found in section 14.3 of Morris and Langari. By the end of this lab you should be able to: Understand the principles underlying thermistor function Understand and implement a voltage divider circuit for temperature measurement Calibrate a thermistor and describe sources of error Build a simple feedback controller Exercise 1 Calibrating a Thermistor Introduction While the resistivity of many materials is sensitive to temperature, thermistors are unique in their ability to decrease resistance as temperature increases. This property arises because, unlike most resistors made from pure metals, thermistors are made from two or more semiconductors. Semiconductor powder is mixed with a binding agent to form a slurry, small drops of which are formed over two lead wires. This is then dried and put into a sintering furnace, where metallic oxides shrink onto the lead wires to form an electrical connection. This bead is then sealed in glass or plastic to insulate it from environmental moisture. These beads can be made quite small. There are several advantages of using thermistors to measure temperature. They are very sensitive (large change in resistance for a small change in temperature) so small changes in temperature can be easily measured. Their small size is beneficial for two reasons: (1) they can be used almost anywhere and (2) they have a very low time constant, so they rapidly reach equilibrium upon a step change in temperature. One drawback to thermistors is their non-linear response to temperature, so their static sensitivity is not static, but varies as a function of temperature. Another difficulty in their use is that as temperature rises, resistance may drop to such a low level that you draw too much current (causing self-heating), or you cause a voltage loading error. Since they are a semiconductor device, they are limited to measuring temperatures below 300 C.

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

The functional relationship between resistance and temperature for thermistors is an exponential decay of the form

RT = R0 e (1 / T 1 / T0 )

(1)

where RT is thermistor resistance at some temperature T and R0 is the thermistor resistance at a reference temperature, T0. Temperature is in degrees Kelvin (K) [K = 273.15 + C]. Depending on how and what the thermistor is made from, can vary between 3000-5000 K. Since every thermistor is a unique device, must be determined empirically for each one. This calibration is accomplished by connecting the thermistor to a voltage divider circuit (Figure 1) and calculating the resistance of the thermistor at different temperatures. In this case

Ei (2) RT = R1 1 E 1 where the parameters are defined in Fig 1. can then be calculated by rearranging equation (1) ln(RT / R0 ) . (3) = (1 / T 1 / T0 )
Once is known, any temperature (K) can be calculated by

R1 ln R 1 0 = T

Ei 1 E 1 1 + . T0
+5V GND

(4)

Figure 1. Voltage divider circuit for determining . Note we are measuring the voltage drop across R1. For Equation (2) to work, you must also measure across R1.

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

Setting Up Arduino to Calibrate a Thermistor Materials 1 each Arduino w/Breadboard 1 each Digital Multimeter 1 each Thermistor (nominally 50 k) 1 each Wire 1 each a 47 k resistor

Build the Circuit 1. Connect the 5V and GND pins from your Arduino to your breadboard. (See your Arduino Projects Book, Project 1, Fig. 5 for guidance) 2. Connect one end of your thermistor to 5V. 3. Using a multimeter, measure the resistance of your 47 k resistor. Make note of this value for use in the sketch you write next. 4. Connect one end of your 47 k resistor to GND. 5. Connect the free ends of the thermistor and 47 k resistor to each other. 6. Connect the junction of the thermistor and 47 kW resistor to analog input pin A0 on the Arduino. Note: It is best to build this voltage divider circuit in the top 5 rows of your breadboard so that you have space to build a motor control circuit on the remainder of the board. Write the Sketch 1. Before looking at the completed sketch on the next page, you are encouraged to think about how you would write a program to return the resistance of the thermistor using Eqn (2). What variables will you need? Where will the values for these variables come from? What should be in the setup() and loop() sections? 2. Write your sketch using Figure 2 as a guide. Note the value for R1 on line 9 of the sketch will depend on your resistor, which you should have measured when building the circuit. 3. Save the sketch as Ohm_meter. Note: You can save yourself a lot of time in lab by writing your sketch before you arrive!

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

Figure 2. An Arduino sketch that measures the voltage drop across a known resistor (R1) in a voltage divider circuit and calculates the resistance of an unknown resistor (RT).

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

Measuring E1 and Calculating RT Materials 1 each Circuit and Sketch described above 1 each Glass thermometer 4 each Insulated cups (1 each full of ice water, cold drinking fountain water, room temp water, and hot water [50 C]) Procedure 1. Upload your Ohm_meter sketch to your Arduino. 2. Click the serial monitor button on the upper right corner of your sketch so you can read the calculated resistance values for the thermistor. 3. For the purposes of Eqns (1), (3), and (4), we will use room temperature as To. Determine Ro by immersing your thermistor in room temperature water and recording the resistance reported in the serial monitor. Be sure to make note of the water temperature using a glass thermometer. 4. Immerse the glass thermometer and thermistor in ice water. Record RT and temperature. 5. Repeat step four in cold drinking fountain water. 6. Repeat step four in hot water. Remember to use degrees Kelvin! Calculating We will determine using a three point calibration. The three temperature points are ice water, cold drinking fountain water, and hot water. This is the bare minimum number of calibration points you can use. For actual use in data collection you would want to conduct a much more extensive calibration. Remember, never trust data from a device when used outside its calibrated range! Procedure 1. Using your measured values of Ro, To, RT, and T, determine for your thermistor at each of your three calibration points using Eqn (3). 2. If any of your values seem like an outlier, recollect the data at that temperature and recalculate . 3. Use the average value of b across the three calibration points as the for your thermistor. 4. Generate a calibration curve for your report, as in Figure 3. You can do this outside of lab to save time. 5

Figure 3. Calibration curve for a thermistor. Dots represent measured values and the curve represents the fit for Eqn (1) using = 3771.5 (the average for these three measured values).

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

Exercise 2 - Measuring Temperature and Controlling a Fan In this exercise, you will use your calibrated thermistor to measure temperature and use that temperature to control a fan (or in our case, the motor that came with the Arduino starter kit). You will set up a simple, binary off or on controller using an H-bridge. An excellent example of how to use and breadboard an H-bridge can be found in Arduino Projects Book, Project 10, Zoetrope. We need the H-bridge or a transistor at this point because the Arduino pins do not output enough current to drive a motor. The H-bridge is an integrated circuit that connects the low power sensor and control circuit (thermistor at 5V, pin 16 VSS) to a high power motor (9 V battery, pin 8 VS). The pin diagram for the H-bridge included with your Arduino Starter Kit is shown in Figure 4. Note the notch at the top of the integrated circuit can be used to determine which pin is which. The pins are numbered in increasing order moving counter clockwise from the notch. Voltage supplied to ENABLE1 determines how fast the motor will spin. For a motor to turn,
Figure 4. Pin diagram for H-bridge L293D.

INPUT1 and INPUT2 must receive different values. If INPUT1 is HIGH while INPUT2 is LOW, the motor will spin one way. When reversed, the motor will spin the opposite direction. OUTPUT1 and OUTPUT2 should connect to the motor. Our H-bridge can connect two motors simultaneously and independently from one another, one on pins 1-7, the other on pins 9-15 (assuming the power supply connected to VS is capable of driving both motors). Setting Up Arduino to Turn a Fan On if it Gets Too Hot Materials 1 each Arduino w/Breadboard 1 each Calibrated Thermistor (nominally 50 k) 1 each Wire 1 each a 47 k resistor 1 each H-bridge from Arduino starter kit 1 each DC motor from Arduino starter kit 1 each 9 V battery

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

Build the Circuit 1. Wire the thermistor circuit seen in Fig. 1. Use the 5V and GND pins from your Arduino as the excitation voltage. E1, the measured voltage across R1 should be read in by analog input pin A0. [If you built this circuit in rows 1-5 of your breadboard in Exercise 1 you will not need to change it here!] 2. Insert your H-bridge so the pins are in columns e and f of your breadboard. Make note of the location of the semi-circular notch so you know which pin is which. From now on the Hbridge will be referred to as IC, for integrated circuit. 3. Connect Arduino digital pin 9 to IC pin 1. This is control how fast the motor spins. 4. Connect Arduino digital pin 3 to IC pin 2. 5. Connect Arduino digital pin 2 to IC pin 7. Sending these two pins opposite digital signals will allow the motor to spin. 6. Connect the motor lead wires to IC pins 3 and 6. 7. Connect IC pins 4 and 5 to Arduino GND. 8. Connect IC pin 8 to the positive terminal of a 9V battery. 9. Connect IC pin 16 to Arduino 5V. 10. Connect the negative end of a 9V battery to Arduino GND. Note: You can build this circuit before arriving in lab to save time!

Figure 5. Fan control circuit. 7

ESM 3444

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

Write the Sketch 1. Before looking at the completed sketch on the next page, you are encouraged to think about how you would write a program to measure temperature using Eqn (4) and use that measurement to control a fan. Note that equation 4 returns the inverse of temperature! What variables will you need? Where will the values for these variables come from? What should be in the setup() and loop() sections? 2. Write your sketch using Figure 6 as a guide. Note the values for resistance, temperature, and for your sketch will depend on your thermistor and circuit elements (which you should have calibrated in Exercise 1). 3. Save the sketch as Temp_FanControl. Note: You can save yourself a lot of time in lab by writing your sketch before you arrive!

Figure 6. Sketch. 8

ESM 3444 Control a Fan (Motor) Materials

Laboratory 4 Temperature Due at start of labs the week of March 17

Spring 2014

1 each Circuit and Sketch described above 1 each Insulated cup with hot water Procedure 1. Enter a Set Temperature at which you would like the fan to turn on (e.g. 35 C). This should be greater than room temperature so your motor is off when you begin. Make sure your temperatures are in the same units so you are not comparing Celsius to Kelvin 2. Upload the Temp_FanControl sketch. 3. Turn on the serial monitor. 4. Immerse the thermistor in hot water and hope your motor turns on!

Report Prepare a brief report, describing in your own words the purpose of the experiment, the equipment and setup used, and the procedure followed. State the results obtained, and include any tables or figures you deem appropriate to best illustrate your results. Discuss the probable sources of error in the experiment, and how they may propagate to the end result.

You might also like