Argon + DHT11 nothing but zeros

so… I’ve hooked up a DHT11 with the left most pin to 3v3, pin 2 to D7 + 4.7K resistor to 3v3, and pin 4 to GND. I’m using the exact sample code from the adafruit library but it does not seem to be returning anything > 0 for temp or humidity.

is the dht11 + adafruit library somehow not compat on the Argon? This sensor also works on my photon without problems or changes to the code. has anyone been able to get an Argon and a DHT11 working?

1 Like

Hi pironic,

I’ve been using the DHt11 on a photon for quite a while without many issues.

First you count the pins left to right. Alais this isn’t helpful for two reasons. There are a tonne of cheep copies of the DHT11, both as modules and bare sensors. The pin order will depend on what you are using and which side you are viewing it from.

As the Argon is a new platform, could you not prove the DHT11 on something more contempory such as a photon or Arduino. The code should port over (Still not used my Argon yet).

I’d advise proving the sensor first.

Liam

Just a thought, did you make sure to include:

#define DHTPIN  2
#define DHTTYPE  DHT11

And…I only say this because I’ve seen it get reversed…the DHT11 is the blue one, the DHT22 is the white one. And, make sure you don’t read it more than once every 2 seconds.

Thanks for the suggestions fellas. Unfortunately this DHT11 is the blue one and has the label on the back of it identifying it as a DHT11, it came from a rpi setup that had it working perfectly (but i hope to upgrade the rpi python setup to particle), i’ve verified it works on my photon and i’ve included the definitions :frowning:
EDIT: oh and i also only read the temperature once per loop with a 2500 ms delay between.

one of the things i’m wondering is the pinout method. Could the pins that the library references be different from the argon to the photon? I’ve had a DHT11 working for wonders for the past few years on my photon without issue. pin 6 = D6… maybe that’s not the case on the argon? Could it be zero indexed or something? I’ve tried both D7 and 7 for that constant. Maybe i literally hvae to go one by one through all the possible? :expressionless:

For grins, can you try a 10K from the data pin to VCC. I’ve always used that value resistor.

i was using a 4.7K resistor between … well here:
https://imgur.com/0RUl4uW

are you suggesting i just switch the 4.7K for a 10K and read it the same way? Just to see if it gets anything?

yes, i always use a 10K when I’m working with a DHT11 or 22. In fact, the Adafruit page even mentions that if it doesn’t work with a 4.7K, try a 10K.

I’ll give that a try and report back. Thanks for the suggestion.
(I must have missed that comment on adafruit’s page. thanks)

it was referenced in the page regarding connecting it to a Pi.

no dice :frowning:

I couldn’t have a more simple set up and yet it still fails…

Since the STM32F processor on the Photon and the Nordic processor on the Xenon handle interrupts differently, is it possible that the library needs to be updated for the new hardware?
I have not received my Mesh hardware to experiment, so it is just an idea that may be worth looking into…

1 Like

It’s always best to avoid the anonymous pin numbers as they are not the same over all platforms.
With Particle devices you should use the labels printed on the pins or their alternative descriptive names (e.g. MISO, TX, D6, …)

While for Gen1 & 2 devices D# was always the same as 0# and A# lined up with 1# that’s not the case for Gen3 devices anymore.

I went back through my projects and found one that has been working for almost 2 years with a Photon and a DHT11. I’m using A0 for the input pin.

I’m using the Adafruit_DHT (0.0.2) library. On this project I did use a 4.7K resistor to VCC (3.3v).

On my temp read, I used a double instead of a float:

double t;
t = (double) dht.getTempFarenheit();

I’m out of town for a couple of days, but when I get home this weekend I will load this same s/w and h/w setup on an Argon and Xenon to see if anything changes.

1 Like

Hey folks, I got a sketch and tested on photon, and just tried to run the same on a Xenon/Argon and it doesn’t work. Get only zeros reading. I have a bunch of sensors, so tested with different units and same results.

I am planning to debug as soon I have some time. Please let me know if any findings from your side.

I flashed the DHT-simple.ino to my Argon this morning and it worked. I feel your pain, it’s been a bit of a struggle for me too. ScruffR recommended I give it a try. I put mine on D2. I am using that Grove Shield, so I didn’t have to worry about the resistor or anything like that.

Interesting. Maybe some flaws in the argon that need to be looked at by someone who can adjust the firmware/adafruit library?

@ksprayberry where did you get the DHT-simple.ino? can you link to a copy of it? is it this one? https://build.particle.io/libs/PietteTech_DHT/0.0.5/tab/example/DHT_simple.ino

Yep! That’s it. My apologies for not being clearer. That’s the one. I couldn’t make any of the other libraries work. They kept on saying file or directory not found.

Thanks. Shame that the adafruit one doesn’t work anymore I’ll give this a try and maybe that’s the solution. use the other library :expressionless: gotta re-write some code but better than it not working at all :smiley:

Thanks for testing it out too!

Looks like that works. The lesson here is that the Adafruit DHT library needs to be updated. For now use the PietteTech_DHT library.

Thank you to @ksprayberry for suggesting it. The library example worked great.
https://build.particle.io/libs/PietteTech_DHT/0.0.5/tab/example/DHT_simple.ino

2 Likes

I just tried the same code that works on the Photon with the Adafruit library on a Xenon. No joy.