Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use DFrobot DHT22 Temperature & Humidity Sensor V2: Examples, Pinouts, and Specs

Image of DFrobot DHT22 Temperature & Humidity Sensor V2
Cirkit Designer LogoDesign with DFrobot DHT22 Temperature & Humidity Sensor V2 in Cirkit Designer

Introduction

The DFRobot DHT22 Temperature & Humidity Sensor V2 is a reliable sensor module capable of measuring both temperature and humidity with high accuracy. It utilizes the DHT22 sensor, which is known for its long-term stability and calibration. This sensor is widely used in various applications such as weather stations, home environment monitoring, HVAC systems, and any project where precise atmospheric conditions are needed.

Explore Projects Built with DFrobot DHT22 Temperature & Humidity Sensor V2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO and DHT22 Temperature and Humidity Sensor with Serial Monitoring
Image of dht22 test: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
This circuit uses an Arduino UNO to interface with a DHT22 temperature and humidity sensor. The Arduino reads data from the DHT22 sensor and outputs the temperature and humidity readings to the Serial Monitor. The DHT22 is powered by the Arduino's 5V and GND pins, and its data pin is connected to digital pin 2 on the Arduino.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based DHT22 Temperature and Humidity Sensor
Image of TEMPERATURA HUMEDAD: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
This circuit consists of an Arduino UNO microcontroller connected to a DHT22 temperature and humidity sensor. The DHT22 sensor is powered by the Arduino's 5V output through a 4.7k Ohm resistor, and its data pin is connected to the digital pin D2 of the Arduino. The embedded code on the Arduino reads the temperature and humidity values from the DHT22 sensor and outputs them to the serial monitor at regular intervals.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Temperature Monitoring System with LCD Display and Piezo Buzzer Alert
Image of ESP interfacing with LCD: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
This circuit uses an ESP32 microcontroller to read temperature data from a DHT22 sensor and display it on a 16x2 I2C LCD screen. If the temperature is outside the normal range (36.5°C to 37.5°C), a piezo buzzer is activated to alert the user.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Temperature and Humidity Sensor with DHT22
Image of firsttry: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
This circuit uses an Arduino UNO to read data from a DHT22 temperature and humidity sensor. The DHT22 is powered by the Arduino's 3.3V and GND pins, with its data output connected to the Arduino's digital pin D2 through a 1.5k Ohm pull-up resistor.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with DFrobot DHT22 Temperature & Humidity Sensor V2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of dht22 test: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
Arduino UNO and DHT22 Temperature and Humidity Sensor with Serial Monitoring
This circuit uses an Arduino UNO to interface with a DHT22 temperature and humidity sensor. The Arduino reads data from the DHT22 sensor and outputs the temperature and humidity readings to the Serial Monitor. The DHT22 is powered by the Arduino's 5V and GND pins, and its data pin is connected to digital pin 2 on the Arduino.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TEMPERATURA HUMEDAD: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
Arduino UNO Based DHT22 Temperature and Humidity Sensor
This circuit consists of an Arduino UNO microcontroller connected to a DHT22 temperature and humidity sensor. The DHT22 sensor is powered by the Arduino's 5V output through a 4.7k Ohm resistor, and its data pin is connected to the digital pin D2 of the Arduino. The embedded code on the Arduino reads the temperature and humidity values from the DHT22 sensor and outputs them to the serial monitor at regular intervals.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP interfacing with LCD: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
ESP32-Based Temperature Monitoring System with LCD Display and Piezo Buzzer Alert
This circuit uses an ESP32 microcontroller to read temperature data from a DHT22 sensor and display it on a 16x2 I2C LCD screen. If the temperature is outside the normal range (36.5°C to 37.5°C), a piezo buzzer is activated to alert the user.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of firsttry: A project utilizing DFrobot DHT22 Temperature & Humidity Sensor V2 in a practical application
Arduino UNO-Based Temperature and Humidity Sensor with DHT22
This circuit uses an Arduino UNO to read data from a DHT22 temperature and humidity sensor. The DHT22 is powered by the Arduino's 3.3V and GND pins, with its data output connected to the Arduino's digital pin D2 through a 1.5k Ohm pull-up resistor.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Home automation systems
  • Weather monitoring stations
  • Environmental data logging
  • HVAC system monitoring
  • Agricultural and soil monitoring

Technical Specifications

Key Technical Details

  • Operating Voltage: 3.3 to 6V DC
  • Output Signal: Digital signal via a single-bus
  • Measuring Range:
    • Humidity: 0-100% RH
    • Temperature: -40°C to 80°C (-40°F to 176°F)
  • Accuracy:
    • Humidity: ±2% RH
    • Temperature: ±0.5°C
  • Resolution:
    • Humidity: 0.1% RH
    • Temperature: 0.1°C
  • Sampling Rate: ≤ 2 seconds

Pin Configuration and Descriptions

Pin Number Name Description
1 VCC Power supply (3.3 to 6V DC)
2 DATA Digital output signal
3 NC Not connected
4 GND Ground

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V supply from your microcontroller board.
  2. Data Signal: Connect the DATA pin to a digital I/O pin on your microcontroller.
  3. Ground: Connect the GND pin to the ground on your microcontroller board.
  4. Pull-up Resistor: A 5.1kΩ to 10kΩ pull-up resistor is typically required between the VCC and DATA pins.

Important Considerations and Best Practices

  • Avoid placing the sensor in direct sunlight or near heat sources for accurate readings.
  • Ensure the sensor is not exposed to condensing humidity levels.
  • Allow the sensor to acclimate to the environment for accurate readings.
  • Use shielded/filtered cables if the sensor is placed in an environment with high electromagnetic interference.

Example Code for Arduino UNO

#include "DHT.h"

#define DHTPIN 2     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22   // DHT 22 (AM2302)

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  // Wait a few seconds between measurements.
  delay(2000);

  // Reading temperature or humidity takes about 250 milliseconds!
  float humidity = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float temperature = dht.readTemperature();

  // Check if any reads failed and exit early (to try again).
  if (isnan(humidity) || isnan(temperature)) {
    Serial.println(F("Failed to read from DHT sensor!"));
    return;
  }

  // Compute heat index in Celsius (isFahrenheit = false)
  float heatIndex = dht.computeHeatIndex(temperature, humidity, false);

  Serial.print(F("Humidity: "));
  Serial.print(humidity);
  Serial.print(F("%  Temperature: "));
  Serial.print(temperature);
  Serial.print(F("°C  Heat index: "));
  Serial.print(heatIndex);
  Serial.println(F("°C"));
}

Troubleshooting and FAQs

Common Issues Users Might Face

  • Inaccurate Readings: Ensure the sensor is not placed near heat sources or in direct sunlight.
  • No Data: Check the wiring, especially the pull-up resistor on the data line.
  • Erratic Readings: Ensure there's no condensation on the sensor and it's acclimated to the environment.

Solutions and Tips for Troubleshooting

  • Sensor Not Responding: Verify the power supply and connections. Reset the microcontroller and try reading again.
  • Consistently High Humidity Readings: Check for any moisture or condensation on the sensor and dry it gently if necessary.
  • Long Cable Runs: Use shielded cables and keep the cable length as short as possible to minimize signal degradation.

FAQs

Q: Can the sensor be used outdoors? A: Yes, but it should be protected from direct sunlight, rain, and condensation.

Q: How long does the sensor need to acclimate to a new environment? A: It typically takes about 30 minutes to an hour for the sensor to stabilize and provide accurate readings.

Q: Is calibration required for the sensor? A: The DHT22 sensor comes pre-calibrated from the factory. However, for critical applications, periodic calibration against a known standard may be necessary.