Temperature & Humidity

Viewed products

Humidity and Temperature DHT22 View larger

Humidity and Temperature DHT22

BE15000146

New product

The DHT22 goes by several names. The other common name is the RHT22. The data sheet says that it will run from 3.3V to 6V which makes it ideal for Arduino application. Temperature range is -40°C to 80°C with 0% to 100% relative humidity.

More details

This product is no longer in stock

10,32 € tax incl.

Add to wishlist

More info

The DHT22 is a basic, low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old.

 

Datasheet DHT22

 

Type:AM2302.
Accuracy resolution:0.1.
Humidity range:0-100%RH.
Temperature range:-40~80?.
Humidity measurement precision:±2%RH.
Temperature measurement precision:±0.5?.
4-pin package.
Ultra-low power.
No additional components.
Excellent long-term stability.
All calibration, digital output.
Completely interchangeable.
Long distance signal transmission.
Relative humidity and temperature measurement. 

 

Example of connection:

DHT22 connected to Arduino.

 

Download:

Arduino library for DHT11 / DHT22

 

Code:

// Third-party library
// https://github.com/RobTillaart/Arduino

#include <dht.h>
#define DHT_PIN 5 // Literals
dht DHT; // DHT instance

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

void loop()
{
int check;

Serial.print( "DHT22," );
Serial.print( DHT_LIB_VERSION );
Serial.print( "," );

// Read the DHT data
// Return from call is checksum
// Checks for correct communication
check = DHT.read22( DHT_PIN );

// Check for errors
switch( check )
{
case DHTLIB_OK:
Serial.print( "OK," );
break;
case DHTLIB_ERROR_CHECKSUM:
Serial.print( "CHECKSUM," );
break;
case DHTLIB_ERROR_TIMEOUT:
Serial.print( "TIME_OUT" );
break;
default:
Serial.print( "UNKNOWN" );
break;
}

// Display humidity, celcius, farenheit
Serial.print( DHT.humidity, 1 );
Serial.print( "," );
Serial.print( DHT.temperature, 1 );
Serial.print( "," );
Serial.println( ( DHT.temperature * 1.8 ) + 32, 1 );

// Wait for next reading
delay( 1000 );
}

 

 

Tip for a project using the sensor DHT22:

 

Download:

Arduino library for DHT11 / DHT22

 

Code:

#include <DHT.h>
#include <LiquidCrystal.h>

// Pin connected to the sensor data pin
#define DHTPIN 7

// Display pins
LiquidCrystal LCD (12, 11, 5, 4, 3, 2);

// Use the line according to the sensor model
// #define DHTTYPE DHT11 // Sensor DHT11
#define DHTTYPE DHT22 DHT Sensor 22 (AM2302)
// #define DHTTYPE DHT21 // DHT Sensor 21 (AM2301)

// Definitions sensor: pin, type
DHT DHT (DHTPIN, DHTTYPE);

// Array symbol degree
byte level [8] = {B00001100,
B00010010,
B00010010,
B00001100,
B00000000,
B00000000,
B00000000,
B00000000,
};

void setup ()
{
// Initialize the display
lcd.begin (16, 2);
lcd.clear ();
// Create the custom character with the symbol of the degree
lcd.createChar (0, degree);
// Information on the initial display
lcd.setCursor (0, 0);
lcd.print ("Temp. : ");
lcd.setCursor (13.0);
// Shows the symbol of the degree
lcd.write (byte (0));
lcd.print ("C");
lcd.setCursor (0.1);
lcd.print ("Umid. : ");
lcd.setCursor (14.1);
lcd.print ("%");

Serial.begin (9600);
Serial.println ("Waiting for data ...");
// Starts DHT sensor
dht.begin ();
}

void loop ()
{
// Wait 2 seconds between the measurements
delay (2000);

// Moisture reading
dht.readHumidity float h = ();
// Reading of temperature (Celsius)
t = dht.readTemperature float ();

// Check if the sensor is responding
if (isnan (h) || isnan (t))
{
Serial.println ("Failed to read DHT sensor data !!!");
return;
}

// Display the temperature in the serial monitor and display
Serial.print ("Temperature: ");
Serial.print (t);
lcd.setCursor (8.0);
lcd.print (t);
Serial.print (" C * ");
// Show the moisture in the serial monitor and display
Serial.print ("humidity: ");
Serial.print (h);
Serial.println (" %");
lcd.setCursor (8.1);
lcd.print (h);
}

Accessories

Customers who bought this product also bought: