-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem: wrong values at negative temperatures an ESP8266 and DHT22 #177
Comments
I tried to repeat the bug with an ESP32 but all negative celsius temperatures that I got (though I did not get -0.1 in particular) seemed correct to me. Does this only concern -0.1C in partocular?
|
If i remember correctly all negative values were wrong. Less temperature results in respective higher value then -3278.6. |
I have been seeing this issue and have yet to narrow down on the cause. I'm using version 1.4.4 of this library and building with PlatformIO:
I've observed it twice now. On both occasions the temperature decreased, crossing 0 degrees, over the course of roughly an hour. I'll be investigating the issue and will provide an update should I find anything notable. |
I know this thread is quite a bit old but I couldn't find any real solution to the problem. |
I use the DHT22 in combination with an ESP8266 and this lib.
When having negative temperatures, the resulting value of readTemperature() is -3278.6 at -0.1°C
To fix negatives values a recalculation is nessecary:
after some research, i figure out, that the values in data-array repressents an intager in ones complement, while the rest of data handling seems to be in BCD.
I will provide an PR to fix this issue.
The text was updated successfully, but these errors were encountered: