DHT22 Returning Nan

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jennaholland
 
Posts: 10
Joined: Mon Mar 19, 2018 11:19 am

DHT22 Returning Nan

Post by jennaholland »

I am running the example code for the DHT22 on an arduino and it has stopped working. It was working continuously for about a month and then stopped outputting data. I have tried to upload the code on three different arduinos (2 Yuns and an Uno) and none of them work. Is the sensor broken?

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: DHT22 Returning Nan

Post by adafruit_support_carter »

It's possible something happened to it. What kind of operating conditions was it in for the month you were using it?

User avatar
brubell
Learn User Page
 
Posts: 2017
Joined: Fri Jul 17, 2015 10:33 pm

Re: DHT22 Returning Nan

Post by brubell »

Do you have a pull-up resistor on the data line?

Try the arduino DHTstable library - https://github.com/RobTillaart/Arduino/ ... /DHTstable

User avatar
jennaholland
 
Posts: 10
Joined: Mon Mar 19, 2018 11:19 am

Re: DHT22 Returning Nan

Post by jennaholland »

adafruit_support_carter wrote:It's possible something happened to it. What kind of operating conditions was it in for the month you were using it?
It was inside of a greenhouse

User avatar
jennaholland
 
Posts: 10
Joined: Mon Mar 19, 2018 11:19 am

Re: DHT22 Returning Nan

Post by jennaholland »

brubell wrote:Do you have a pull-up resistor on the data line?

Try the arduino DHTstable library - https://github.com/RobTillaart/Arduino/ ... /DHTstable
yes, the sensor came with a resistor. And the DHTstable library is not compiling.

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: DHT22 Returning Nan

Post by adafruit_support_carter »

It does sound like the sensor is broken. Even though it says it's good up to 100% RH, maybe the greenhouse conditions were too wet for it. See Sec. 7, pg. 6-7 of the datasheet:
https://cdn-shop.adafruit.com/datasheets/DHT22.pdf
It mentions avoiding dew conditions - could that have happened in the greenhouse? Also, it suggest a possible recovery method for the sensor (item 3). Can you try that?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”