Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

dht22 and 3.3v arduinos
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

dht22 and 3.3v arduinos

by bilsch on Sun Dec 08, 2013 11:33 am

Has anyone had trouble reading values from a dht22 sensor via something like the arduino mini pro? Seems if I hook this sensor up to an Uno it reads just fine but on the mini I get 0s...

I'm using the adafrui dht library from http://learn.adafruit.com/dht. I checked ( git pull ) and I'm on the most current code from the library.

Here is my output ( from the mini pro )
{ "sensor_name": "GARAGE", "humidity": 0.00, "celsius":0.00}

From an Uno I get the same except humidity and celsius have non-0.00 values... If I unplug the data pin rather than 0's I get "Read Fail" so I believe this indicates the library is talking to the sensor ok - just getting bad results or something

Bill

bilsch
 
Posts: 17
Joined: Thu Oct 25, 2012 5:16 pm

Re: dht22 and 3.3v arduinos

by bilsch on Sun Dec 08, 2013 12:34 pm

guess I should have done a little more searching

viewtopic.php?f=19&t=33071

Switching to the library mentioned in the thread does fix the bad reading. From the forum thread it sounds like it may be timing related? Should I file this as a bug on https://github.com/adafruit/DHT-sensor-library ?

bilsch
 
Posts: 17
Joined: Thu Oct 25, 2012 5:16 pm

Re: dht22 and 3.3v arduinos

by adafruit_support_mike on Mon Dec 09, 2013 2:55 am

bilsch wrote:Should I file this as a bug on https://github.com/adafruit/DHT-sensor-library ?

Before you do, I'd like you to test something:

Load the DHTtester sketch that comes with the library and change line 18 from this:

Code: Select all | TOGGLE FULL SIZE
DHT dht(DHTPIN, DHTTYPE);

to this:

Code: Select all | TOGGLE FULL SIZE
DHT dht(DHTPIN, DHTTYPE, 60);

I think there might be a typo in the header file, but I don't have that sensor on hand to run the test myself.

The '60' tells the library to treat pulses lasting more than 60 microseconds as 1s, and pulses lasting less than 60 microseconds as 0s. It's a parameter with a default value set in the declaration, but the default value is '6'. My reading of the library code and the datasheet say that value is too small to be useful.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

adafruit_support_mike
 
Posts: 63928
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.