Tuesday, 1 November 2011

CIRC-10: Temperature

Purpose: 
Get a measurement of temperature with the TMP36 sensor.

Equipment:
•1 x Arduino Uno
•1 x Breadboard
•5 x Wire
•1 x TMP36 Temperature Sensor


Reference:
http://www.oomlout.com/a/products/ardx/circ-10

Program Details: 
The program in this lab introduces serial connection.

Time to Complete: 
 20 minutes

Results:
This lab was a failure. The temperature was not outputted. In an attempt to change the temperature value, one of my group members tried to pinch the sensor to heat it up. He then found out it was ridiculously hot and burned himself. We suspect the temperature sensor to be faulty.

Photos of Project: 




Tips:
This lab taught us about safety. Remember to work with the Arduino hardware cautiously and carefully.

Further Work:
A simple calculation can be added to show the temperature in fahrenheit instead of celsius.

Program Modifications:
The program is exactly the one from http://www.oomlout.com/a/products/ardx/circ-10

Program:
int temperaturePin = 0; //sets the pin the sensor is connected to
      
void setup()
{
  Serial.begin(9600);  //Start a serial connection
  
}
void loop()                     // continuously runs
{
//calls the function and sends it parameters
float temperature = getVoltage(temperaturePin);  
temperature = (temperature – .5) * 100;          //converts the value of temperature
Serial.println(temperature);                    //outputs the value of temperature
delay(1000);                                     //delay of 1000ms
}
//creates function of return type float with one parameter
float getVoltage(int pin)                      
{
//returns the value back to the variable, temperature
return (analogRead(pin) * .004882814);                                     
}

No comments:

Post a Comment