Stufin
Home Quick Cart Profile

DHT22 Temperature Sensor

Buy Now on Stufin

Temperature range

-40C to 80C (0.5C accuracy)

Humidity range

0% to 100% RH (2% accuracy)

  • Digital Output:

Outputs temperature and humidity values as a digital signal, eliminating the need for analog-to-digital converters.

  • Single-Wire Communication:

Uses a single bus pin for data transmission, reducing the number of required I/O pins on the microcontroller.

  • Low Power Consumption:

Operating current

1.5mA (typical)

Sleep current

0.1mA (typical)

  • Fast Response Time:

Temperature measurement time

2 seconds (typical)

Humidity measurement time

2 seconds (typical)

  • Operating Voltage:

3.3V to 5.5V (allowable voltage range)

  • Compact Design:

Small size

15mm x 12mm x 6mm (L x W x H)

  • Built-in Temperature and Humidity Sensors:

No external sensors or components required

  • Excellent Reliability:

Built with high-quality components for reliable operation in various environments

Physical Characteristics

Dimension

15mm x 12mm x 6mm (L x W x H)

Weight

2 grams (approximately)

Pinout

+ VCCPower supply pin (3.3V to 5.5V)
+ GNDGround pin
+ DATASingle-wire communication pin

Applications

  • Weather stations
  • Environmental monitoring systems
  • Home automation systems
  • Industrial automation systems
  • IoT projects
  • Robotics
  • Medical devices
  • Agricultural monitoring systems
The DHT22 temperature sensor is suitable for a wide range of applications, including

Certifications and Compliance

  • RoHS (Restriction of Hazardous Substances) compliant
  • CE (Conformit Europene) certified
  • FCC (Federal Communications Commission) compliant
The DHT22 temperature sensor module complies with the following certifications and standards

Conclusion

The DHT22 temperature sensor module is a reliable, accurate, and user-friendly component for measuring temperature and humidity levels in various IoT applications. Its compact design, low power consumption, and digital output make it an ideal choice for projects requiring precise environmental monitoring.

Pin Configuration

  • DHT22 Temperature and Humidity Sensor Documentation
  • Overview
  • The DHT22 is a low-cost, high-accuracy digital temperature and humidity sensor module ideal for various IoT applications. It's a popular choice among makers and professionals alike due to its ease of use, high reliability, and compact size.
  • Pin Description
  • The DHT22 sensor module has a total of four Pins, which are:
  • Pin 1: VCC (Power Supply)
  • ------------------------------------------------
  • Function: Power Supply
  • Description: Connect this pin to a 3.3V or 5V power supply to power the sensor module.
  • Recommended Connection: Connect to the VCC pin of your microcontroller or a dedicated power supply line.
  • Pin 2: Data (Output)
  • -------------------------
  • Function: Digital Data Output
  • Description: This pin sends the temperature and humidity data in digital format to the microcontroller or other receiving devices.
  • Recommended Connection: Connect to any digital input pin of your microcontroller.
  • Pin 3: No Connection (NC)
  • ------------------------------
  • Function: No Connection
  • Description: This pin is not used and should be left unconnected.
  • Pin 4: GND (Ground)
  • -------------------------
  • Function: Ground
  • Description: Connect this pin to the ground of your power supply or microcontroller.
  • Recommended Connection: Connect to the GND pin of your microcontroller or a dedicated ground line.
  • Connection Structure
  • Here is a recommended connection structure for the DHT22 sensor module:
  • ```ascii
  • +-----------+
  • | Micro |
  • | Controller|
  • +-----------+
  • |
  • | VCC
  • |
  • v 3.3V/5V
  • +-----------+
  • | DHT22 |
  • | Sensor |
  • | Module |
  • +-----------+
  • |
  • | VCC |-----------|
  • | | |
  • | DATA |-----------| Digital I/O Pin
  • | | |
  • | NC | | (Leave Unconnected)
  • | | |
  • | GND |-----------| GND
  • +-----------+
  • ```
  • Important Notes:
  • Make sure to connect the VCC pin to a stable 3.3V or 5V power supply to ensure accurate readings.
  • Use a pull-up resistor (1k - 10k) between the DATA pin and VCC to improve signal reliability.
  • Keep the sensor module away from direct sunlight, moisture, and extreme temperatures to ensure accurate readings.
  • By following these guidelines, you can successfully connect and integrate the DHT22 temperature and humidity sensor module into your IoT projects.

Code Examples

DHT22 Temperature Sensor Documentation
Overview
The DHT22 is a low-cost, accurate, and reliable digital temperature and humidity sensor. It's widely used in IoT projects, weather stations, and home automation systems.
Pinout
VCC: Connect to 3.3V or 5V power supply
 GND: Connect to ground
 DATA: Connect to digital pin on microcontroller
Technical Specifications
Temperature range: -40C to 80C with 0.5C accuracy
 Humidity range: 0% to 100% with 2% accuracy
 Resolution: 0.1C for temperature, 0.1% for humidity
 Response time: 5 seconds
Code Examples
### Example 1: Arduino Connection and Reading Temperature and Humidity
This example demonstrates how to connect the DHT22 sensor to an Arduino board and read temperature and humidity values.
```c
#include <DHT.h>
#define DHTPIN 2     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
  Serial.begin(9600);
  dht.begin();
}
void loop() {
  delay(2000);
float t = dht.readTemperature();
  float h = dht.readHumidity();
if (isnan(t) || isnan(h)) {
    Serial.println("Failed to read from DHT sensor!");
  } else {
    Serial.print("Temperature: ");
    Serial.print(t);
    Serial.println(" C");
Serial.print("Humidity: ");
    Serial.print(h);
    Serial.println(" %");
  }
}
```
### Example 2: Raspberry Pi Connection using Python
This example demonstrates how to connect the DHT22 sensor to a Raspberry Pi and read temperature and humidity values using Python.
```python
import Adafruit_DHT
sensor = Adafruit_DHT.DHT22
pin = 4  # GPIO pin connected to the DHT sensor
while True:
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
if humidity is not None and temperature is not None:
        print('Temp={0:0.1f}C  Humidity={1:0.1f}%'.format(temperature, humidity))
    else:
        print('Failed to get reading. Try again!')
```
Note: Make sure to install the necessary libraries and modules for your chosen platform before running the code examples.