DHT11 Assistance

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
jerryn
 
Posts: 1868
Joined: Sat Sep 14, 2013 9:05 am

Re: DHT11 Assistance

Post by jerryn »

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.

User avatar
StanJ
 
Posts: 12
Joined: Sat Aug 24, 2019 7:33 am

Re: DHT11 Assistance

Post by StanJ »

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.

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

Re: DHT11 Assistance

Post by cpeters1968 »

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.

User avatar
StanJ
 
Posts: 12
Joined: Sat Aug 24, 2019 7:33 am

Re: DHT11 Assistance

Post by StanJ »

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.

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

Re: DHT11 Assistance

Post by cpeters1968 »

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.

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

Re: DHT11 Assistance

Post by cpeters1968 »

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.

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

Re: DHT11 Assistance

Post by cpeters1968 »

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.

User avatar
Bob_Murphy
 
Posts: 6
Joined: Mon Jul 26, 2021 1:42 pm

Re: DHT11 Assistance

Post by Bob_Murphy »

Dear AdFRUIT:
I am having trouble with the forum (no response to my posting in a week) and perhaps getting to the correct department. I bought a Pi4 Model B on July 3, 2021 with case, fan, and 16GB card with NOBs 3.1. When I tried to power up, nothing happens; no power light. The SD card and I the operating system I bought in the original order. The power supply I am using is an Apple USB-C power supply Model A1947 rated at 5.3V/ 3 amps.

Is there something wrong with this Pi4? or have I to do something else (like a hidden on switch).

Bob Murphy

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”