# Arduino Temperature Sensor Interfacing (LM35) .THE EASIEST WAY

147,334

41

25

## Introduction: Arduino Temperature Sensor Interfacing (LM35) .THE EASIEST WAY

A simple temperature sensor using one LM35 Precision Temperature Sensor and Arduino. The circuit will send serial information about the temperature that you can use on your computer.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Materials

You will need :

• Arduino Uno ( I used the Uno R3 , You can use any other micro controller but for that you'll have to change the source code).
• LM35 Temperature Sensor.
• Some connecting wires.
• A computer

## Step 2: Setting Up the Arduino With Temperature Sensor

Connect the temperature sensor to board

1. Connect the +Vs to +5v on your Arduino board.
2. Connect Vout to Analog0 or A0 on Arduino board.
3. Connect GND with GND on Arduino.

The Analog to Digital Converter (ADC) converts analog values into a digital approximation based on the formula ADC Value = sample * 1024 / reference voltage (+5v). So with a +5 volt reference, the digital approximation will = input voltage * 205.

## Step 3: Setting Up Arduino With Code (sketch)

Open up the Arduino IDE and write the following code :

float temp;
int tempPin = 0;

void setup()

{

Serial.begin(9600);

}

void loop()

{

temp = temp * 0.48828125;

Serial.print("TEMPRATURE = ");

Serial.print(temp);

Serial.print("*C");

Serial.println();

delay(1000);

}

I have also attached the final file for your reference.

After everything is done compile the code and upload it to the board. Wait for few seconds and open the Serial Monitor to view the output.

## 2 People Made This Project!

• • ## 25 Discussions

It is not working for me:

TEMPRATURE = 0.00*C

TEMPRATURE = 0.00*C

TEMPRATURE = 6.84*C

TEMPRATURE = 99.61*C

TEMPRATURE = 309.08*C

TEMPRATURE = 499.51*C

TEMPRATURE = 462.40*C

TEMPRATURE = 198.73*C

TEMPRATURE = 0.00*C

TEMPRATURE = 0.00*C

TEMPRATURE = 0.49*C

TEMPRATURE = 54.69*C

TEMPRATURE = 246.58*C

TEMPRATURE = 474.12*C

TEMPRATURE = 499.51*C

TEMPRATURE = 250.00*C

TEMPRATURE = 28.32*C

TEMPRATURE = 0.00*C

TEMPRATURE = 2.93*C

Not sure why I'm getting this output. I'm not working in a fridge.

TEMPRATURE = 2.93*C

TEMPRATURE = 2.93*C

TEMPRATURE = 2.44*C

TEMPRATURE = 2.93*C

TEMPRATURE = 2.93*C

TEMPRATURE = 2.44*C

TEMPRATURE = 2.44*C

TEMPRATURE = 2.44*C

TEMPRATURE = 2.44*C

TEMPRATURE = 2.44*C

TEMPRATURE = 1.95*C

TEMPRATURE = 2.44*C

TEMPRATURE = 1.95*C

TEMPRATURE = 1.95*C

TEMPRATURE = 1.95*C

TEMPRATURE = 1.95*C

TEMPRATURE = 1.46*C

TEMPRATURE = 1.46*C