Description
The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed).
Features / Specifications
- 3 to 5V power and I/O
- 2.5mA max current use during conversion (while requesting data)
- Good for 20-80% humidity readings with 5% accuracy
- Good for 0-50 C temperature readings +- 2 C accuracy
- No more than 1 Hz sampling rate (once every second)
- 15.5mm x 12mm x 5.5mm
- 4 pins with 0.1″ spacing
Tutorials / Manuals / Documents
Sample fast upload code :
#include <dht.h>
#define dht_dpin A0 //no ; here. Set equal to channel sensor is on
dht DHT;
void setup(){
Serial.begin(9600);
delay(300);//Let system settle
Serial.println(“Humidity and temperature\n\n”);
delay(700);//Wait rest of 1000ms recommended delay before
//accessing sensor
}//end “setup()”
void loop(){
//This is the “heart” of the program.
DHT.read11(dht_dpin);
Serial.print(“Current humidity = “);
Serial.print(DHT.humidity);
Serial.print(“% “);
Serial.print(“temperature = “);
Serial.print(DHT.temperature);
Serial.println(“C “);
delay(800);//Don’t try to access too frequently… in theory
//should be once per two seconds, fastest,
//but seems to work after 0.8 second.
}// end loop()