DHT11 Sensor for Temperature and Humidity
This DHT11 module integrates sensor and other required components on a small PCB. The DHT11 sensor includes a resistive-type humidity measurement component, an NTC temperature measurement component and a high-performance 8-bit microcontroller inside, and provides calibrated digital signal output. It has high reliability and excellent long-term stability, thanks to the exclusive digital signal acquisition technique and temperature & humidity sensing technology.
The module is a PCB that has DHT11 component soldered with a few components, and it is a 3-wire module:
1. VCC connected to +3.3V~5V
2. DATA connected to the microcontroller IO port
3. GND connected to ground
HOW TO PROCESS THE DATA
Single bus data format is used for the communication and synchronization between MCU and the DHT11 sensor. Each communication process will last about 4ms.
The data is transmitted in this format:
- 8bit integral RH data +
- 8bit decimal RH data +
- 8bit integral T data +
- 8bit decimal T data +
- 8bit check sum.
If the data transmission is correct, the check sum should equals to the lower 8bit of the result of “8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data”.
The default status of the DATA pin is high. When the communication between MCU and DHT11 starts, MCU will pull down the DATA pin for least 18ms. This is called “Start Signal” and it is to ensure DHT11 has detected the signal from MCU. Then MCU will pull up DATA pin for 20-40us to wait for DHT11’s response.
Once DHT11 detects the start signal, it will pull down the DATA pin as “Response Signal”, which will last 80us. Then DHT11 will pull up the DATA pin for 80us, and prepare for data sending.
During the data transition, every bit of data begins with the 50us low-voltage-level and ends with a high-voltage-level signal. The length of the high-voltage-level signal decides whether the bit is “0” or “1”.
Data bit “0” has 26-28us high-voltage length: