Info

GarageBox.Org adalah laman teknologi dan perkara yang kami minati yang disampaikan mengikut perspektif kami sendiri dalam Bahasa Melayu. Jika ada idea baru yang masih belum diterbitkan di internet, kami akan sampaikannya dalam Bahasa Inggeris. Sebarang pertanyaan dan permintaan, sila hubungi kami di webmaster[a]garagebox.org .


 

GarageBox.Org is a website about technology and anything we like to do according to our perspective in Malay. If we have a new idea that still not publish in the internet, we will publish it in English. Any inquiry & request, please email us at webmaster[a]garagebox.org .

Simple temperature reader using Arduino. PDF Print E-mail
Written by Mr Garage   
Thursday, 26 May 2011 23:00

I got a temperature sensor called LM35. The package similar to common transistor and slightly doubt on its look. I bought a few weeks ago from Ebay. Once i got it, it was hard to handle it. The pins were really fragile and thought it was better for me to buy the sensor that already soldered on a PCB. But, without the PCB, the cost is very cheap. Finally, I ended up to continue this lab with simple sensor connection and I think I never use the sensor in the next project after all.

 

 

In this article, I took 2 examples from these website and simplify it.

http://www.ladyada.net/learn/sensors/tmp36.html

http://pscmpf.blogspot.com/2008/12/arduino-lm35-sensor.html

Just follow what you read from these 2 article to build the circuit with Arduino. Below is my final construction with Arduino and temperature sensor. The sensor is attached to a small breadboard.

I like to remind you about the picture above: Please ignore the pair wire i used to connect the sensor pin to arduino. I do not want to waste my pair wires just to have a right look on the circuit. But, what you should know is for each pin from the sensor goes to one connection at arduino pin hole.

The sensor sit on the breadboard.

For the arduino programming, both website not give a correct script. You can try scripts from both website and learn how to debug the script.

 

 

//declare variables
float tempC;
int tempPin = 0;
void setup()
{
Serial.begin(9600); //opens serial port, sets data rate to 9600 bps
}
void loop()
{
int tempC = analogRead(tempPin);           //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0;  //convert the analog data to temperature
Serial.println(tempC);              //send the data to the computer
delay(1000);                           //wait one second before sending new data
}

 

I think above script is correct. Just upload the script into Arduino and watch the reading at the serial monitor.

 

What can you see from the above picture, the reading is from 28oC room temperature to 41oC when I put the sensor near a lighter.

That's all for now.

 

Last Updated on Tuesday, 31 May 2011 23:37
 
You may send a trackback for this article by using the following Trackback link
Trackbacks provided by Trackback for Joomla




 
Twitter Digg Delicious Stumbleupon 

Custom Search