The goal of this project is to construct a digital thermometer with an IC LM35 temperature sensor and an Arduino microcontroller.
The Arduino translates the voltage that the IC LM35 outputs in relation to temperature into a readable value.
For a very long time, people have used thermometers to measure temperature.
For ease of visualization, the generated temperature information is shown on an LCD panel.
Using an Arduino, we can construct a thermometer that displays the current temperature on a little screen.
It is applicable to industries, workplaces and residences.
Three components make up the thermometer:
- A temperature sensor.
- The Arduino, which converts the measurement from the sensor into a comprehensible number.
- An image displaying the number.
Coding with Explanation:
#include <LiquidCrystal.h>
// Define LCD pins
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// Define
LM35 pin
const int lm35Pin = A0;
void setup() {
lcd.begin(16, 2); // Initialize LCD
Serial.begin(9600); // For debugging
}
void loop() {
float voltage, temperature;
// Read analog value from LM35
int sensorValue = analogRead(lm35Pin);
// Convert analog value to voltage
voltage = (sensorValue / 1023.0) * 5.0;
// Convert voltage to temperature (LM35 outputs 10mV/°C)
temperature = voltage * 100;
// Display temperature on LCD
lcd.setCursor(0, 0);
lcd.print("Temperature: ");
lcd.print(temperature);
lcd.print(" C");
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
delay(1000);
}
- Liquid crystal library for LCD control is included in the include library.
- Define pins specifies the IC LM35 and LCD pins.
- Setup sets up serial connectivity and the LCD.
- Loop reads the analog value from the IC LM35 constantly, transforms it into voltage and temperature, and then displays the temperature on the serial monitor and LCD.
Circuit Working:
Parts List:
Component | Quantity |
---|---|
Arduino UNO board | 1 |
IC1 7809 | 1 |
IC2 LM35 | 1 |
16×2 LCD display | 1 |
Potentiometer 10k 1/4 watt | 1 |
In this article everything in the thermometer is controlled by the Arduino Uno.
The voltage produced by the IC2 LM35 temperature sensor increases by 10 millivolts for every degree that the temperature rises.
Temperatures up to 150 degrees Celsius can be measured using it.
It is the most simplest temperature sensor, and any microcontroller may be simply interfaced with it.
A voltage proportional to the temperature is the output by the IC2 LM35 sensor.
The IC2 LM35 pin generates the analog voltage that the Arduino reads.
The analog value is converted by the code to voltage, and then to Celsius temperature.
The estimated temperature is displayed on the 16×2 LCD panel.
Using a potentiometer to adjust the brightness of an LCD
Usually, an LCD pin is not directly linked to a potentiometer, but it regulates how bright the LCDs backlight is.
The Arduinos analog pin is connected to the potentiometer and its analog value is read by the Arduino.
The LCD backlights current flow is adjusted by this setting.
How to Build:
To build a Digital Thermometer Circuit using Arduino and IC LM35 follow the below mentioned connections steps:
- Gather all the components as mentioned in the above circuit diagram
- Connect the IC2 LM35 sensor to the Arduino board with VCC of LM35 to 5V, output of LM35 to analog pin A0, and ground of LM35 to ground.
- Connect pot 10k 1st pin to VCC pin of LCD display board, 2nd leg of pot 10k to contrast pin of LCD display board and 3rd leg of pot 10k to GND pin of LCD display board
- Connect a regulated IC1 7809 to provide a regulated 9V DC to the Arduino board.
- Connect Arduino to 16×2 LCD connections pins as shown in above circuit diagram and through below mentioned table:
Pin Connections
Arduino Pin | LCD Pin | Function |
---|---|---|
Digital Pin 2 | D4 | Data Bit 4 |
Digital Pin 3 | D5 | Data Bit 5 |
Digital Pin 4 | D6 | Data Bit 6 |
Digital Pin 5 | D7 | Data Bit 7 |
Digital Pin 6 | E | Enable |
Digital Pin 11 | RS | Register Select |
5V | VCC | LCD Power Supply |
Ground | GND | LCD Ground |
Conclusion:
Constructing a digital thermometer using an Arduino and an IC LM35 is an easy project that teaches you a lot.
You may build this project to develop advanced temperature monitoring systems by learning the fundamentals of analog to digital conversion and temperature measuring.
References:
LM35 Based Digital Room Temperature Meter: A Simple Demonstration
Leave a Reply