DHT22 / RHT03

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
Worcester
 
Posts: 1
Joined: Sun Sep 09, 2012 6:26 pm

DHT22 / RHT03

Post by Worcester »

Been trying to get the RPi to read the output from the DHT22 using the ciruit and code here:
http://learn.adafruit.com/dht-humidity- ... cs-logging

However I'm getting nothing back from the port, I've posted infor on the RPi forum, ( http://www.raspberrypi.org/phpBB3/viewt ... 37&t=15755 ) however still waiting for answers.

1) Yes I have a Pull up resistor in Place,
2) Yes I have an Oscilloscope,

Using the code in
$ sudo ./Adafruit_DHT, the responce I get back is:

Code: Select all

pi@raspberrypi ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver $ sudo ./Adafruit_DHT 22 4
Using pin #4
Data (0): 0x0 0x0 0x0 0x0 0x0
Here are the oscillsope traces:
https://picasaweb.google.com/1132605127 ... directlink

So clearly the pin goes low and then comes back up high, though the routine doesn't appear to pul back the data

I've tried different pins - no different, and I;ve tried other routines to do other things using the same pin and they work OK.

I've tried 5V and linked both pins 3 and 4 to gnd (see comments here: https://www.sparkfun.com/products/10167 )

Any ideas?

Thanks, Worcester

User avatar
LoveWizard
 
Posts: 7
Joined: Sun Sep 23, 2012 4:55 pm

Re: DHT22 / RHT03

Post by LoveWizard »

I'm having the same issue with the AM2302. Glad I'm not alone. I've found no solution to this problem yet.

User avatar
cynikal
 
Posts: 10
Joined: Sun Sep 09, 2012 9:38 pm

Re: DHT22 / RHT03

Post by cynikal »

Ditto,

I've been running this thing in a loop (sleep 3 seconds before polling), and in the last 5 minutes it's answered me maybe twice.. what gives??

User avatar
cynikal
 
Posts: 10
Joined: Sun Sep 09, 2012 9:38 pm

Re: DHT22 / RHT03

Post by cynikal »

Found the solution at the bottom:

http://www.raspberrypi.org/phpBB3/viewt ... 5&p=179399

basically it involves changing the timing 100 to 500000 and recompiling. It's still not working 100% (e.g. it still returns 0 data) but it's like non-responsive once in 20 times instead of it working once every 20 times

outspoken
 
Posts: 2
Joined: Tue Sep 18, 2012 8:23 pm

Re: DHT22 / RHT03

Post by outspoken »

How did you recompile it?

When I try I get:

Code: Select all

gcc -c -o Adafruit_DHT.o Adafruit_DHT.c -std=c99 -I. -lbcm2835
Adafruit_DHT.c:24:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
make: *** [Adafruit_DHT.o] Error 1
I can't seem to find bcm2835.h

EDIT: found it, google hides this page quite well - http://www.open.com.au/mikem/bcm2835/index.html

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”