Skip to Content

DHT22 Temperature Humidity Sensor

The DHT22 Humidity and Temperature Sensor is an affordable and efficient digital sensor designed for accurately measuring temperature and humidity levels in various environments. Utilizing a combination of a capacitive humidity sensor and a thermistor, this sensor provides precise data through a digital signal pin, making it user-friendly and straightforward to integrate into your projects. Whether you're a hobbyist or a professional, the DHT22 Sensor is an excellent choice for monitoring and controlling environmental conditions.

Package Includes:

  • 1 x DHT22 Temperature And Humidity Sensor.

17.50 AED 17.50 AED Tax Included
17.50 AED Tax Included

Not Available For Sale

This combination does not exist.

DHT Temperature Humidity Sensor

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

Features:

  • Digital Sensor: The DHT22 Humidity and Temperature Sensor is a digital sensor, that provides accurate and reliable data output.
  • Capacitive Humidity Sensor: Utilizes a capacitive humidity sensor for precise humidity measurements.
  • Thermistor for Temperature: Incorporates a thermistor to monitor temperature variations with high accuracy.
  • Single Digital Signal Pin: Transmits both temperature and humidity data through a single digital signal pin, simplifying connections.
  • Wide Operating Voltage Range: Operates on a voltage range of 3-5V, making it compatible with a variety of power sources.
  • Non-Dallas One Wire Compatible: Important to note that this sensor is not compatible with the Dallas One Wire protocol.
  • Extended Temperature Range: Capable of measuring temperatures from -40 to 125 degrees Celsius, suitable for diverse environments.
  • High Humidity Range: Detects humidity levels ranging from 0 to 100%, accommodating a wide range of humidity conditions.
  • High Resolution: Offers a resolution of 0.1 for both humidity and temperature, ensuring precise data capture.
  • Accuracy: Provides reliable data with an accuracy of +/- 2% for humidity and +/- 0.3 degrees Celsius for temperature.
  • Versatile Applications: Suited for a broad spectrum of applications, from DIY projects to professional environmental monitoring.

 

Description:

The DHT22 Humidity and Temperature Sensor, is a digital sensor renowned for its exceptional precision in the realm of temperature and humidity monitoring. This sensor boasts an advanced design that combines the power of a capacitive humidity sensor and a thermistor, delivering reliable and highly accurate data through a single digital signal pin. Its versatility and ease of integration make it a top choice across a broad spectrum of applications. What truly sets this sensor apart is its remarkable measurement range, encompassing the full spectrum from 0 to 100% relative humidity and temperatures spanning an impressive -40 degrees Celsius to 125 degrees Celsius. The sensor offers a resolution of 0.1 for both humidity and temperature, ensuring minute changes are captured with utmost precision. Its accuracy, rated at +/- 2% for humidity and +/- 0.3 degrees Celsius for temperature, ensures that you can depend on its data for critical tasks. Whether you're a seasoned professional requiring the utmost accuracy or an enthusiastic hobbyist embarking on DIY projects, the DHT22 Sensor is your trusty companion for unrivaled accuracy and reliability in temperature and humidity measurements. Elevate your projects with the precision and versatility of the DHT22.

 

Principle of Work:

The DHT22 Humidity and Temperature Sensor operates using two main components: a capacitive humidity sensor and a thermistor:

  1. Humidity Measurement:

    • The capacitive humidity sensor consists of a thin film of a moisture-absorbing material.
    • As the surrounding air's humidity changes, this material absorbs or releases moisture, changing its dielectric constant.
    • The sensor measures the capacitance changes caused by this dielectric constant variation.
    • These changes in capacitance are then converted into a digital signal representing relative humidity.
  2. Temperature Measurement:

    • The thermistor is a temperature-sensitive resistor.
    • Its resistance varies with temperature, following the characteristics of a known curve.
    • The sensor measures the resistance of the thermistor.
    • This resistance value is converted into a digital signal representing temperature.

Interaction with MCU (Microcontroller Unit):

The DHT22 Sensor interacts with a microcontroller (MCU) like an Arduino or Raspberry Pi to provide temperature and humidity data to your projects:

  1. Power Supply: You connect the sensor's power pin to a 3-5V power source from the MCU.

  2. Data Connection:

    • The data pin of the sensor is connected to one of the digital input/output (GPIO) pins on the MCU.
    • The sensor communicates with the MCU through this single data pin.
  3. Data Transmission:

    • To request data, the MCU sends a start signal to the sensor by briefly pulling the data pin low.
    • The sensor responds by transmitting data, including temperature and humidity readings, serially over the data pin.
    • The MCU receives this data and interprets it for use in your project.
  4. Data Interpretation:

    • The MCU uses its programming and libraries (e.g., Arduino libraries for DHT sensors) to decode the digital signal sent by the DHT22.
    • It converts the received data into temperature and humidity values that you can use in your application.
  5. Data Processing:

    • Once the MCU has the sensor data, you can perform further processing, store it, display it on a screen, or use it for control purposes in your project.

 

Pinout of the Board:

1

Vcc

Power supply 3.5V to 5.5V

2

Data

Outputs both Temperature and Humidity through serial Data

3

NC

No Connection and hence not used

4

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 Stations: Monitor temperature and humidity for local weather data collection, enabling accurate weather forecasting.
  2. Indoor Climate Control: Use in-home HVAC systems to maintain optimal indoor temperature and humidity levels for comfort and energy efficiency.
  3. Greenhouses: Control the environment in greenhouses to ensure ideal conditions for plant growth and yield.
  4. Food Storage: Monitor temperature and humidity in refrigerators and food storage areas to prevent spoilage and ensure food safety.
  5. Industrial Processes: Integrate into industrial processes where precise environmental conditions are crucial for manufacturing and quality control.
  6. Data Centers: Ensure temperature and humidity control in data centers to prevent overheating and protect sensitive equipment.
  7. Museums and Archives: Preserve artwork, historical documents, and artifacts by maintaining the correct humidity and temperature levels.
  8. HVAC Efficiency: Optimize heating, ventilation, and air conditioning (HVAC) systems by using real-time environmental data for efficient energy usage.
  9. Agriculture: Monitor environmental conditions in agricultural settings to improve crop yields and reduce resource waste.
  10. Drying and Dehumidification: Control drying and dehumidification processes in industries like pharmaceuticals and food processing.
  11. Automated Terrariums: Create and maintain artificial environments for reptiles and plants in terrariums or vivariums.
  12. DIY Projects: Incorporate the sensor into various DIY electronics projects for environmental monitoring and automation.
  13. Home Automation: Use in smart home systems to trigger actions based on temperature and humidity changes, such as controlling fans or humidifiers.
  14. Environmental Research: Collect data for environmental research, including climate studies and ecological monitoring.
  15. Cold Chain Monitoring: Ensure the integrity of temperature-sensitive shipments during transportation in the pharmaceutical and food industries.
  16. Incubators: Maintain precise conditions in incubators for breeding reptiles, birds, or for hatching poultry eggs.
  17. Laboratories: Use in laboratories for experiments requiring precise temperature and humidity control.
  18. IoT Applications: Integrate into Internet of Things (IoT) projects to remotely monitor and control environmental conditions.

 

Circuit:

Setting up the circuit for this sensor is remarkably simple, requiring only a few components and connections:

  1. Connect a 10k resistor between pin 1 and pin 2 on the humidity sensor.
  2. Link pin 1 to the 5V pin on the Arduino.
  3. Connect pin 2 directly to pin 2 on the Arduino.
  4. Make sure not to use pin 3 on the sensor.
  5. Finally, establish a connection from pin 4 to the GND (Ground) on the Arduino.

 

Library: 

  1. Download the Library:

  2. Install the Library in Arduino IDE:

    • Open the Arduino IDE on your computer.
  3. Import the Library:

    • From the Arduino IDE, go to "Sketch" in the menu bar.
    • Select "Include Library" and then click on "Add .ZIP Library."
  4. Locate and Select the ZIP File:

    • Navigate to the location where you downloaded the SimpleDHT ZIP file and select it.
  5. Install the Library:

    • Click the "Open" button or "Choose" button (depending on your operating system) to install the library.

 

Code:

This code continuously loops through these steps, providing real-time temperature and humidity readings in the serial monitor. The readings are displayed in degrees Celsius for temperature and percentage for humidity. If there are any issues with the sensor reading, it reports an error and waits before attempting the next reading:

#include "SimpleDHT.h"

// Define the DHT22 data pin
int pinDHT22 = 2;
SimpleDHT22 dht22(pinDHT22);

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(115200);
}

void loop() {
  // Print a header for each reading
  Serial.println("=================================");
  Serial.println("Sample DHT22...");

  // Read temperature and humidity data
  float temperature = 0;
  float humidity = 0;
  int err = SimpleDHTErrSuccess;

  // Attempt to read data from the DHT22 sensor
  if ((err = dht22.read2(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT22 failed, err="); 
    Serial.println(err);
    delay(2000); // Delay before the next reading
    return;
  }

  // Print the obtained data
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" *C");
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.println(" RH%");

  // Delay before the next reading (DHT22 sampling rate is 0.5Hz)
  delay(2000);
}


  1. Include Library: The code includes the "SimpleDHT" library, which is used for interfacing with DHT-type sensors.
  2. Pin Configuration: It defines the data pin (pinDHT22) to which the DHT22 sensor is connected. The DHT22 sensor requires three connections: VCC (5V or 3V), GND (Ground), and DATA (connected to pin 2 on the Arduino in this code).
  3. Setup: In the setup() function, it initializes the serial communication with a baud rate of 115200 for debugging purposes.
  4. Loop: The loop() function is the main part of the code, which continuously runs:

    • It prints a header message indicating that it's sampling the DHT22 sensor.

    • It attempts to read temperature and humidity data from the DHT22 sensor using the dht22.read2() method.

    • If the reading is successful (SimpleDHTErrSuccess), it prints the temperature and humidity values to the serial monitor.

    • If there's an error during the reading, it prints an error message and then waits for 2 seconds before attempting another reading. This delay is to avoid rapidly reading the sensor, as the DHT22 sensor has a recommended sampling rate of 0.5Hz (once every 2 seconds).

 

 

Technical Details:

  • Temperature range: -40 to 80ºC +/- 5ºC
  • Relative humidity range: 0 to 100% +/-2%
  • Temperature resolution: 0.1ºC
  • Humidity resolution: 0.1%
  • Operating voltage: 3 to 6 V DC
  • Current supply: 1 to 1.5 mA
  • Sampling period: 2 seconds

 

Resources:

 

Comparisons:

Choosing the right temperature and humidity sensor is a pivotal decision in electronic projects and environmental monitoring applications. In this comparison, we delve into the differences and advantages of three popular sensors: the DHT22, DHT11, and LM35. These sensors cater to a wide range of needs, from precision and versatility to simplicity and cost-effectiveness:

1. Accuracy:

  • DHT22: The DHT22 is known for its higher accuracy compared to the DHT11 and LM35. It has an accuracy of +/- 0.3 degrees Celsius for temperature and +/- 2% for humidity.
  • DHT11: The DHT11 is less accurate than the DHT22, with an accuracy of +/- 2 degrees Celsius for temperature and +/- 5% for humidity.
  • LM35: The LM35 is a highly accurate temperature sensor with an accuracy of +/- 0.5 degrees Celsius.

2. Temperature Range:

  • DHT22: It can measure temperatures from -40 to 125 degrees Celsius.
  • DHT11: The DHT11 can measure temperatures from 0 to 50 degrees Celsius.
  • LM35: The LM35 can measure temperatures in the range of -55 to 150 degrees Celsius.

3. Humidity Range:

  • DHT22: It can measure humidity in the range of 0 to 100%.
  • DHT11: The DHT11 can measure humidity from 20% to 80%.
  • LM35: The LM35 does not measure humidity; it's a temperature-only sensor.

4. Output Type:

  • DHT22 and DHT11: Both DHT sensors provide digital output, which simplifies interfacing with microcontrollers like Arduino.
  • LM35: The LM35 provides analog output and requires an analog-to-digital converter (ADC) to interface with digital microcontrollers.

6. Complexity:

  • DHT22 and DHT11: These sensors are straightforward to use and provide both temperature and humidity data in a single package.
  • LM35: The LM35 is a temperature-only sensor and requires additional components for humidity measurement if needed.

7. Power Consumption:

  • DHT22 and DHT11: Both DHT sensors have low power consumption, making them suitable for battery-powered applications.
  • LM35: The LM35 is also power-efficient.

8. Sampling Rate:

  • DHT22 and DHT11: These sensors have a recommended sampling rate of 0.5Hz (once every 2 seconds).
  • LM35: The LM35 can be read at a higher frequency since it's a purely analog sensor.

9. Ease of Interfacing:

  • DHT22 and DHT11: They are easy to interface with digital microcontrollers like Arduino due to their digital output.
  • LM35: It requires an analog-to-digital converter (ADC) for interfacing with digital microcontrollers.

10. Application:

  • - DHT22: Suited for applications where higher accuracy in both temperature and humidity measurements is essential.
  • - DHT11: Suitable for basic applications where lower accuracy is acceptable, and cost is a factor.
  • - LM35: Primarily used for high-precision temperature measurements, often in industrial and scientific applications.