The DHT20, manufactured by AZ-Delivery, is a digital temperature and humidity sensor that provides accurate and reliable measurements. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air and outputs a digital signal on the data pin. This sensor is widely used in various applications, including weather stations, HVAC systems, and environmental monitoring.
Parameter | Value |
---|---|
Operating Voltage | 3.3V to 5.5V |
Operating Current | 0.3mA (measuring) |
Temperature Range | -40°C to 80°C |
Humidity Range | 0% to 100% RH |
Temperature Accuracy | ±0.5°C |
Humidity Accuracy | ±3% RH |
Communication | I2C |
Dimensions | 15mm x 10mm x 5mm |
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V to 5.5V) |
2 | GND | Ground |
3 | SDA | Serial Data Line (I2C) |
4 | SCL | Serial Clock Line (I2C) |
#include <Wire.h>
#include "DHT20.h"
DHT20 dht20;
void setup() {
Serial.begin(9600);
Wire.begin();
dht20.begin();
}
void loop() {
float temperature = dht20.readTemperature();
float humidity = dht20.readHumidity();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
delay(2000); // Wait for 2 seconds before the next reading
}
No Data Output:
Inaccurate Readings:
Sensor Not Detected:
Q1: Can the DHT20 be used with a 3.3V microcontroller?
Q2: What is the maximum distance for the I2C communication?
Q3: How often should I take readings from the DHT20?
By following this documentation, users can effectively integrate the DHT20 sensor into their projects, ensuring accurate and reliable temperature and humidity measurements.