1

Trying to get a DHT22 sensor to work on a Raspberry Pi ZERO WH running BUSTER. The demo Python program works on pin 21 (4 is in use by my DS18B20 sensors.) I tried the dtoverlay method, but I don't even get a new w1_bus_master2 directory.

If anyone has gotten the dtoverlay method to work, please tell me how. (I've tried JAVA, but none of those examples work either. JAVA would be my preferred way to access it.)

  • I guess the DHT22 driver is no good for your RpiZW buster. I did find drivers that work for Rpi3/4 but does not work for RpiZ/W. Of course there are also outdated drivers which only work for a particular config, eg, Rpi3B+ jessie and nothing else. – tlfong01 Aug 24 '20 at 03:33

1 Answers1

2

It probably has something to do with the face that DHT22 DOES NOT use the 1-Wire protocol, but a proprietary non-standard protocol - which is similar, but not the same and very critical on timing.

(It should be possible to write a suitable overlay, but AFAIK despite the popularity of DHT11/22 no one has bothered). I note there does seem to be a dht11 overlay, but I have not used it, and never seen any reference to it being used.

Incidentally the Adafruit code, while it does work is unreliable - not to mention overly complex. I use https://raspberrypi.stackexchange.com/a/105549/8697

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • If you looked at the code linked to by 'dtoverlay method', the author says: You may have noted that there is also a DHT22 sensor in the picture. Much like the 1-Wire overlay, the kernel driver for the DHT22 can be associated with an arbitrary GPIO pin like this:

    dtoverlay=dht11,gpiopin=27"

    – Chris Wolcott Aug 28 '20 at 20:42