1) DHT11/DHT22 Temperature and Humidity Sensor.

 

1) DHT11/DHT22 Temperature and Humidity Sensor





These DHTXX sensors are very popular among the Arduino Tinkerers. The DHT sensors are inexpensive sensors for measuring temperature and humidity.

These sensors contain a chip that does analog to digital conversion and spits out a digital signal with the temperature and humidity.


                        


Specifications DHT11 vs DHT22

There are two versions of the DHT sensor:

DHT11

  • Range: 20-90%

  • Absolute accuracy: ±5%

  • Repeatability: ±1%

  • Long term stability: ±1% per year

  • Price: $1 to $5



DHT22

  • Range: 0-100%

  • Absolute accuracy: ±2%

  • Repeatability: ±1%

  • Long term stability: ±0.5% per year

  • Price: $4 to $10

As you can see from the specs above, the DHT22 is a bit more accurate.


Arduino with DHT11 Sensor

For this example you need the following components.


  • Arduino UNO
  • 1x DHT11
  • Breadboard
  • 10KΩ Resistor (or 4.7KΩ)
  • Jumper Wires




Schematic

Here’s how to connect the DHT11 to an Arduino:



 


Source code
Below you can find the code you need for this project. But first you need to install the DHT library.
  1. Download the DHT11 library here

  2. Unzip the DHT library

  3. Rename the extracted folder to DHT and remove the “-“. Otherwise your Arduino IDE won’t recognize your library

  4. Install the DHT11 in your Arduino IDE: go to Sketch 🞂 Include Library 🞂 Add . ZIP library and select the library you’ve just downloaded

  5. Restart your Arduino IDE

  6. Go to File 🞂 Examples 🞂 DHT sensor library 🞂 DHTtester

  7. Upload the code




Demonstration

In this project the Arduino is measuring the temperature and humidity. Those two measurements are being displayed on the serial monitor. Here’s what you should see in your Arduino IDE serial monitor.





--------------------------------------------------------------------------------

Please Follow us on social media for more Projects.

YouTube   :- https://www.youtube.com/channel/UCfN0xOv6BIkgyct4hAyFKSA

Instagram :- https://www.instagram.com/cooltronicsprojects/

Facebook  :- https://m.facebook.com/cooltronicsprojects/?ref=py_c

For full Arduino sensors tutorials series click on Following link :-
 https://www.youtube.com/playlist?list=PLsYrmKx15ywI0bRGCQ1T3SPU2_pTilKV7

  --------------------------------------------------------------------------------

Comments

Popular posts from this blog

C programming language