DHT11: eternal timeout
dvv opened this issue · 4 comments
Hello!
Am using example for this library.
Am getting age == 92
here https://github.com/markruys/arduino-DHT/blob/master/DHT.cpp#L149
Changing condition to be age > 92
doesn't solve eternal TIMEOUTs.
What can be wrong?
TIA,
--Vladimir
As a test, you could double the value to something like 200.
Also, in case of problems, I would specify the DHT model (DHT-22 or DHT-11) in the setup() invocation (so no AUTO-DETECT).
If you don't get any readings, just TIMEOUTS, you should check your wiring. Perhaps your DHT module is attached to a different pin?
Right, did all that before filing the issue. I changed threshold to 92 and started to get 100 and so on.
Wiring is good as it works with another dht, the latter seems just not accurate enough and also times out from time to time..
Am using this board, it may have inaccurate timngs, i believe.
What else you'd kindly suggest to check? How do you calculate the timeout?
Hi, I have the same problem and some more data for you:
I have a Arduino Pro Mini 5V 16MHz 328p. When I use a FT232 Serial/USB Adapter, I get correct values from my DHT22 (via Serial Monitor and VirtualWire lib with 433MHz transmitter).
When I detach the Adapter and use a 5V power supply, I get timeouts. age=300 didn't help.
Bye, Ronny
EDIT:
I tried it without the VirtualWire lib, same problem.
For this test I used the DHT_Test sketch and a switch/case on dht.getStatus() that generated different blink codes.
With FT232+USB-cable I got an "ok", with a battery + voltage regulator (5v out) -> vcc I got the timeout bllink code.
EDIT2:
I found the problem in my case:
when attached to USB, the bootloader takes around 2 seconds to connect to my PC. The DHT22 is ready by this time, but when I power up the Arduino without an USB connection, the DHT22 is asked immediately. As I give power to the board only for the time to read the sensor and send the data, I asked the DHT22 on power up and not after "getMinimumSamplingPeriod()". -> works with the delay between "setup" and "get".
i have the same problerm ......but it now good....you must first setting tools/cpu 5V 16M .