Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By GengusKahn
#35917 Hi there, I have had "issues" with erratic DHT readings, the worst of all being NAN as this "Corrupts" data tables with "String" instead of "Float", the problem for the DHT11 was solved by using the RDHT library.

https://github.com/rDuinoStar/rDHT11--DHT11-Arduino-Lib

This is used on "home made boards", but it is very stable and I have been logging with these since about February this year.



The Code on the github....(old version with DHT library)....

https://github.com/EnvironmentMonitor/ESP8266-DHT11-WiFi_Sensor

The devices are online here are a couple....

Remember these have limited bandwidth.........

ESP8266-12, 2 * DHT22 with 5 * DS18B20's, the page you will land on is a Graph of the data log stored in SPI Flash on the ESP (3MB), served via Google Charts and Gauges with the internals on a Diag page......100KB plus.......emptied to Email every 24Hours....

http://82.5.78.180:87/graphic

This is another with ESP8266-07, 2 * DHT11's and a BMP180.......(1MB)

http://82.5.78.180:93/graphic
User avatar
By picstart
#36175 Well,
This is an improvement over the library DHT11 but the rDHT11 code has notational issues....the implicit result of integer division of (9/5) is integer in the original code
The correct code should be
float rDHT11::getFahrenheit()
{
if(neverReaded)
return rDHT11Definitions::NOT_READY_ERROR;
return (float)temperature * 1.8 + 32.0;
}
User avatar
By canedje
#36213 Hello everybody.

I think I have do have the same trouble reading DHT22.

I did write code to read DHt22, BMP180 and ds18B20 sensors with a NodeMCU ESP12.
The basic is running fine.
I facing a problem that reading the DHT is not stable.
I read the sensors every 2 seconds.
At this moment the reading of the DHT22 is causing trouble by not reading every time.
Lets say that in avarage (But it is random) that about every 10 readings there is a misreading.

The strange thing is that before the code also did run for 100% without misreading, but after adding some code to the sketch (nothing to do with the DHT part of the code) this misreading suddenly appears
It looks like that changing the code the time need to run the code causes misreadings.
I did try to change the code by adding extra delays etc.
Nothing is helping
I know you can change the 3th factor in the command: DHT dht(DHTPIN, DHTTYPE,5); does influence the reading. I changed this factor several times with indeed some changes in misreading but never get rid of it.
In this thread I do read that the 3th factor is disabled (I didn't know) I still do see some differences results after adding different valeuse in the 3th factor in my code. That gives me the feeling it is not disabled

for this part above I did use the next library:
https://github.com/adafruit/DHT-sensor-library


In the mean time I did found the next different library: https://github.com/markruys/arduino-DHT%20an%20other%20library%20for%20DHT22:
Running the example sketch is doing fine.
Adding the code (By exact copiing) it into my main sketchcode suddenly the humidity is showing a big, strange number.


Is somebody having experience with the last library?
Is there a stable running library available?