DEV Community

Cover image for What Do You Need to Know About the DHT22 Sensor Before Using It?
Ganesh Kumar
Ganesh Kumar

Posted on

What Do You Need to Know About the DHT22 Sensor Before Using It?

Hello, I'm Ganesh. I'm building git-lrc, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product.

In this article, I will be explaining the DHT22 sensor.

What is the DHT22 sensor?

So, Based on datasheet provided by the manufacturer.

DHT22 is a low cost digital temperature and humidity sensor.

It is a digital sensor, which means it outputs a digital signal, which can be read by a microcontroller.

What are it's Key Features?

Sensor Type: Digital-output relative humidity and temperature sensor/module.

Key Features: It offers full-range temperature compensation, a calibrated digital signal, outstanding long-term stability, and low power consumption.

Design: It comes in a 4-pin single row package and is fully interchangeable. Where only 3 pins are used. It does not require any extra components.

What are it's Technical Specifications of DHT22?

Power Supply: It operates on 3.3-6V DC. Which means it can be powered by 3.3v supply microcontrollers like ESP32, ESP8266, Raspberry Pi Pico, etc. It can also be connected with 5v supply microcontrollers like Arduino Uno, etc.
But it is recommended to use 3.3v supply for better accuracy.

Output Signal: Digital signal via single-bus.

Operating Range: Humidity 0-100% RH; Temperature -40 to 80 Celsius.

Accuracy: Humidity ±2% RH (Max ±5% RH); Temperature <±0.5 Celsius.

Resolution: Humidity 0.1% RH; Temperature 0.1 Celsius.

Long-term Stability: ±0.5% RH/year.
Sensing Period: Average of 2 seconds.

What is the Pin Configuration of DHT22?

Pin 1: VDD (Power supply).

Pin 2: DATA (Signal).

Pin 3: NULL (No connection).

Pin 4: GND (Ground).

Which Communication Protocol DHT22 uses?

It uses a single-bus communication between the microcontroller (MCU) and the DHT22, taking about 5ms for a single communication.

Data Format: The sensor sends 40-bit data in this exact structure:

  • 8-bit integral RH data
  • 8-bit decimal RH data
  • 8-bit integral T data
  • 8-bit decimal T data
  • 8-bit check-sum.

The check-sum should equal the sum of the first four 8-bit data blocks if the transmission was successful.

What are the Operational Precautions of DHT22?

Chemical Exposure: Vapor from chemical materials can interfere with its sensitive elements and decrease sensitivity.

Environmental Factors: You should avoid using the sensor under dew conditions and keep it away from prolonged exposure to strong light and ultraviolet rays, as this can degrade performance.

Soldering: Welding temperature must be kept below 260 Celsius.
Safety Warning: Do not use this product in safety or emergency stop devices, or in any situation where its failure could cause personal injury.

Conclusion

We could understand about DHT22 sensor. Majorly identified it's features, technical specifications, pin configuration, communication protocol, and operational precautions.

For even more detailed information, you can refer to the datasheet provided by the manufacturer. Link to datasheet

In the next article, let's connect the MCU to the sensor and read sensor data.

git-lrc

Any feedback or contributors are welcome! It’s online, source-available, and ready for anyone to use.
⭐ Star it on GitHub: https://github.com/HexmosTech/git-lrc

Top comments (0)