Stufin
Home Quick Cart Profile

DHT22 Temperature Sensor ( Pack of 25)

Buy Now on Stufin

Operating Voltage

3.3V to 5.5V

Operating Current

<2.5mA

Temperature Range

-40C to 80C

Humidity Range

0 to 100%

Temperature Accuracy

0.5C

Humidity Accuracy

2%

Response Time

<2 seconds

Interface

Digital (3-pin)

Dimensions

15mm x 10mm x 5mm

Weight

2g

Packaging Information

The DHT22 Temperature Sensor is available in a pack of 25 pieces, making it a cost-effective option for large-scale projects or prototyping. Each sensor is individually packaged in an anti-static bag to prevent damage during shipping and storage.

Applications

The DHT22 Temperature Sensor is suitable for a wide range of applications, including

Weather monitoring systems

Home automation and control systems

Industrial process control systems

Robotics and drone applications

Medical devices and equipment

Agricultural monitoring and automation systems

Conclusion

The DHT22 Temperature Sensor is a high-accuracy, low-cost digital temperature and humidity sensor designed for IoT and robotics applications. Its accuracy, fast response time, and low power consumption make it a popular choice for various industries and applications.

Pin Configuration

  • DHT22 Temperature Sensor (Pack of 25) Pinout Explanation
  • The DHT22 is a popular digital temperature and humidity sensor widely used in IoT applications. It's essential to understand the pinout of the sensor to ensure proper connection and usage. Here's a detailed explanation of each pin:
  • Pinout Structure:
  • The DHT22 sensor has a single row of 4 pins, labeled as follows:
  • 1. VCC (Pin 1)
  • Function: Power supply pin
  • Description: This pin should be connected to a DC power source (typically 3.3V or 5V) to power the sensor.
  • 2. DATA (Pin 2)
  • Function: Digital data output pin
  • Description: This pin sends digital data to the microcontroller or other devices, including temperature and humidity readings.
  • 3. NC (Pin 3)
  • Function: No Connection
  • Description: This pin is not connected internally and should be left unconnected.
  • 4. GND (Pin 4)
  • Function: Ground pin
  • Description: This pin should be connected to the ground of the power supply or the microcontroller's ground pin.
  • Connection Structure:
  • To connect the DHT22 sensor, follow this structure:
  • Connect VCC (Pin 1) to a 3.3V or 5V power supply (depending on the microcontroller or device's voltage requirement).
  • Connect DATA (Pin 2) to a digital input pin on the microcontroller or other devices (e.g., Arduino, Raspberry Pi, etc.).
  • Leave NC (Pin 3) unconnected.
  • Connect GND (Pin 4) to the ground of the power supply or the microcontroller's ground pin.
  • Important Notes:
  • When using the DHT22 sensor with a microcontroller, ensure the power supply voltage is within the recommended range (3.3V to 5V).
  • Use a pull-up resistor ( typically 1k to 10k) between the DATA (Pin 2) and VCC (Pin 1) to prevent signal corruption and ensure reliable data transmission.
  • Avoid connecting the sensor to a digital output pin, as it may interfere with the sensor's operation.
  • When handling the sensor, take anti-static precautions to prevent damage.
  • By following this pinout explanation and connection structure, you can correctly connect and use the DHT22 temperature sensor in your IoT projects.

Code Examples

DHT22 Temperature Sensor (Pack of 25)
===============================================
Overview
-----------
The DHT22 is a digital temperature and humidity sensor that provides high accuracy and reliability. This pack of 25 sensors is ideal for IoT projects, DIY enthusiasts, and researchers. The DHT22 sensor Measures temperature from -40C to 125C and humidity from 0% to 100%.
Pinout
---------
The DHT22 sensor has a simple 3-pin interface:
VCC (Power) - Connect to 3.3V or 5V power supply
 GND (Ground) - Connect to ground
 OUT (Data) - Connect to digital pin on your microcontroller
Technical Specifications
-------------------------
Temperature Range: -40C to 125C
 Humidity Range: 0% to 100%
 Accuracy: 0.5C (temperature), 2% (humidity)
 Power Supply: 3.3V to 5V
 Communication: Digital signal
Code Examples
--------------
### Example 1: Reading Temperature and Humidity using Arduino
This example demonstrates how to read temperature and humidity values using an Arduino board.
```c++
#include <DHT.h>
#define DHTPIN 2     // Connect DHT22 OUT pin to digital pin 2
#define DHTTYPE DHT22   // DHT22 sensor type
DHT dht(DHTPIN, DHTTYPE);
void setup() {
  Serial.begin(9600);
  dht.begin();
}
void loop() {
  int h = dht.readHumidity();
  int t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
    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(" %	");
  }
  delay(2000);
}
```
### Example 2: Reading Temperature and Humidity using Python and Raspberry Pi
This example demonstrates how to read temperature and humidity values using a Raspberry Pi and Python.
```python
import Adafruit_DHT
import time
sensor = Adafruit_DHT.DHT22
pin = 17  # Connect DHT22 OUT pin to GPIO 17
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!')
    time.sleep(2)
```
Note: Make sure to install the `Adafruit_DHT` library using `pip install Adafruit_DHT` before running the Python code.
Troubleshooting Tips
--------------------
Ensure the DHT22 sensor is properly connected to the microcontroller or Raspberry Pi.
 Verify the power supply voltage is within the recommended range (3.3V to 5V).
 Check for any electromagnetic interference (EMI) or radio-frequency interference (RFI) sources near the sensor.
By following these examples and guidelines, you can successfully integrate the DHT22 temperature sensor into your IoT projects and applications.