I'm a Raspberry Pi (and hardware) noob and am trying to hook up a DHT11 temperature and humidity sensor.

I've found two separate guides, and I'm seeking advice as to which I should follow.

This UU Gear guide connects the + and - terminals to 3.3v and GND respectively, then connects the data pin to GPIO #4:

enter image description here This Adafruit guide does the same, but (unless I'm misreading the diagram) also connects the data pin to the 3.3v via a resistor:

enter image description here

My question is, which of these methods is preferable?

  • what is the effect of connecting to the data pin to the 3.3v via a resistor?
  • is there any risk of damage via either method?
  • 1
    For what it is worth I always prefer Adafruit's tutorials when available, for a couple of reasons: 1) They keep them updated when new boards/software are released. 2) Most of them include a debugging section which covers what to do when something does not work as expected. 3) They include source code examples. 4) they offer PDF downloads which means you will always have a reference (no site disappearing). 5) They are always high quality. 6) They are popular and so are tested/debugged by many developers. 7) They have a forum for support questions - you may even want to ask this question there. Commented Mar 20, 2015 at 3:10

1 Answer 1


The DHT11 specs are available on the www.

You need a pull-up on the data line.

It's quite safe to use the DHT11 without a pull-up on the data line, it just will not work.

For the Pi it is safest to use a 3V3 pull-up. If you use anything higher you may damage the Pi.

The Adafruit software for the DHT11/DHT22 works occasionally. More reliable software is available.

  • Thanks for the info. I didn't know about pull-ups (the Adafruit article doesn't use that term) but I found a good article which explains what that circuit is doing. It would be great if you could point me to the 'more reliable software' too. Commented Mar 21, 2015 at 2:37
  • @StephenLead Sorry, only just seen the comment. I suggest you at least look at this example which uses my pigpio library.
    – joan
    Commented Sep 3, 2015 at 8:02

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.