I have a doubt regarding the adafruit DHT library.
I want to connect 3 DHT11 sensors, and I was wondering if thats possible.
I should define, the 3 pins used,
#define DHTPIN 2 // what pin we're connected to
and three types one for each
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
I have some doubts regarding setup(), it only shows:
dht.begin();
Will it work for 3 sensors?
Thanks!
Moors7
August 26, 2015, 3:12pm
2
Would you be willing to consider the piettetech library? It’s know to be stable, and functioning exceptionally well over the last year or so. With other libraries (adafruit included) there have been various issues. I believe the piettetech even has an example application for multiple sensors which you should be able to expand.
Moors7, sure, I am at Testing Stages… so any ideas are welcome
https://github.com/piettetech/PietteTech_DHT/tree/master/firmware
This is the link? Is not added as one of the libraries on the web-ide?
you create an instance of the library like this:
DHT dht(DHTPIN, DHTTYPE);
and in ```setup()` you use this to initialize the instance of the library:
dht.begin();
you add another instance like this:
DHT dht(DHTPIN, DHTTYPE);
DHT dht2(DHTPIN2, DHTTYPE);
and in setup()
like this:
dht.begin();
dht2.begin();
and so you call the functions with either instance…
Moors7
August 26, 2015, 3:56pm
5
You should find it if you search the library system
@BulldogLowell Thanks begginers question! Will test it. Thanks
@Moors7 Will also try the other library just for comparison!
Thanks both!
1 Like
@aleza84 , did it work? I am looking at the DHT11 or DHT22 for an indoors & outdoors comparison to regulate indoor-climate.
aleza84
September 21, 2015, 10:55pm
8
Works perfectly!!! Sorry for the late reply, I got three DHT11 working just fine.
Let me know if yours works, if not feel free to ping me.
1 Like
dc78
April 24, 2016, 3:08pm
9
Which library did you prefer to use finally ? Adafruit or Piet ? why ? (just starting to implement this on a sensors farm)
They both work fine, in my experience.
there seems to be a lot more support here for the Piettetech library, but I can vouch for the Adafruit too… have a few working on Cores for more than a year, photon’s working well too…
Would you be willing to share the code on this project ?
im looking to do something similar but i am a bit lost