November 15, 2019

Temperature and Humidity Sensor Interface with Arduino

This project is about the interfacing of a DHT22 module with Arduino UNO. The data for temperature and humidity are displayed on the Serial Terminal.

Components Required:
1.     Arduino Uno
2.     DHT22 Module
3.     Data Cable
4.     Jumper wires



What is DHT Sensor?

DHT11 and DHT22 sensors are very basic and slow but are great for hobbyists who want to do some basic data logging. The DHT sensors are made of two parts, a capacitive humidity sensor, and a thermistor. There is also a very basic chip inside that does some analog to digital conversion and spits out a digital signal with the temperature and humidity. The digital signal is fairly easy to read using any microcontroller.


DHT11 vs DHT22:

There are two versions of the DHT sensor, they look a bit similar and have the same pinout, but have different characteristics. Here are the specs:
DHT11:
  • Ultra-low-cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 20-80% humidity readings with 5% accuracy
  • Good for 0-50°C temperature readings ±2°C accuracy
  • No more than 1 Hz sampling rate (once every second)
  • Body size 15.5mm x 12mm x 5.5mm
  • 4 pins with 0.1" spacing
DHT22:
  • Low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 0-100% humidity readings with 2-5% accuracy
  • Good for -40 to 80°C temperature readings ±0.5°C accuracy
  • No more than 0.5 Hz sampling rate (once every 2 seconds)
  • Body size 15.1mm x 25mm x 7.7mm
  • 4 pins with 0.1" spacing
As you can see, the DHT22 is a little more accurate and good over a slightly larger range. Both use a single digital pin and are 'sluggish' in that you can't query them more than once every second or two.
Pinout:

  • VCC supplies power for the module. You can directly connect it to the 5V pin on the Arduino.
  • Data pin transmits the temperature and humidity data in digital form.
  • GND is the Ground Pin and needs to be connected to the GND pin on the Arduino.

Before you upload the code library needs to be installed. Please follow the below mention instruction to install the library.
https://creativestudio1973.blogspot.com/2019/11/introduction-to-arduino-library-manager.html

DHT-sensor-library
https://drive.google.com/open?id=1xzM86JYMBf7aYi4iXbUInRXdXXJcoKJH

Functions under this library
dht.readTemperature() ---------- Gives the temperature value in Centigrade
dht.readTemperature(true) ----- Gives the temperature value in Fahrenheit
dht.readHumidity() -------------- Gives the value of humidity in percentage

Video Example:



SOFTWARE:

No comments:

Post a Comment