Pages: [1]   Go Down
Author Topic: DHT11 test program  (Read 2440 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm currently playing with the DHT11 Humidity&Temperature sensor with the following code:
http://www.nuelectronics.com/download/projects/sensor_pde/dht11.pde
provided by Nuelectronics.

The program seems to run fine excepts for the fact that both the temp and the humidity readings show no decimal values:

Current humdity = 37.0%  temperature = 26.0C

Has anyone experience with these sensors and the above code? It's not very important since the accuracy of the temp sensor is +-2C and the humidity sensor is +-4% but I wanted to be sure of doing things correctly. I've also tried this other code:
http://sheepdogguides.com/arduino/ar3ne1humDHT11.htm

but the program gets stalled somewhere when doing the first reading.

Thanks for your feedback!
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 310
Posts: 40382
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't see anything at the first link, and there are several programs on the second link.  You can post the code here with #
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The program seems to run fine excepts for the fact that both the temp and the humidity readings show no decimal values: Current humdity = 37.0%  temperature = 26.0C Has anyone experience with these sensors and the above code?
The DHT11 does not provide decimal parts. It outputs zero's. Today I wrote a playground article about a DHT11 class. The "bigger" DHT22 does provide decimals. For the lib and a simple testprogram see - http://arduino.cc/playground/Main/DHT11Lib. If you have remarks please send them to me.

No experience with the code mentioned,

Quote
It's not very important since the accuracy of the temp sensor is +-2C and the humidity sensor is +-4% but I wanted to be sure of doing things correctly. I've also tried this other code: http://sheepdogguides.com/arduino/ar3ne1humDHT11.htm but the program gets stalled somewhere when doing the first reading.
Since you have working code its not important. You should see the humidity and temp rise when you breath to it.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The DHT11 does not provide decimal parts. It outputs zero's.

OK.

Quote
The "bigger" DHT22 does provide decimals.

Very interesting! Much more accuracy, support for negative temps...Only a drawback IMO if you're powering the sensor from batteries: voltage range is 3.3-6V whilst DHT11's is 3-5.5V. I'll give it a try though when I have the opportunity.

Thanks for your help!
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
DHT22 - voltage range is 3.3-6V
That means 3.3 volt is sufficient ...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Very interesting! Much more accuracy, support for negative temps...

Damn! Are you saying that DHT11 won't show the only temperatures we have in Finland? Summer is coming, and someday soon, within months, we are going to have a chance to drink water OUTSIDE without ice...

Seriously, is that part only for over 0c temperatures?

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Seriously, is that part only for over 0c temperatures?

From the DHT11 datasheet:

Quote
Measuring range:
humidity 20-90%RH
temperature 0-50 Celsius

IMO, DHT11 is a sensor for indoor use only in your case.
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep! And that is ok, I have a plave for that.
 smiley

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

FYI - a new DHT lib is in BETA - it will support both DHT11 and DHT22 - as soon as DHT22 arrive the lib can be tested.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: