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?
3 Answers
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.

- 34,687
- 17
- 103
- 109
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.

- 181
- 1
- 1
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.

- 264
- 2
- 4
GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP)
where 12 in the pin number – Gerben Dec 10 '13 at 16:22