Call Us Now
0242159130 | 0546096840
Up to 2% reward

For new all Customers

Delevery schedule

We deliver  the same day through VIP bus parcel Service in Ghana

Discount on order gift

Save ¢10.00 when you spend ¢600+! 

Temperature & Humidity Sensor DHT-11

Temperature & Humidity Sensor DHT-11

In this tutorial we will learn how to use DHT-11 to collect temperature and humidity by programming Arduino.

Hardware required
1 * Arduino UNO
1 * USB Cable

1 * LCD1602

1 * 10kΩ Potentiometer

1 * DHT-11 Temperature and Humidity Sensor

1 * Breadboard 

Several jumper wires


Principle of operation

This DHT-11 temperature & humidity sensor features a temperature & humidity sensor complex with a calibrated digital signal output. By using the exclusive digital signal acquisition technique and temperature & humidity sensing technology, it ensures high reliability and excellent long-term stability. This sensor includes a resistive-type humidity measurement component and an NTC temperature measurement component, and connects to a high-performance 8-bit microcontroller, offering excellent quality, fast response, anti-interference ability and cost-effectiveness.

Note to include the library for  DHT-11 

Experiment code

//File name:   Experiment 18

/********************************

Description: you can see the temperature and humidity data

             displayed on the LCD1602.

*******************************/

//Website: www.okuelectronics.com

//E-mail: support@okuelectronics.com

//Author: Okudzeto osei prince

//Date: 2019/08/19

#include <dht11.h>

#include <LiquidCrystal.h>

 

dht11 DHT11;

#define DHT11PIN 2

LiquidCrystal lcd(4, 6, 10, 11, 12, 13);  //Define the connection LCD pin  

void setup()

     lcd.begin(16, 2);    // set up the LCD's number of columns and rows: 

     lcd.clear();         //Clears the LCD screen and positions the cursor in the upper-left corner 

     delay(1000); //延时1000ms

}

 

void loop()

{

    int chk = DHT11.read(DHT11PIN);

    lcd.setCursor(0, 0); // set the cursor to column 0, line 0

    lcd.print("Humidity:");// Print a message of "Humidity: "to the LCD.

    lcd.print((float)DHT11.humidity, 2);// Print a message of "Humidity: "to the LCD.

    lcd.print(" % "); // Print the unit of the centigrade temperature to the LCD.

    

    lcd.setCursor(0, 1); // set the cursor to column 0, line 0

    lcd.print("Temp:    ");// Print a message of "Temp: "to the LCD.

    lcd.print((float)DHT11.temperature, 2);// Print a centigrade temperature to the LCD. 

    lcd.print(" C "); // Print the unit of the centigrade temperature to the LCD.

    delay(1000);     

}


Compile the program and upload to Arduino UNO board Now, you can see the temperature and humidity data displayed on the LCD1602.



Add Comment