Difference Between DHT11, DHT12 and DHT22 Temperature & Humidity Sensor

Comprehensive Guide: DHT11, DHT12, and DHT22 Temperature & Humidity Sensors

When selecting a temperature and humidity sensor, it’s common to face uncertainty about the differences between DHT11, DHT12, and DHT22. In this guide, we’ll break down the key distinctions and help you choose the right sensor for your application.

DHT11 Temperature and Humidity Sensor

The DHT11 is a reliable sensor for measuring temperature and humidity, offering a digital signal output for seamless interfacing with microcontrollers. Its design incorporates advanced digital module capture technology combined with a resistive moisture sensor and NTC temperature measurement. These features provide consistent performance and long-term stability.

DHT11 Pinout:

PinNameDescription
1VCCPower supply (3.3V to 5.5V)
2DataOutputs temperature and humidity
3NCNo Connection
4GroundConnect to circuit ground

Communication Protocol: DHT11 uses a single-wire, bidirectional communication protocol. It requires a pull-up resistor (5.1kΩ typical) to maintain a high state when idle. Communication begins with the host microcontroller sending a start signal. The sensor then responds and sends 40 bits of data representing humidity and temperature.

Data Format:

  • 8 bits: Integral Relative Humidity
  • 8 bits: Decimal Relative Humidity
  • 8 bits: Integral Temperature
  • 8 bits: Decimal Temperature
  • 8 bits: Checksum

To validate the data, sum the humidity and temperature bytes and compare the result to the checksum.

DHT12 Temperature and Humidity Sensor

The DHT12 builds upon the DHT11, offering additional features like compatibility with I2C communication and improved accuracy. Its compact size and low power consumption make it suitable for a wide range of applications.

DHT12 Pinout:

PinNameDescription
1VDDPower supply (2.7V to 5.5V)
2SDASerial data, bidirectional
3GNDConnect to circuit ground
4SCLSerial clock input

I2C Communication Protocol: DHT12 supports both single-wire and I2C communication. For I2C, it uses a predefined address of 0xB8. Communication requires pull-up resistors on the SDA and SCL lines.

Data Format: The DHT12 provides 40 bits of data:

  • 16 bits: Relative Humidity (Integral and Decimal)
  • 16 bits: Temperature (Integral and Decimal)
  • 8 bits: Checksum

Example: Data bytes like 00111000 00001000 00011010 00000110 01100000 indicate a humidity of 56.8% RH and a temperature of 26.6°C.

DHT22 (AM2302) Temperature and Humidity Sensor

The DHT22, also known as AM2302, offers higher accuracy and a broader measurement range compared to DHT11 and DHT12. It features an 8-bit microprocessor, temperature calibration, and a larger sensing range, making it suitable for more demanding applications.

DHT22 Pinout:

PinNameDescription
1VDDPower supply (3.3V to 6V)
2DataSignal output
3NULLNo Connection
4GNDConnect to circuit ground

Communication Protocol: Like DHT11, DHT22 uses a single-wire communication protocol. Data transmission includes a start signal from the microcontroller, followed by a response and data transmission from the sensor.

Data Format:

  • 16 bits: Relative Humidity (Integral and Decimal)
  • 16 bits: Temperature (Integral and Decimal)
  • 8 bits: Checksum

For accurate readings, the DHT22 requires a delay of 2 seconds between measurements.

Comparison of DHT11, DHT12, and DHT22

FeatureDHT11DHT12DHT22
Power Supply3.3V-5.5V2.7V-5.5V3.3V-6V
Humidity Range20-80% RH20-95% RH0-100% RH
Temperature Range0°C to 50°C-20°C to 60°C-40°C to 125°C
Accuracy±2°C, ±5% RH±0.5°C, ±5% RH±0.5°C, ±2-5% RH
Sampling Rate1 Hz1 Hz0.5 Hz

Key Takeaways

  • DHT11: Affordable and compact but limited in range and accuracy.
  • DHT12: Enhanced accuracy and flexibility with I2C compatibility.
  • DHT22: Superior range and precision, ideal for demanding applications.

By understanding the differences among DHT11, DHT12, and DHT22, you can select the sensor that best fits your project’s requirements. For more information or to purchase these sensors, visit Regent Electronics today!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top