PURPOSE:
To measure the temperature with a complicated IC (integrated circuit).
EQUIPMENT:
· 1 x TMP36 Temperature Sensor
· 1 x CIRC-10 Breadboard Sheet
· 5 x Wire (any colour)
· 1 x Arduino Holder
· 1 x Arduino
· 1 x Breadboard
PROGRAM DETAILS:
A Temperature Sensor. (Image link) |
In this circuit experiment, the phenomena we measure with our Arduino is the temperature with the help of a device called IC (integrated circuit). It is very similar looking to our P2N2222AG transistors. It has three pin’s, ground, signal and =5 volts, and is easy to use. It can output 10 millivolts per degree centigrade on the signal pin. There is a 500 mV offset to allow measuring temperatures below the freezing level.
This is the first circuit so far that uses the Arduino’s IDE serial monitor. In the code, the Serial.begin(number) method is used to make a serial connection with the computer. This method also helps determine the speed at which the Arduino sends information, and how fast the computer reads it. A speed of 9600 kilobits per second is chosen to read information because 9600 kilobits/second is the fastest speed at which the Arduino can read information. The Serial.println(temperature) is another method used to program this circuit. This method prints the received information (results) on to the serial monitor. Moreover, some mathematical operations and calculations are done in this circuit to convert temperature units. The variable float is also introduced here for floating point math (decimals). It takes 4 bytes of RAM and has a range between -3.4028235E+38 and 3.4028235E+38.
As a final point, we put the circuits together simply. We gathered the parts we need. Picking the temperature sensor was a little confusing since it’s identical to the P2N2222AG transistor so, we checked to see if the chip has a TMP36 printed on it or not. The wiring was done as instructed in the CIRC-10 Breadboard Sheet.
TIME TO COMPLETE:
4 minutes to build, 10 minutes to program.
RESULTS:
Monitor showing the temperature errors |
PHOTOS OF PROJECT:
CIRC-10 Arduino Circuit |
TIPS:
1) Sometimes, gibberish is displayed on the screen because the serial monitor is receiving data at a different speed than expected. To fix this issue, mouse click the pull-down box that reads “*** baud* and change it to “9600 baud”.
2) If temperature value is unchanging, try pinching the temperature sensor with your fingers to heat it up or press a bag of ice against it to cool it down.
3) When working with a partner or in a team, one must be co-operative, responsible and reliable. He/she should also have patience, teamwork skills and excellent communication skills. If you carry these qualities in you then you can work on anything with anyone, anywhere at any time!
FURTHER WORK:
There are four awesome things you can do to make your program better such as, Outputting voltage, Outputting degrees Fahrenheit, More information output, and Changing the serial speed. I would like to output degrees Fahrenheit and to do this, I need to use the formula (F = C * 1.8) + 32. I would also have to add the line temperature = (((temperature – 0.5) * 100)*1.8) + 32; before Serial.println(temperature);.
PROGRAM MODIFICATIONS:
My program is identical to the program from:
PROGRAM (with comments):
/* ---------------------------------------------------------
* | Arduino Experimentation Kit Example Code |
* | CIRC-10 .: Temperature :. (TMP36 Temperature Sensor) |
* ---------------------------------------------------------
*
* A simple program to output the current temperature to the IDE's debug window
*
* For more details on this circuit: http://tinyurl.com/c89tvd
*/
//TMP36 Pin Variables
int temperaturePin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade
/*
* setup() - this function runs once when you turn your Arduino on
* We initialize the serial connection with the computer
*/
void setup()
{
Serial.begin(9600); //Start the serial connection with the copmuter
//to view the result open the serial monitor
//last button beneath the file bar (looks like a box with an antenae)
}
void loop() // run over and over again
{
float temperature = getVoltage(temperaturePin); //getting the voltage reading from the temperature sensor
temperature = (temperature - .5) * 100; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge - 500mV) times 100)
Serial.println(temperature); //printing the result
delay(1000); //waiting a second
}
/*
* getVoltage() - returns the voltage on the analog input defined by
* pin
*/
float getVoltage(int pin){
return (analogRead(pin) * .004882814); //converting from a 0 to 1024 digital range
// to 0 to 5 volts (each 1 reading equals ~ 5 millivolts
}
REFERENCE:
Sparkfun Inventor’s Guide. Page 26 and 27.