Go Down

Topic: AM2302 (DHTT) : Could it really be this easy? (Read 2416 times) previous topic - next topic


I recently received a new AM2302 temperature / humidity sensor. It's a fully-assembled, wired, version of the DHT22. It seems to be almost too simple to implement. There are 4 wires: one for 5v power (connected to a built-in resistor), one for data and one for ground. There's a fourth wire, in between the 2nd and 4th, which is supposedly useless. But I've heard that it works better if that is also plugged in to ground.

I found the DHT library and example code, copied and pasted a few routines in to my basic code. I plugged the 4 wires in to my mini breadboard and then to my Arduino Uno.

In less than a half an hour I had a fully operational temperature / humidity display program running (hardware & software).

It just seems too easy. I must be missing something. I am counting on you experienced Arduino engineers to tell me what I have forgotten or not adjusted for.

My whole project is here:


It should be that simple.  i am not sure what you are worried about.

The only trouble with those,  seems to be the inherently flaky method of measuring the


Thanks for the confirmation michinyon.

Is there any way to work around the "flaky humidity measurements"?

Is there a better, or more precise, humidity sensor?



As far as I know,  there is no "foolproof" method of detecting humidity in air.

There are four or five methods,  none of them are much good.


There is a defined relation between the speed of sound, the temperature and the humidity. [defined != trivial]

I discussed that here - http://arduino.cc/forum/index.php/topic,65205.msg493120.html#msg493120 -

Code: [Select]
float sos =  331.45 * sqrt(1 + t/273) *  (100 + RH * 0.11  * power(1.82, ((t-273)/10)));  // t in Kelvin

That means if one measures the speed of sound and one knows the temperature one can derive the humidity.

Code: [Select]
RH = (sos / (331.45 * sqrt(1 + t/273)) - 100) / ( 0.11  * power(1.82, ((t-273)/10))));   // TODO check () and formula

Temperature can be measured with a DS18B20 as it has a 0.1 precission.
The speed of sound can be measured with an ultrasound sensors with a defined distance e.g. 50,0000 cm from a wall.

[not build myself but should not be too hard]
Give it a try
Rob Tillaart

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


At temperature around 20C,  the variation in the speed of sound over the range 0% to 100% relative humidity,
is less than one part in ten thousand,   which is likely to be beyond the resolution of your ultrasonic device.


I know the diff is small but I did notinvestigate how small.
Rob Tillaart

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

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131