- Fri Dec 11, 2015 6:58 am
#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-libraryIn 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?