Posts: 1
Joined: Fri Jan 17, 2014 5:08 pm

DHT22 Sensor

Tue Feb 18, 2014 8:12 am

Hey Everyone,

So I'm doing the humidty sensor tutorial for the DHT22 ... g/overview

and I ran into a few speed bumps.

First off:
When I got to the section: Testing the C Code, I ran sudo ./Adafruit_DHT 2302 4 I got no data. (Data(0): 0x0 0x0 0x0 0x0)

I double checked my wiring and I couldn't figure out what was wrong.

I then skipped that section and went to:Adapting the DHT C code
when i type in gcc Adafruit_DHT.c -l bcm2835 -std=gnu99 -o Adafruit_DHT

I get this error: gcc: error: adafruit_DHT.c: No such file or directory.

Any help? I'm super new to rasberry pi and electronics.

Posts: 18
Joined: Fri Apr 05, 2013 9:13 pm

Re: DHT22 Sensor

Tue Feb 18, 2014 9:29 pm

Have a look at our tutorial on DHT22. We're using Adafruit's code without any problem. I'd check two things:

1. make sure that all the pins of the DHT22 are correctly wired and you are using 10k resistor between pins 1 and 2 of the DHT22 (as per the diagram in the tutorial, also attached).
2. make sure that you didn't mix up the GPIO number with the header pin number (you are using GPIO 4 which is pin 7 on the Raspberry Pi header).

Image ... d-humidity
dht22 temperature and humidty sensor circuitry wiring.jpg
dht22 temperature and humidty sensor circuitry wiring.jpg (18.82 KiB) Viewed 1387 times

Return to “Beginners”