Interfacing DHT11 Sensor with Arduino

DHT11

The DHT11 is a low-cost temperature and humidity sensor. it consists of an element that is useful for sensing the humidity and temperature of surroundings. its capacitor consists of two electrodes with a moisture-holding substrate as a dielectric between them .change in capacitance will lead to a change in humidity levels.

it is simple to use and setup but requires some time to get the data accurate








DHT11 sensors have 3 pins 

1.VCC  > 5v
2.GND  > GND
3.Data Pin > Analog pins (A0-A5)


Applications

This sensor is used in various applications like measuring humidity and temperature of surroundings, air moisture, ventilation, etc . this sensor also used as a preventive measure in a home where people are affected by humidity.

How to use DHT11 Sensor with Arduino :

 Circuit Diagram :












Arduino Program for Above Circuit :
#include "dht.h"
#define dht_apin A0 // Analog Pin sensor is connected to
 
dht DHT;
 
void setup(){
 
  Serial.begin(9600);
  delay(500);//Delay to let system boot
  Serial.println("DHT11 Humidity & temperature Sensor\n\n");
  delay(1000);//Wait before accessing Sensor
 
}//end "setup()"
 
void loop(){
  //Start of Program 
 
    DHT.read11(dht_apin);
    
    Serial.print("Current humidity = ");
    Serial.print(DHT.humidity);
    Serial.print("%  ");
    Serial.print("temperature = ");
    Serial.print(DHT.temperature); 
    Serial.println("C  ");
    
    delay(5000);//Wait 5 seconds before accessing sensor again.
 
  //Fastest should be once every two seconds.
 
}//end loop

Comments

Popular posts from this blog

Interfacing LDR with Arduino

interfacing fingerprint sensor with arduino