The DHT22 sensor (also known as the AM2302 reference) and his little brother the DHT11 are temperature and humidity sensors.
DHT22The DHT22/AM2302 sensor is able to measure temperatures from -40 to + 125 °c with an accuracy of +/-0.5 °c and relative humidity levels from 0 to 100% with an accuracy of +/-2% ( +/-5% at extremes, to 10% and 90% ).
A measurement can be performed every 2000 milliseconds.
DHT11The DHT11 sensor is able to measure temperatures from 0 to + 50 °c with an accuracy of +/-2 °c and relative humidity levels of 20 to 80% with an accuracy of +/-5%. A measurement can be done every second.
Then, the DHT22 will be better to use.
But … in this project I will show you how to use DHT11 and DHT22.
However, the DHT11 has a lower cost.
ConnectionsFirst pin ( DHT ) --> 5V
Second pin ( DHT ) --> Pin D2
A resistance must be connected between the wire of the second pin and the wire of the first pin.
Third Pin --> Nothing
Fourth Pin --> GND
You must download a library before used the code:
Go on Arduino IDE, go on file/example/DHT sensor Library/DHTtester (the code on DHT tester is the same as the code above and in attachments) of and observe:
Comments