Wiring up DHT humidity sensors

Raspberry Pi

Its easy to connect these sensors to your Raspberry Pi. Our code can use any GPIO pin, but we'll be using GPIO #4 for our diagrams and code. Once you have it working, you can simply adapt the code to change to any other GPIO pin (e.g. pin #18). You can also have as many DHT sensors as you want but they cannot share the data pin - each sensor needs a unique data pin!

For DHT11 and DHT22 sensors, don't forget to connect a 4.7K - 10K resistor from the data pin to VCC

& if 4.7K doesnt work, try 10K
If your sensor has a white wire, leave it disconnected

Beaglebone Black

Connecting a DHT sensor to the Beaglebone Black is just as simple as connecting to a Raspberry Pi. In this example pin P8_11 will be used, but you can use any free digital GPIO pin. If you aren't familiar with how pins are numbered on the Beaglebone Black, check out the tutorial on Beaglebone Black GPIO.

Don't forget to connect the 4.7k-10k resistor from the data pin to VCC, like with the Raspberry Pi wiring above.

Last updated on 2015-11-18 at 11.31.58 AM Published on 2012-08-24 at 03.19.06 PM