0

DHT11 Assistance
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: DHT11 Assistance

by jerryn on Fri Oct 04, 2019 5:10 pm

I would try another input -- also since the 3 pin looks like it has a pullup, you shouldn't need one - but it probably won't make any difference.

jerryn
 
Posts: 1025
Joined: Sat Sep 14, 2013 9:05 am

Re: DHT11 Assistance

by StanJ on Sun Oct 06, 2019 5:58 pm

With the power off, verify continuity on your 3.3V power from the M4 to the DHT, ground from the M4 to DHT, and signal from the M4 to DHT with an ohmmeter. Those breadboards occasionally get a marginal connection, which could account for your error. If you don't have a DVM, you really need to get one. They're under $10 on eBay.

I don't think the MCU is 5V tolerant, so I'd be careful trying this next:

With the 4-pin bare DHT11 module (not the 3-pin breakout board), connect the VCC pin on the module to +5V (the USB pin on the M4) and connect a 4.7K to 10K pull-up resistor from the DHT 'signal' pin to 3.3V. As far as I can tell from the DHT datasheet it's signal pin is open-drain, so this will find out whether the module responds with higher VCC power. With no response to the low 'start' signal from the M4, it sounds like the DHT never started up.

The 3-pin breakout has it's own pull-up resistor to the DHT VCC pin, so that won't work for this experiment unless you desolder the pull-up resistor. You'd be hitting the M4 with 5V on it's GPIO unless you remove the pull-up resistor.

If the DHT is sensitive to the VCC level, then the 3.3V regulator on your M0 may be putting out just barely enough voltage to turn the DHT on, and the 3.3V from the M4 might be a hair on the low side. The DHT module is supposed to work from 3 to 5.5V, but all bets are off if it's a clone part. I have one exactly like that 3 pin breakout you showed a picture of, and mine works from 3.3V.

StanJ
 
Posts: 9
Joined: Sat Aug 24, 2019 7:33 am

Re: DHT11 Assistance

by cpeters1968 on Sun Oct 06, 2019 6:16 pm

Thanks for the reply. I am currently using the 3-pin version, and used the 5V supply (USB pin) to power it. I still got the same problem. I still moved the sensor around the board, hoping it was only a few bad parts of the board, but it still yields the same error. All of my other sensors work.

cpeters1968
 
Posts: 16
Joined: Fri Sep 06, 2019 9:16 am

Re: DHT11 Assistance

by StanJ on Sun Oct 06, 2019 7:03 pm

I think I found your problem. I have a 3-pin DHT11 breakout exactly like the one you showed. It wasn't waking up from an ESP8266, also run at 3.3V - I had exactly the same error you did. Then I powered the module from 5V since the ESP has 5V-tolerant GPIOs, and it worked. Then I dropped the DHT back down to 3.3V power, and it worked (OK, weird). Looks like not all DHT11 modules will run reliably with 3.3V power. I suspect your M0 board has just slightly more voltage on it's 3.3V pin, and the M4 has just slightly lower power output.

I'd seen notes elsewhere about powering the DHT11 from 3.5V to 5.5V, but assumed it was a mistake since the datasheet says 3 - 5.5V.

Warning: I'd assumed the DHT11 had open-drain output, but it doesn't look like it on a scope. The rise time on it's reply is too high, and has overshoot that a resistive pull-up can't do with an open-drain output. That means you can't safely power the DHT from 5V and use a pull-up to 3.3V, which is what I was originally thinking. Your M4 doesn't appear to be 5V-tolerant.

It's possible that the DHT11 on the modules you and I have are cheap clones that don't meet all of the specs.

StanJ
 
Posts: 9
Joined: Sat Aug 24, 2019 7:33 am

Re: DHT11 Assistance

by cpeters1968 on Sun Oct 06, 2019 7:13 pm

Thanks for the reply. The technician I work with are ordering some DHT11s from Adafruit. I'll try your idea out tomorrow and let you know.

I want to thank you and everyone else trying to help me on this. This is for a freshman design project where I teach. I pretty much have everything else working (photocell, moisture sensor, transistor switching, and pulsing current). I've worked with DHT11s before, as it was a mandatory sensor in an upper level course I teach, but this just boggled me.

The technician I work with probed the data line, and it seems the pin does go high, but it never goes back low, based on the data line timing diagram.

cpeters1968
 
Posts: 16
Joined: Fri Sep 06, 2019 9:16 am

Re: DHT11 Assistance

by cpeters1968 on Thu Oct 10, 2019 2:17 pm

Here's an update as to what I have done. I used the Feather M0, and here is what I got:

Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit Feather M0 Express with samd21g18
>>> import board
>>> import adafruit_dht
>>> a=adafruit_dht.DHT11(board.D5)
>>> a.temperature
24
>>> a.humidity
44

Then I basically swapped it out with a Feather M4, and still got the following error:

Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit Feather M4 Express with samd51j19
>>> import board
>>> import adafruit_dht
>>> a=adafruit_dht.DHT11(board.D5)
>>> a.temperature
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/dht/adafruit_dht.py", line 227, in temperature
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/dht/adafruit_dht.py", line 219, in measure
RuntimeError: DHT sensor not found, check wiring

The library I am using is the most recent one.

cpeters1968
 
Posts: 16
Joined: Fri Sep 06, 2019 9:16 am

Re: DHT11 Assistance

by cpeters1968 on Thu Oct 10, 2019 3:15 pm

I think I found somewhat of the cause of the issue. I borrowed a DHT22 from my friend, and was able to get good data. This confuses me why the DHT11 method doesn't work.

cpeters1968
 
Posts: 16
Joined: Fri Sep 06, 2019 9:16 am

Please be positive and constructive with your questions and comments.