Electronics

DHT22 Temperature and Humidity Sensor Module (Generic)

AED 17.50

Low stock
1

Description

The DHT22 Humidity and Temperature Sensor is a low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to sense the surrounding air and delivers a digital signal pin. It is quite simple to use

Package Includes:

  • 1 x DHT22 Temperature And Humidity Module.
  • 3 x Female to Female Dupont cable.

 

Features:

  • Full-range temperature compensated
  • Relative humidity and temperature measurement
  • Calibrated digital signal
  • Outstanding long-term stability
  • Extra components not needed
  • Long transmission distance
  • Low power consumption
  • 3 pins Module

 

Description:

The DHT22 Humidity and Temperature Sensor is a low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to monitor the surrounding air and delivers a digital signal pin. It is quite simple to use, although accurate timing is required for data collection. Easily plug the first pin to 3-5V power, one pin into your data input pin, and the last into the ground. Despite the fact that it transmits data via a single connection, it is not Dallas One Wire compatible!  this sensor is more precise and accurate than the DHT11 and works in a higher temperature/humidity range, but it is more expensive and larger, According to its datasheet, it is capable of detecting 0 to 100% relative humidity and temperatures from -40 to 125-degree celsius. The resolution for both humidity and temperature is 0.1 (RH and degree celsius) while the accuracy is +/ 2 for humidity and +/ 0.3 for temperature.

Principle of Work:

The S pin is used to read data to the microcontroller. Because there is no clock pin like in I2C and SPI, the DHT22 must operate in asynchronous serial mode, similar to RS-232. Because a pull-up resistor is required, the sensor can function with both 3.3V and 5V sources. Because of this communication mechanism, known as single-bus, the S pin of the module can be connected to any digital pin of a microcontroller. The DHT22 is factory calibrated and produces serial data, making it extremely simple to set up. A 5K pull-up resistor is used to connect the data pin to an MCU I/O pin. This data pin serially outputs the temperature and humidity values. The data pin will output 8 bit humidity integer data + 8 bit humidity decimal data +8-bit temperature integer data +8-bit fractional temperature data +8-bit parity bit. To request that the DHT11 module provide these data, the I/O pin must be briefly low and then maintained high. The datasheet explains the length of each host signal in precise parts.

 

Pinout of the Board:

1

VCC

Power supply 3.5V to 5.5V

2

Data

Outputs both Temperature and Humidity through serial Data

3

Ground

Connected to the ground of the circuit

 

Note: The sensor will burn down if you connect VCC and GND in the wrong Wiring.


Applications:

  1. Weather station
  2. Humidity regulator
  3. Air conditioner

Circuit:

we will connect the DHT22 sensor to the A0 analog input of the Arduino and then read the temperature and show it on the serial monitor.

  • VCC of the Module connected to the 5V Arduino Pin 
  • GND of the Module connected to the GND Arduino Pin 
  • Data of the Module connected to the A0 Arduino Pin 

 

Library: 

You need to install the below DHT11 library. Just download the below library and open Arduino IDE. Now go to Sketch > Include Library > Add .Zip Library.

DHT Library

. Once it’s done, you can use the code below.

Code:

#include "SimpleDHT.h"

// for DHT22, 
//      VCC: 5V or 3V
//      GND: GND
//      DATA: 2
int pinDHT22 = 2;
SimpleDHT22 dht22(pinDHT22);

void setup() {
  Serial.begin(115200);
}

void loop() {
  // start working...
  Serial.println("=================================");
  Serial.println("Sample DHT22...");
  
  // read without samples.
  // @remark We use read2 to get a float data, such as 10.1*C
  //    if user doesn't care about the accurate data, use read to get a byte data, such as 10*C.
  float temperature = 0;
  float humidity = 0;
  int err = SimpleDHTErrSuccess;
  if ((err = dht22.read2(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT22 failed, err="); Serial.println(err);delay(2000);
    return;
  }
  
  Serial.print("Sample OK: ");
  Serial.print((float)temperature); Serial.print(" *C, ");
  Serial.print((float)humidity); Serial.println(" RH%");
  
  // DHT22 sampling rate is 0.5HZ.
  delay(2500);
}

 

Technical Details:

  • Supply voltage: 5V
  • 3 to 5V power and I/O
  • Temperature range:-40-80℃ resolution0.1℃ error <±0.5℃
  • Humidity range:0-100%RH resolution0.1%RH error±2%RH
  • The sequence of the Pins: VCC, GND, S
  • Size: 38 x 20mm

Resources:

Tutorial1

Datasheet

 

Comparisons:

The DHT22 and DHT11 modules are both popular temperature and humidity sensing modules, but there are some differences between them:

  1. Accuracy and precision: The DHT22 module is generally more accurate and precise than the DHT11 module. The DHT22 has a temperature measurement range of -40°C to 125°C with an accuracy of ±0.5°C, and a humidity measurement range of 0% to 100% with an accuracy of ±2.5%. The DHT11, on the other hand, has a temperature measurement range of 0°C to 50°C with an accuracy of ±2°C, and a humidity measurement range of 20% to 80% with an accuracy of ±5%.
  2. Response time: The DHT22 module has a faster response time than the DHT11 module. The DHT22 takes around 2 seconds to provide a temperature reading and around 2 to 5 seconds to provide a humidity reading. The DHT11 takes around 2 seconds to provide a temperature reading and around 5 to 10 seconds to provide a humidity reading.
  3. Price: The DHT11 module is generally less expensive than the DHT22 module.
  4. Power supply: Both the DHT22 and DHT11 modules can operate on a supply voltage of 3.3V to 5V, but the DHT22 module has a wider operating voltage range of 2.5V to 5.5V.