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:
but the program gets stalled somewhere when doing the first reading.
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 - Arduino Playground - DHT11Lib. If you have remarks please send them to me.
No experience with the code mentioned,
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: DHT11 humidity and temperature sensor - ar3ne1humDHT11 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.
The DHT11 does not provide decimal parts. It outputs zero's.
OK.
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.
estratos:
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?