Arduino: Using as a temperature sensor

Folks here I’m back! As usual so much busy days. This time I’m back with some thing new! You might have heard about Arduino (or you might not have). If you have not heard about Adduino it’s time to know about this awesome gadget.

Arduino is an open-source electronic prototyping platform. There are so many versions of it. I have got the Arduino Uno. It has an on-board micro-controller (ATMEGA 328).

Basically you can program Arduino to control the behavior of it. The micro-controller ATMEGA 328 has got 28 pins in it (14 on both the sides). Among them first 7 pins on the left is used for powering up the IC and the last 6 Pins are for analog input and output purpose. The 14 pins on the right are generally used for digital output or input. The arduino board is manufactured in such a way that it can interact with the computer. It has an on-board programmer in it. it can easily be programmed by connecting a USB cable with it!

An Arduino is very much useful for small or medium scale electronics projects. One can actually come out with thousands of projects using a single Arduino board.

In my further posts I will write about the basic setup and How Tos!

So to make you guys feel interested in such cool stuff today I will show you how I actually managed my Arduino to behave as a basic digital temperature meter.

Used components:

  1. Arduino Uno
  2. 3 male-male chords
  3. IC LM35 Temperature Sensor
  4. Laptop :p
LM35 Temperature Sensos

LM35 Temperature Sensos

IMG_20130308_151935

male-male Patch Chords

IMG_20130308_152013

Arduino Uno

Here goes the code:

/*
****************************************************
****************************************************
**Author: Anik Das
**Date: 08/03/2013
**This program is written to read analog output
**from a LM36 temperature sensor
**PIN CONFIG OF LM36
**(keeping the flat side vertically upward)
**PIN 1: Vcc(+5V)
**PIN 2: Analog output
**PIN 3: GND
****************************************************
****************************************************/
float sensor;
float celcius;
float farenheit;
float voltage;


void setup()
{
 Serial.begin(9600); //This starts a serial communication with the arduino
 
 //calibrate the sensos
 Serial.println("Calibrating Sensor...");
 delay(3000);
}

void loop()
{
 
 //Analizing value taken from the sensor
 sensor = analogRead(0); //I have connected the second PIN of the sensor to A0 pin of Arduino
 voltage = (sensor*5000)/1024; //Converts raw sensos value to voltage value
 celcius = voltage/10; //10mV/1 degree celcius
 farenheit = (celcius * 1.8) +32; //Converts celcius to Farenheit
 
 //Priting the value from in the serial terminal
 Serial.println("Temperature:");
 Serial.print("celcius: ");
 Serial.println(celcius,2);
 Serial.print("Farenheit: ");
 Serial.println(farenheit,2);
 delay(1000);
}

Finally It Should look like this:

Final Setup

Final Setup

Output from the serial

Output from the serial

 

You can actually do lot more cool stuff using this Arduino board.

Hope you enjoyed!

About anik

This is Anik Das. I am Student of Electrical and Electronics engineering in National Institute of Technology, Warangal (NITW). I used to study in BRAC University(BRACU) (which is one of the best part of my life). There I also studied EEE but after getting the ICCR Scholarship by the Indian Govt. I moved to NITW. I have completed my H.S.C from Notre Dame College (NDC). I used to work as Microsoft Student Partner(MSP) in Microsoft. I am a tech loving boy…I also love to know about newer and newer things. I am here to share what I learn...

Posted on March 8, 2013, in Arduino and tagged , , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: