Sunday, October 29, 2006

Temperature Sensor

(DS1620 Temperature Sensor + AD592 Temperature Probe)
Jenny, Belinda, Irene, Skye

We used as a starting point the circuit provided in the guide for overall sensors kit from parallex. This had a 'sound buzzer' in it which we attempted to replace with an LED instead. Once the circuit is connected up you have to calibrate the temperature sensor and probe in a cup of iced water then complete the appropriate equations to gain a reading in degrees celcius or kelvin.

' Applied Sensors - AD592.bs2
' Reading the AD592 temperature sensor using the RCTIME command.
' {$STAMP BS2}
' {$PBASIC 2.0}

Kal CON 15300 ' Constant to be determined.
rct VAR Word ' A word variable.
TK VAR Word ' Kelvin temperature.
TC VAR Word ' Degrees Celsius.
DO ' Loop forever.
LOW 5 ' Discharge the capacitor.
RCTIME 5, 0, rct ' Time for the volts to rise to 1.3 V.
TK = Kal/rct*10 + (Kal//rct*10/rct) ' Calculate Kelvin
TC = TK - 273 ' and Celsius.
DEBUG DEC rct, TAB, DEC TK, ' Show the results.
PAUSE 50 ' Slows down the program.
LOOP ' Back to the beginning of the loop.

AD592 Calibration

The formula that relates the temperature to the time measured by RCTIME is a reciprocal:in this case TK is Kelvin temperature.

rct = constant/TK or TK = constant/rct

In order to calibrate the sensor, we need to find the constant for this particular setup. To do this, the AD592 sensor must be put in a location where you know the temperatureexactly. A good choice is an ice bath at 0 C, 273 K.

With an ice bath reference, TK = 273, the constant will be (rearranging the previous equation):

constant = 273 * rct

We have to put the probe into an ice bath, let it stabilize, read the value of rct, and multiply to find the constant.

Ice bath preparation for calibration:
-The melting point of ice made with pure water is a physical constant: zero degrees Celsius,32 degrees Fahrenheit, 273 Kelvin (Or 273.14 if you want to push the precision).

You can get the best results if the ice and water mixture is:
􀀹 made with crushed ice made from distilled water;
􀀹 is held in a vacuum thermos bottle with a narrow mouth;
􀀹 stirred gently while making the measurement; and
􀀹 at least 5 cm of wire is submersed above the sensor probe tip.

Lacking a thermos bottle, you can substitute a well-insulated foam container. Careful preparation is very important if you want to achieve good results in the calibration! Watch until the reading settles down to a steady value, to equilibrium.
√ Place the AD592 temperature probe into the ice bath.
√ Run the program AD592.bs2.
√ Watch the Debug Terminal until the readings equilibrate (become steady).
√ Record the reading for rtc.
rtc = ___________.
√ Take that number and multiply it times 273. This is your AD592 calibration constant.
rtc x 273 = ___________.
Be aware that this constant is specific for this sensor, this BASIC Stamp, and this capacitor.
√ Now round off the constant to the nearest 10, and drop the final digit (a zero). This should be a five-digit number. This will be the value of Kal you need to substitute in the program.
Kal = __________.
√ Put this value in your AD592.bs2 program in place of the 15300 "default" value. (marked in red above)
√ Re-run the program. You should see TK and TC show the temperature of the calibration bath--273 Kelvin, 0 Celsius.

See website below for entire PDF download

We are not sure how the switch button fits into things and we didn't get the LED working to go on and off but at least got the readings of temperature on the computer. As we are also interested in other sensors we are not going to spend any more time on this one just yet to finish figuring out how to get the LED on and off but there is potential there to put in variables by which to make it go on and off.

The '0' in the right hand column is the degrees in Celsius once calibrated in an iced glass of water.

Video link below:

We have also been further investigating form and change in form with wind and water


Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?