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?
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).
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
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?
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…
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.
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.
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 gotta re-write some code but better than it not working at all