-
Notifications
You must be signed in to change notification settings - Fork 13.3k
DHT11 readings are wildly inaccurate #118
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
Comments
Do you have a pull up resistor on GPIO2? What code do you use to initialize DHT library? |
Just to jump in... If I ever get the upload problems sorted, I'm intending to deploy some What's best for the DHT sensors? Thanks On 26 April 2015 at 09:51, Ivan Grokhotkov [email protected] wrote:
|
Ah, it seems this is another 'Mac Only' option - though I fail to see why, Thanks for solving that part of the mystery that is ESP8266/Arduino! I've yet to understand that third parameter in the DHT implementation (I On 26 April 2015 at 11:39, Ivan Grokhotkov [email protected] wrote:
|
This isn't a Mac-only option. It was added about three weeks ago in 3bde54d, so if you are using the release from the "releases" page, you won't yet see it. Regarding the third option for the DHT library... Well, DHT line of sensors use a one-wire protocol which encodes "0" and "1" using different pulse lengths. The library we are talking about, https://github.com/adafruit/DHT-sensor-library, doesn't have any fancy auto-calibration built in. You have to tell it upfront how many cycles to wait until the pulse can be considered a "1". Here's a snippet from the sample sketch included with the DHT library:
The value of 15 seems to work for the ESP at 80 MHz. |
OK, thanks for your help - I'll try and make sense of all this and ensure I really am out of my comfort zone with this now. I plugged them in, I can't even reinstall the original AT command firmware and hang them of On 26 April 2015 at 12:09, Toshik [email protected] wrote:
|
@duncan-a ,
That should do the job for 160MHz;-) |
@nsgn Any update? Did you get a chance to try this again following the suggestions? |
You may have a bad DHT22 sensor. Let me tell you my story. I purchased two DHT22 sensors. One was connect to my Raspberry Pi-2 and the other to an Arduino Uno. The one on the Raspberry Pi reads fine but the one on the Ardunio reads 19% Humidity while the one on the Raspberry Pi and another Hydrometer read 48% and 51% respectively. I switched the DHT22 sensors (put the Raspberry Pi sensor on the Arduino and visa versa). Now the one on the Ardunio reads correctly and the on on the Raspberry Pi reads 19%. Proving I have a bad sensor. This may be your problem. If you have a second DHT22 you might want to see if switching them fixes the problem. I have read a lot about these sensors and I think they may have a high failure rate at manufacture. I just purchase four more and will test them all when they arrive for accuracy if off they are going back. |
I've got a DHT11 sensor that reads correctly on an arduino nano but when used with the esp8266 arduino code it gives wildly inaccurate, rapidly changing values. Such as 260000 instead of 78*F. Upon each receive of data from the DHT11 the values change drastically, by thousands. ESP model is ESP-01.
I've attempted on two different GPIO pins. When using GPIO 2 the reading is inaccurate for both temp and humidity. When using GPIO 3 (stealing from serial) the humidity is correct but the temperature is no different - still nothing close to a temperature.
Forgive any lack of necessary detail here. It's my first issue report on GitHub. I will gladly recreate and further test the issue or provide any additional detail that might help with resolution. Just let me know what will be most helpful. I'm also entirely open to the option that I might be doing something stupid and take no offense to being shown where I'm in error.
Thanks for the great project. Besides this odd issue with DHT sensors it works flawlessly. Uploads go perfectly every time from this Windows pc and other sketches I've loaded up just as I would expect in every way. Fantastic work.
The text was updated successfully, but these errors were encountered: