DHT22 temperature and humidity sensor
The DHT22 temperature and humidity sensor is a low-cost high precision humidity and temperature sensor with a single wire digital interface, meaning many of these sensors can be strung (daisy chained) together from one digital pin.
The sensor is pre-calibrated and doesn't require extra components so you can get right to measuring relative humidity and temperature.
DHT22 temperature and humidity sensor Features:
3.3 - 6 V Input
1-1.5 mA measuring current
40-50 uA standby current
Humidity from 0 - 100 % RH
-40 - 80 degrees C temperature range
+- 2 % RH accuracy
+- 0.5 degrees C
20 m max wire length
Sketch example
/* DHT11/ DHT22 Sensor Temperature and Humidity Tutorial * Program made by Dejan Nedelkovski, * www.HowToMechatronics.com */ /* * You can find the DHT Library from Arduino official website * http://playground.arduino.cc/Main/DHTLib */ #include <dht.h> #define dataPin 8 // Defines pin number to which the sensor is connected dht DHT; // Creats a DHT object void setup() { Serial.begin(9600); } void loop() { int readData = DHT.read22(dataPin); // Reads the data from the sensor float t = DHT.temperature; // Gets the values of the temperature float h = DHT.humidity; // Gets the values of the humidity // Printing the results on the serial monitor Serial.print("Temperature = "); Serial.print(t); Serial.print(" *C "); Serial.print(" Humidity = "); Serial.print(h); Serial.println(" % "); delay(2000); // Delays 2 secods, as the DHT22 sampling rate is 0.5Hz }