DHT11 Humidity and Temperature Sensor Module
The DHT11 Humidity and Temperature Sensor Module provides calibrated readings using a single digital pin on your microcontroller.
The DHT11 sensor provides 8 bits of precision for both humidity and temperature.
It uses a single line for bidirectional serial communications.
An Arduino library is available to simplify operation.
It can measure temperatures from 0° to 50° Celsius (32° to 122° Fahrenheit) and humidity from 20% to 95% Relative Humidity.
This sensor works with both 3.3V and 5V microcontroller systems.
The interesting thing in this module is the protocol that uses to transfer data.
All the sensor readings are sent using a single wire bus which reduces the cost and extends the distance.
In order to send data over a bus you have to describe the way the data will be transferred, so that transmitter and receiver can understand what says each other. This is what a protocol does. It describes the way the data are transmitted.
On DHT-11 the 1-wire data bus is pulled up with a resistor to VCC. So if nothing is occurred the voltage on the bus is equal to VCC.
To make the DHT-11 to send you the sensor readings you have to send it a request. The request is, to pull down the bus for more than 18ms in order to give DHT time to understand it and then pull it up for 40uS.
What comes after the request is the DHT-11 response. This is an automatic reply from DHT which indicates that DHT received your request. The response is ~54uS low and 80uS high.
What will come after the response is the sensor data. The data will be packed in a packet of 5 segments of 8-bits each. Totally 5×8 =40bits.
First two segments are Humidity read, integral & decimal. Following two are Temperature read in Celsius, integral & decimal and the
last segment is the Check Sum which is the sum of the 4 first segments.
If Check Sum's value isn't the same as the sum of the first 4 segments that means that data received isn't correct.
How to Identify Bits:
Each bit sent is a follow of ~54uS Low in the bus and ~24uS to 70uS High depending on the value of the bit.
Bit '0' : ~54uS Low and ~24uS High
Bit '1' : ~54uS Low and ~70uS High
End Of Frame:
At the end of packet DHT sends a ~54uS Low level, pulls the bus to High and goes to sleep mode.
All the above protocol methods are provided in Arduino DHT11 Library .Just copy the library to libraries folder of Arduino & try the sample code.
DATASHEET FROM ITEAD
DHT11 ARDUINO LIBRARY WITH DEMO CODE