I've built a weather station using Arduino that measures temperature/humidity and pressure using an Adafruit 8266 HUZZAH. Temperature and Humidity are measured using a DHT22 sensor a ordered from AdaFruit. The project was completed about 4 months ago and for the first three months has returned what appears to be good data. Eventually, the humidity values started returning garbage, values around 1%.

I replaced the DHT22 sensor with another, this time from a random eBay seller. This also worked fine for about a week (humidity values appear to look good in the 20-60% range).

Then all of a sudden, they dropped to 1% again.

If I run the DHTtester program (instead of my program) against the sensor and my Uno development board, the result is also 1% humidity for this sensor.

 DHTxx test!
 Humidity: 1.00 %   Temperature: 19.20 *C 66.56 *F  Heat index: 17.96 *C 64.33 *F
 Humidity: 1.00 %   Temperature: 19.20 *C 66.56 *F  Heat index: 17.96 *C 64.33 *F

So at this point, I know the problem is not with my program (happens with both my program and the DHTtest program), not with my Arduino (happens with both the 8266 in "the field" and my Uno on my couch). So something must be happening to the sensors in the field, where they work for a week to a few months, and then fail?

Any ideas?

I'm beginning to think some bug/critter is eating or doing something to the sensor (maybe they are attracted to it because it's warmer), but anyway is there a good way to shield if this is the case without affecting the values? Any other way to see what is going on?

 // Example testing sketch for various DHT humidity/temperature sensors
 // Written by ladyada, public domain

 #include "DHT.h"
 #define DHTPIN 2     // what pin we're connected to

 // Uncomment whatever type you're using!
 //#define DHTTYPE DHT11   // DHT 11
 #define DHTTYPE DHT22   // DHT 22  (AM2302)
 //#define DHTTYPE DHT21   // DHT 21 (AM2301)

 // Connect pin 1 (on the left) of the sensor to +5V
 // NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
 // to 3.3V instead of 5V!
 // Connect pin 2 of the sensor to whatever your DHTPIN is
 // Connect pin 4 (on the right) of the sensor to GROUND
 // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

 // Initialize DHT sensor.

 void setup() {
   Serial.println("DHTxx test!");

 void loop() {
     // Wait a few seconds between measurements.
     // Reading temperature or humidity takes about 250 milliseconds!
     // Sensor readings may also be up to 2 seconds 'old' 
     float h = dht.readHumidity();
     // Read temperature as Celsius (the default)
     float t = dht.readTemperature();
     // Read temperature as Fahrenheit (isFahrenheit = true)
     float f = dht.readTemperature(true);

     // Check if any reads failed and exit early (to try again).
     if (isnan(h) || isnan(t) || isnan(f)) {
         Serial.println("Failed to read from DHT sensor!");

     // Compute heat index in Fahrenheit (the default)
     float hif = dht.computeHeatIndex(f, h);
     // Compute heat index in Celsius (isFahreheit = false)
     float hic = dht.computeHeatIndex(t, h, false);

     Serial.print("Humidity: ");
     Serial.print(" %\t");
     Serial.print("Temperature: ");
     Serial.print(" *C ");
     Serial.print(" *F\t");
     Serial.print("Heat index: ");
     Serial.print(" *C ");
     Serial.println(" *F");
  • 1
    Try the sensor resetting procedure.
    – Gerben
    Oct 27, 2015 at 17:16
  • 2
    my current workaround is to connect the DHT with a screw terminal instead of soldering them in, and then just swap them out when they start to fail
    – Stanley
    Mar 2, 2016 at 18:29

3 Answers 3


This is how it looks when they fail.

The DHTxx are very low cost sensors, optimised for cheap volume production.

We don't know under what condition you actually use your sensors. Also, there's the phenomenon of knock-offs and low-grade selling.

In his comprehensive test, Robert J. Smith found a failure rate of 33% and concludes a mean life expectancy of one to two years.

A slightly more expensive alternative is the SHT series of temperature and humidity sensors. My personal experience is that they tend to tolerate some abuse (i.e. complete submersion in water) and don't age as quickly.



I have had the exact same experience using a DHT11 with Huzzah. I found that the problem tends to happen after high humidity conditions (>85% relative), my solution was to place silicone caulk and heatshrink tubing around the connections to prevent dew buildup. That solved my problem with my third replacement. It has been two months now with no issues.


Can't really help as I have the same problem ! , DHT22 on an ESP8266 has failed twice , while a DHT11 on a similar system has worked faultlessly for months (Thingspeak 27272) , DHT11 is inside the house while the DHT22 is below the house in the carport, Only thing I have come up with is that the DHT22 MAY be failing due to exhaust/hydrocarbon fumes from the car startups


  • This should probably be a comment.
    – jrista
    Dec 30, 2015 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.