The sketch for this project on my GitHub page here.
This is the third in a series of Humidity/Temperature sensors for the Arduino and using an OLED Display. The DHT22 is more accurate than the DHT11, has a wider humidity range and can measure negative temperatures.
There is an in depth discussion of humidity sensors sensors here and the relative accuracy of different sensors as well as methods used to test them is shown. There are a number of libraries available for using this sensor with an Arduino, but I found the one used in the Arduino Playground and available on GitHub here to work well and is the one I have used.
The OLED Display shows temperature in both Centigrade and Fahenheit as well as Humidity in percent and Dew Point in centigrade. I have used the U8Glib library for the OLED Display and the code uses much of the code used for the Si7021 project.
Connect the OLED AS follows, taking care to connect the power supply to the display correctly, Vcc to 5 volts and Gnd to Gnd, as reversing the power will destroy the display. Connect SDA to Arduino pin A4 and SCL to Arduino pin A5. Connect Vcc on the DHT22 to Arduino 5volts, the Gnd to Arduino Gnd. Connect the Data Out on the DHT22 to Arduino pin 2.
Upload the sketch and the display should be as shown in the picture at the top of this page. The reading is updated every 2 seconds as this is the fastest recommended for this sensor.
Comparison with the Si7021
The first obvious difference is size, the Si7021 is a fraction of the size of the DHT22. The DHT22 can only be read once in 2 seconds, but the Si7021 seems to have no such restrictions. Although the Si7021 is about three times more expensive than the DHT22 on eBay, it is about the same cost as the DHT22. Without a doubt the Si7021 wins hands down and the extra accuracy provided makes it the sensor of choice, even though it is more expensive.