Saturday, July 4, 2020

DHT11 Humidity and Temperature Sensor Interfacing with Arduino Uno By Engr.Habib Ur Rehman

DHT11 Humidity and Temperature Sensor
Interfacing with Arduino Uno
By Engr.Habib Ur Rehman 


Components/Equipment Required:

            Following Components/Equipment are required to perform task.

1.    Arduino Uno (https://piees.pk/product/arduino-uno-r3/)

2.    DHT11 humidity and temperature sensor (https://piees.pk/product/dht11-humidity-sensor/)

3.    Breadboard

4.    Jumper Wires(https://piees.pk/product-category/jumper-wires/)

Circuit Diagram:

 Arduino Program:

#include<dht.h>

dht DHT;

#define DHT11_PIN 3

void setup() {

Serial.begin(9600);

Serial.println("DHT11 Interfacing with Arduino Uno"); }

void loop()

{ // READ DATA

int chk = DHT.read11(DHT11_PIN);

if (digitalRead(0)>35)

{

digitalWrite(A3, HIGH);

delay(75000);

digitalWrite(A3, LOW);

}

Serial.print("Humidity ");

Serial.print(DHT.humidity, 1);

Serial.print("    Temparature ");

Serial.println(DHT.temperature, 1);

delay(2000);

}

Note:

            DHT Library folder should be added in Arduino library folder “C:\Program Files\Arduino\libraries”

No comments:

Post a Comment