Overview
The DHT11 is a commonly used digital temperature and humidity sensor that is simple to use and low cost. The following provides a concise introduction to the DHT11 sensor.
Operating Principle
The DHT11 contains a temperature and humidity sensing element and an A/D conversion module. When triggered, the sensing element measures ambient temperature and humidity, and the A/D converter converts the analog signals to digital signals, which are then sent to an external microcontroller or controller.
Technical Specifications
- Measurement range: temperature 0-50 C, humidity 20-90 %RH
- Accuracy: temperature ±2 C, humidity ±5 %RH
- Operating voltage: 3 V - 5.5 V
- Output: digital signal output
Features
- Digital output: single-wire digital interface for easy connection to various microcontrollers
- Low cost: uses simple measurement principle and low-cost components
- Wide application: commonly used in temperature and humidity monitoring systems such as greenhouses, storage facilities, and home air conditioners
Usage Notes
- Connection stability: use a pull-up resistor on the data line to ensure stable data transmission
- Data update rate: the DHT11 is not suitable for high-frequency sampling; a measurement interval of 2 to 5 seconds is typical
Data Transmission Process
- Initialization: the host controller sends a start signal to the DHT11 to notify the sensor to prepare for data transmission.
- Start signal: the host pulls the data line low (typically for 18 ms), then pulls it high for 20-40 us to send the start signal to the DHT11.
- Acknowledgement: after receiving the start signal, the DHT11 responds by pulling the data line low for 80 us and then high for 80 us.
- Data transmission: following the acknowledgement, the DHT11 transmits data including humidity integer, humidity decimal, temperature integer, temperature decimal, and a checksum byte.
- Bit timing: each data bit is sent as a 50 us low-level pulse followed by a high-level pulse. The duration of the high-level pulse distinguishes the bit value.
- Checksum: after transmitting the humidity and temperature bytes, the DHT11 sends an 8-bit checksum that the host can use to verify data integrity.
- End of transmission: after sending the data, the DHT11 returns to standby mode and waits for the next measurement request.
In summary, the DHT11 communicates via a single-wire digital protocol: the host sends a start signal, the sensor acknowledges and sends data, and the host verifies the data using the checksum. This process enables accurate acquisition of temperature and humidity data.