26

I've just bought a DHT22 sensor to connect to my RPi but most tutorials mention there should be a resistor connected between the sensor and the GPIO pin. Is this necessary? Will it work without or will I end up melting something?

Abbie
  • 373
  • 1
  • 3
  • 5

3 Answers3

19

The short answer is yes. The pull up resistor ensures a valid logic level when the pins are switching from input to output, you won't melt anything but it may not function correctly. so you should add a 4.7K - 10KΩ resistor between the Data pin and the VCC pin.

This tutorial froim Adafruit has a schematic and some info on logging your data.

Steve Robillard
  • 34,988
  • 18
  • 106
  • 110
8

It seems necessary for reliable readings. I started my project without pull up resistor and the humidity measurement started dropping down. It may start correctly but deterioate later. Since I was using pigpio module, I enabled internal pull up resistor as below:

  pi.set_pull_up_down(gpio, pigpio.PUD_ON)

The gpio refers to your data pin.

Benny
  • 181
  • 1
  • 1
5

I use a 10K pull-up from pin 2 (DATA) to pin 1 (VCC), and always use 3V3 to pin 1.

On 5V the sensor heats up a few degrees celsius. Also, pay attention to nearby heatsources (laptop, your breath, power supplies) when testing/calibrating the sensor.

user400344
  • 264
  • 2
  • 4