Product Description
DHT11 Relative Humidity- Temperature – Sensor Module For Arduino
Can detect surrounding environment of the humidity and temperature
Features:
Humidity measurement range: 20% ~ 95%
Humidity measurement error: +/- 5%
Temperature measurement range: 0°C ~ 50°C
Temperature measurement error: +/- 2°C
Working voltage 3.3V ~ 5V
Output 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)
mode: DIGITAL OUTPUT
PCB size: 3.1 x 1.4cm
DHT series digital temperature and humidity sensor – full scale calibration, digital output – humidity measurement range: 20% to 9 0%RH (0-50 ° C temperature compensation); temperature measurement range: 0 to +50 ° C; humidity measurement accuracy: measurement accuracy of ± 5.0%RH temperature: ± 2 ° C response time: <5 seconds; low power consumption
EXAMPLE CODE
ARD_DHT11_HCARDU0020_Example.pde
/* FILE: ARD_DHT11_HCARDU0020_Example.pde
DATE: 02/07/12
VERSION: 0.1
This is a simple example of how to use the HobbyComponents Arduino DHT11 module
(HCARDU0020). The module will work with the Arduino DHT11 library available at
http://arduino.cc/playground/Main/DHT11Lib without any modification. This code
demonstrates the use of this library to output the current temperature and humidity
measured by the sensor.
You may copy, alter and reuse this code in any way you like but please leave
reference to HobbyComponents.com in your comments if you redistribute this code. */
/* Include the DHT11 library available at http://arduino.cc/playground/Main/DHT11Lib */
#include <dht11.h>
dht11 DHT11;
/* Define the DIO pin that will be used to communicate with the sensor */
#define DHT11_DIO 2
void setup()
{
/* Setup the serial port for displaying the output of the sensor */
Serial.begin(9600);
}
/* Main program loop */
void loop()
{
/* Perform a read of the sensor and check if data was read OK */
if (DHT11.read(DHT11_DIO) == DHTLIB_OK)
{
/* If so then output the current temperature and humidity to
the serial port */
Serial.print("Temperature: ");
Serial.print((float)DHT11.temperature, 2);
Serial.print("oC\t");
Serial.print("Humidity: ");
Serial.print((float)DHT11.humidity, 2);
Serial.println("%");
}else
{
/* If there was a problem reading from then sensor then output
an error */
Serial.println("ERROR");
}
delay(500);
}