3

I purchased this temperature and humidity sensor online and I want to use it with my Raspberry Pi 2.

Specs: https://akizukidenshi.com/download/ds/aosong/DHT11.pdf

enter image description here

The tutorials that I find online suggest a wiring scheme that uses a breadboard and a resistor. I do not own a breadboard or a resistor and I do not really intend to buy those for such a small-scale personal experiment.

Is it possible to connect the sensor directly to the GPIO pins? If yes, what are the risks? I do not expect reliability, my goals are to get a few temperature readings while NOT damaging the Pi.

1
  • Brother, please rotate this image so we can read it easily. page 4, shows you how to do it with the typical wiring schematic. just use some female wire headers, and solder in a pull up resistor. risk seems low, the current is really low. you could put in an anti noise filter cap if you were really worried.
    – j0h
    Commented Sep 27, 2016 at 12:28

2 Answers 2

1

It may work with the internal pull-ups enabled. You'll have to try and see.

Use 3V3 operation so connect DHT11 pin 1 to Pi 3V3 (say pin 1) and DHT11 pin 4 to a Pi ground (say pin 6).

Connect DHT11 pin 2 to any Pi GPIO.

http://abyz.me.uk/rpi/pigpio/examples.html#pdif2_DHTXXD will read the sensor but you'll have to set the pull-up outside the program (or edit the code).

If you connect to GPIO4 (pin 7) you can set the pull-up with the following command.

sudo pigpiod # Start daemon

pigs pud 4 u # set internal pull up

2

There is no risk if you connect all the pins right. You probably will be fine without the resistor if you activate the internal pullup on the GPIO pin which you connect to pin 2 of the sensor:

GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_UP)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.