Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

LCD Display of Humidity and

Temperature using DHT 11 Sensor

Presented by : Daw Thadar Soe


: Daw May Yu Hlaing
Hardware Required
• Arduino UNO Board
• USB Cable
• Bread Board / Project Board
• Variable Resistor
• Jumper Wire (Male - Male)
• LCD
• DHT 11 Sensor
1. Arduino UNO Board

2. USB Cable

3. Bread Board / Project Board

4. Variable Resistor
5. Jumper Wire (Male - Male)

6. LCD

7. DHT 11 Sensor
#include <dht.h> //Import DHT 11 library
#include <LiquidCrystal.h> //import LCD libray
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Initilize LCD library
#define dht_apin A0 // sensor is connected to Analog Pin
dht DHT; // DHT variable to handle sensor functions
void setup()
{
lcd.begin(16,2); // LCD character display
lcd.setCursor(0,0);
}
void loop() {
delay(2000); //wait a sec (recommended for DHT11)
DHT.read11(dht_apin);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Humidity: ");
lcd.print(DHT.humidity); // Print DHT11 reading for Humidity
lcd.print("%");

lcd.setCursor(1,1);
lcd.print("Temp: ");
lcd.print(DHT.temperature); // Print DHT11 reading for Temperature
lcd.setCursor(12,1);
lcd.print( (char)223); // displaying degree symbol (°).
lcd.print("°C");
}
Thank U …

You might also like