Tuesday, October 20, 2020
Home Arduino Humidity Sensor DHT22 | HUMIDITY & TEMPERATURE SENSOR

DHT22 | HUMIDITY & TEMPERATURE SENSOR

DHT22 is one of the popular humidity sensors to work with. The low-cost sensor is much more accurate compared to DHT11. It is a capacitive type humidity sensor.

USA purchase link
UK purchase link
Germany purchase link

Specifications:

  • Low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 0-100% humidity readings with 2-5% accuracy
  • Good for -40 to 80°C temperature readings ±0.5°C accuracy
  • No more than 0.5 Hz sampling rate (once every 2 seconds)
  • Body size 15.1mm x 25mm x 7.7mm
  • 4 pins with 0.1″ spacing

How does DHT22 work :

DHT 22 uses a capacitive humidity measuring element along with an inbuilt  NTC thermistor. Therefore, the humidity element gives the measure of the amount of water present in the moisture. Meanwhile, The NTC  gives the ambient temperature needed to calibrate the reading certainly to make the most accurate correction possible for the sensor.

DHT22
Capacitive Type Sensor

 DHT22 Pin Configuration :

DHT-22 Pin Configuration

The DHT 22 sensor has 4 pins. For instance,

  • VCC
  • GND
  • Output
  • NC

DHT22 Arduino Wiring:

First, Connect the Sensor GND to Arduino GND.

Second,  Connect Sensor Signal to Arduino PIN 7.

Third, Connect  Sensor Vcc+ to Arduino +5

DHT22 Arduino Code :

#include <DHT.h>;

#define DHTPIN 7     // data pin
#define DHTTYPE DHT22   
DHT dht(DHTPIN, DHTTYPE); 

int chk;
float hum;  // humidity value
float temp; // temperature value

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

void loop()
{
    delay(2000);
    //Read data and store it to variables hum and temp
    hum = dht.readHumidity();
    temp= dht.readTemperature();
    //Print temp and humidity values to serial monitor
    Serial.print("Humidity: ");
    Serial.print(hum);
    Serial.print(" %, Tempreture: ");
    Serial.print(temp);
    Serial.println(" Celsius");
    delay(10000); //  Delay 2 sec.
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

KY-032 | OBSTACLE AVOIDANCE SENSOR

The KY-032 obstacle avoidance sensor is an infrared obstacle avoidance sensor. It comes with the 37 in 1 starter kit for Arduino. It helps...

HIH-4000 | Humidity Sensors

The HIH-4000  sensors are one of the highly efficient humidity sensors you can buy. The HIH-4000 is an analog humidity sensor. It is useful...

KY-026 | ARDUINO FLAME IR SENSOR

The KY-026 Arduino Flame Sensor is a low-cost starter sensor. It normally comes in the starter kit of Arduino like the ky-039. It can...

KY-039 | ARDUINO HEARTBEAT SENSOR

The KY-039 Heartbeat sensor is one of the cheapest sensors to get a start on Arduino like the Sound sensor. It cost less than...

Recent Comments