0% found this document useful (0 votes)
5 views1 page

Humidity & Temp LCD Display Code

This document contains an Arduino sketch for measuring and displaying humidity and temperature using a DHT sensor and an LCD. It initializes the LCD, creates a custom degree symbol, and continuously reads data from the DHT sensor to display on the LCD. The program includes setup and loop functions to manage the display and sensor readings.

Uploaded by

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

Humidity & Temp LCD Display Code

This document contains an Arduino sketch for measuring and displaying humidity and temperature using a DHT sensor and an LCD. It initializes the LCD, creates a custom degree symbol, and continuously reads data from the DHT sensor to display on the LCD. The program includes setup and loop functions to manage the display and sensor readings.

Uploaded by

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

#include<dht.

h> // Including library for dht


#include<LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

#define dht_dpin 12

dht DHT;

// This line is to create a custom Degree sign in degree celcius.


byte degree[8] =
{
0b00011,
0b00011,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};

void setup()
{
lcd.begin(16, 2);
lcd.createChar(1, degree);
lcd.clear();
lcd.print(" Humidity ");
lcd.setCursor(0,1);
lcd.print(" Measurement ");
delay(2000);
lcd.clear();
lcd.print("Circuit Digest ");
delay(2000);
}

void loop()
{
DHT.read11(dht_dpin);
lcd.setCursor(0,0);
lcd.print("Humidity: ");
lcd.print(DHT.humidity); // printing Humidity on LCD
lcd.print(" %");
lcd.setCursor(0,1);
lcd.print("Temperature:");
lcd.print(DHT.temperature); // Printing temperature on LCD
lcd.write(1);
lcd.print("C");
delay(500);
}

You might also like