0% found this document useful (0 votes)
40 views3 pages

Smart Temperature Detector Documentation

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

Smart Temperature Detector Documentation

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

Smart Temperature Detector Using Arduino and LM35

1. Introduction

This project aims to create a smart temperature detector using an Arduino UNO board and an LM35

temperature sensor. The LM35 sensor detects the ambient temperature and sends data to the

Arduino, which then displays the temperature in both Celsius and Fahrenheit on a 16x2 LCD

display. This project is ideal for beginners in electronics and programming.

2. Components Required

1. Arduino UNO Board - 1

2. LM35 Temperature Sensor - 1

3. 16x2 LCD Display - 1

4. Potentiometer 10K - 1

5. Connecting Wires - 20

6. Breadboard - 1

3. Circuit Diagram

The LM35 temperature sensor has three pins: VCC, GND, and OUT. Connect the VCC pin to the 5V

pin of the Arduino, the GND pin to the GND of the Arduino, and the OUT pin to analog pin A0 of the

Arduino. The 16x2 LCD display is connected using I2C communication. Connect the SDA and SCL

pins of the LCD to the respective pins on the Arduino.

4. Code Explanation

1. Define the sensor pin as A0 and initialize the LCD library with I2C communication.

2. In the setup function, initialize the serial communication and LCD.

3. In the loop function, read the analog value from the LM35 sensor and convert it to voltage.

4. Calculate temperature in Celsius and Fahrenheit.

5. Display the temperature on the LCD and serial monitor.


6. Introduce a delay of 1 second for continuous reading.

5. Arduino Code
#define sensorPin A0
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
lcd.begin();
lcd.backlight();
}
void loop() {
lcd.clear();
int reading = analogRead(sensorPin);
float voltage = reading * (5.0 / 1024.0);
float temperatureC = voltage * 100;
Serial.print("Temperature: ");
lcd.setCursor(0,0);
lcd.print("Temperature:");
lcd.setCursor(0,1);
lcd.print(temperatureC);
lcd.setCursor(6,1);
lcd.print("C");
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
lcd.setCursor(8,1);
lcd.print(temperatureF);
lcd.setCursor(14,1);
lcd.print("F");
delay(1000);
}

6. Working Principle

The LM35 sensor measures temperature based on the voltage across its terminals, which varies

with temperature. The Arduino reads the voltage output from the sensor, converts it to Celsius, and

then displays it on the 16x2 LCD. The temperature is also converted to Fahrenheit for easy

reference.

7. Conclusion

This project demonstrates the use of an LM35 temperature sensor with an Arduino to display
real-time temperature data in Celsius and Fahrenheit. This setup can be used in various applications

where temperature monitoring is needed, such as environmental monitoring and home automation.

You might also like