Sharifdeen Ashshak
Published

DH11 Sensor dispaly tutorial

In this Arduino LCD Tutorial we will learn how to connect an LCD (Liquid Crystal Display) to the Arduino board.

BeginnerFull instructions provided1,364
DH11 Sensor dispaly tutorial

Things used in this project

Story

Read more

Schematics

circuit

Code

code

C/C++
//for more projects visit:www.blackkeyhole.com
#include <LiquidCrystal.h> // load lib
#include <dht.h> // load lib
                      
LiquidCrystal lcd(10,9,5,4,3,2); // make a lcd object

#define dht_apin   11 
dht DHT;  // sensor pin S to pin11

void setup() {
  lcd.begin(16, 2);
  lcd.setCursor(1, 0);
  lcd.print("SRILanka"); //Change Your Country Name
  lcd.setCursor(1, 1);
  lcd.print("Black keyhole");  //Change Name if you want
  Serial.begin(9600);
  
}


void loop(){
DHT.read11(dht_apin);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
delay(1000);
lcd.setCursor(0,0); // row 1
lcd.print(" Humidity = "); // print on the lcd Humidity =  
lcd.print(DHT.humidity);  // to print the humidity          

lcd.setCursor(0,1);
lcd.print(" Temp = ");  // print on the lcd temp =     
lcd.print(DHT.temperature);  // print on the lcd temperture       
lcd.println(" C ");
delay (1000); // delay                  

}

Credits

Sharifdeen Ashshak

Sharifdeen Ashshak

34 projects • 42 followers
Ai, IoT, embedded enthusiast

Comments