EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: skillz21 on October 16, 2016, 01:06:35 am

Title: Arduino and DHT-11 Problems
Post by: skillz21 on October 16, 2016, 01:06:35 am
Hi guys,
I recently got a DHT-11. So far, i have been having a lot of trouble getting it to work... I have not been able to find a working code on google :-//. do you guys know any codes that work? or is the problem with my dht-11?
thanks
Title: Re: Arduino and DHT-11 Problems
Post by: Len on October 16, 2016, 01:35:56 am
Adafruit has published an Arduino library & sample code on their web site:
https://learn.adafruit.com/dht?view=all
I haven’t tried it myself, but since they sell the DHT-11 I would expect their code to work.
It does say the code to read the sensor is "a little tricky" so it’s not surprising you had trouble.
Title: Re: Arduino and DHT-11 Problems
Post by: SnipTheCat on October 16, 2016, 08:32:25 pm
Hi guys,
I recently got a DHT-11. So far, i have been having a lot of trouble getting it to work... I have not been able to find a working code on google :-//. do you guys know any codes that work? or is the problem with my dht-11?
thanks

 I have been using the adafruit library with both DHT11 and DHT22 without any problem, however they are not that great sensors (especially de DHT11)

 If you have trouble installing the library, you need to create a folder DHT in your arduino /libraries/ subfolder and put the files there (mainly DHT.h/cpp and example subdir), you should then have a DHT test available form the arduino menu when you restart the IDE.

 Since I have discovered the HTU21D modules, I haven't touched the DHT11/22 anymore, much better accuracy, only drawback is that you need a logic level converter if your arduino is 5V

Title: Re: Arduino and DHT-11 Problems
Post by: frenky on October 17, 2016, 09:16:22 am
Another nice temp and humidity module is Si7021 (3.3V): https://goo.gl/d0fbQs
Title: Re: Arduino and DHT-11 Problems
Post by: JacquesBBB on October 17, 2016, 09:35:23 am
Avoid the DHT11,

their indications are close to none.

I have recently bought 10 DHT12 which are supposed to be an improved version, but which in fact differ from the DHT11 only by the interface.

After some preliminary testings, I have set up a more complete experiment with 9 sensors at the same time.
They give answers that are extremely different for the humidity. Not at all within the advertised specs of the  maker (AOSONG) which says 5% for the DHT11 (did not find the DHT12 datasheet)

The temp seems OK, but

I got   48%, 52%,  56%,  59%,  61%,  68%, 69%, 72%, 72%    for the Humidity output

so  a max difference of 24%  which is  huge.


A same experiment with 5 DHT22 gave much better results

DHT22 

Hum: 63.20 % 60.50 % 63.30 % 65.30 % 66.20 %     Temp: 24.60 C 23.70 C 23.40 C 22.90 C 23.10 C
Hum: 63.20 % 60.50 % 63.30 % 65.30 % 66.30 %     Temp: 24.60 C 23.70 C 23.40 C 22.90 C 23.10 C
Hum: 63.30 % 60.50 % 63.30 % 65.30 % 66.30 %     Temp: 24.70 C 23.70 C 23.40 C 22.90 C 23.10 C