Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views2 pages

Lm35 Program

The document outlines a project to interface the LM35 temperature sensor with an Arduino Uno to measure and display ambient temperature in Celsius. It includes an algorithm detailing the steps to read the sensor, convert the values, and output the temperature via the Serial Monitor. The program successfully executes, providing temperature readings as output.

Uploaded by

mohanrajg172006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Lm35 Program

The document outlines a project to interface the LM35 temperature sensor with an Arduino Uno to measure and display ambient temperature in Celsius. It includes an algorithm detailing the steps to read the sensor, convert the values, and output the temperature via the Serial Monitor. The program successfully executes, providing temperature readings as output.

Uploaded by

mohanrajg172006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Interfacing temperature of LM35 using arduino

AIM

To interface the LM35 temperature sensor with an Arduino Uno board to measure ambient
temperature in Celsius and display it using the Serial Monitor.

ALGORITHM

1. Start the Arduino and initialize serial communication.


2. Connect the LM35 sensor to the analog input pin (A0).
3. Read the analog value from the LM35 sensor.
4. Convert the analog value to voltage.
5. Convert the voltage to temperature in Celsius (LM35 outputs 10 mV per °C).
6. Display the temperature on the Serial Monitor.
7. Wait for a short period and repeat from step 3.

PROGRAM:

const int sensorPin = A0; // LM35 output connected to analog pin A0

void setup() {
Serial.begin(9600); // Start the serial communication
}

void loop() {
int sensorValue = analogRead(sensorPin);
float voltage = sensorValue * (5.0 / 1023.0);
float temperatureC = voltage * 100.0;

Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");

delay(1000);
Circuit Diagram:

OUTPUT:

Temperature: 28.54 °C

Temperature: 28.67 °C

Temperature: 28.76 °C

Result:

The above arduino program Interfacing temperature LM35 using arduino is successfully
executed and the output is verified.

You might also like