Can't get a locally connected DHT11 to show up

Hi there,
I’ve been struggling to get this to work, but maybe I’m missing something I can’t realize.
I have a DHT11 on my RasPi3 running HassOS1.9/Hassio 0.75.3 - it’s in a closet with other electronics, so I wanted a clue of the temperatures inside. It’s hooked on the GPIO24:

  - platform: dht
    sensor: DHT11
    pin: 24
    monitored_conditions:
    - temperature

and I’ve added this on config.txt :
dtoverlay=dht11,gpiopin=24

It should work flawlessly, but… no way.
Any ideas?

The only difference between your code and mine is a single quote around your pin number.

mine is…
pin: ‘04’

…and maybe check your indention of “- temperature”

I’m not sure that’s it. Here’s my working config:

- platform: dht
  name: dht_comms
  sensor: DHT22
  pin: 24
  monitored_conditions:
    - temperature
    - humidity

However I am using the original Hassio not HassOS.

Hi!
Sorry, I miss-pasted, in the real code I have the classic two spaces:

# Local DHT11
  - platform: dht
    sensor: DHT11
    pin: 24
    monitored_conditions:
      - temperature
      - humidity

The single quote didn’t help! :frowning:

Maybe it’s HassOS not passing the GPIO? :open_mouth:

Could be.

One other thing to check: How long are your connections to the DHT11?

At 3.3V (raspi) it is only supposed to work reliably up to 1m. At 5V it is supposed to work up to 30m. However…

I have a 25m run of cat5 cable to one of my sensors. It did not work at all at 3.3V. It required a Sparkfun BOB-12009 bi-directional level converter so I could power the DHT22 with 5V but it was still very hit and miss. I then put 3.3K Ohm pullup resistors on the data to 5V line at both ends and it has been working flawlessly.

Thanks for the hint, Tom!
My DHT is just a pair of inches (5 centimeters, more or less) away. I’ll docouble check cabling.

{ Btw: why hardwire suche a remote sensor? }

5cm should work easily at 3.3V.

I used to have a wireless alarm system in a large two story house. It was an absolute pain to get all the sensors to connect. So when I started with HA I decided I wanted as many of my sensors as possible to be hard wired for reliability. There’s now Kgs of copper cabling in my roof and walls :slight_smile:

I’ve wired it to 5v to avoid any doubts.

I understand, I’m having same difficulties even on a small house - lot’s of walls, doors, etc etc

That’s not a good idea without a level shifter. The data input to the Pi GPIO has to be 3.3v max.

I just set one up to give it a try, and copying @tom_l code, it worked perfectly connected to pin7, GPIO4, so my setup is,

- platform: dht
  name: Garage Comms Cabinet
  sensor: DHT22
  pin: 4
  monitored_conditions:
    - temperature
    - humidity 

Worth maybe checking which pin you are using, or try another one, 4 seem’s to work ok.

Thanks @Cee and @tom_l , I’ll try tonite!

1 Like

That was the solution! using GPIO4 (pin 7).
Looks like some GPIOs are working, others aren’t. @pvizeli, sorry to ask you here: may be something related to HassOS? 'cause I’m still working on an addon for the MySensors gateway, and I need to get it communicating with a radio chip…

Thanks a lot!

Marco

So this is the diagram I looked at to see where I should connect it up,

According to your code from the first post, you used GIO24, pin 18, and that say’s it is a pull-down pin, where as GIO4, pin 7 is a pull-up pin. I have no idea about what either mean, something to do with a voltage, and a resistor, from my quick reading, but that seem’s to be the only difference I can spot from here, so don’t know if that is what was it.

Thanks @Cee. I’m using a DHT11 on a breakout board, the pullup resistor should be onboard - it works correctly hooked up a Sonoff or Arduino.
I’ll investigate further, but thanks for the clear map!

1 Like