DHT22 Returning Nan
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- jennaholland
- Posts: 10
- Joined: Mon Mar 19, 2018 11:19 am
DHT22 Returning Nan
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?
- adafruit_support_carter
- Posts: 29483
- Joined: Tue Nov 29, 2016 2:45 pm
Re: DHT22 Returning Nan
It's possible something happened to it. What kind of operating conditions was it in for the month you were using it?
- brubell
- Learn User Page
- Posts: 2017
- Joined: Fri Jul 17, 2015 10:33 pm
Re: DHT22 Returning Nan
Do you have a pull-up resistor on the data line?
Try the arduino DHTstable library - https://github.com/RobTillaart/Arduino/ ... /DHTstable
Try the arduino DHTstable library - https://github.com/RobTillaart/Arduino/ ... /DHTstable
- jennaholland
- Posts: 10
- Joined: Mon Mar 19, 2018 11:19 am
Re: DHT22 Returning Nan
It was inside of a greenhouseadafruit_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?
- jennaholland
- Posts: 10
- Joined: Mon Mar 19, 2018 11:19 am
Re: DHT22 Returning Nan
yes, the sensor came with a resistor. And the DHTstable library is not compiling.brubell wrote:Do you have a pull-up resistor on the data line?
Try the arduino DHTstable library - https://github.com/RobTillaart/Arduino/ ... /DHTstable
- adafruit_support_carter
- Posts: 29483
- Joined: Tue Nov 29, 2016 2:45 pm
Re: DHT22 Returning Nan
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?
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?
Please be positive and constructive with your questions and comments.