Temperature Monitoring With DHT22 & Arduino

Temperature Monitoring With DHT22 & Arduino © Apache-2.0

Simple Temperature Monitoring with DHT22 & Arduino.

  • 161,602 views
  • 50 comments
  • 104 respects

Components and supplies

About this project

This is very simple and small post but always simple and small things make smart and enterprise products. Any way it's my dream that i write a program from that i can check my room temperature and humidity instead of watching from small devices.

I am using DHT22 Temperature and Humidity sensor with Arduino UNO R3 and getting it's data from Arduino Serial Monitor. Before i go to next step i think i need to tell you some thing about DHT22. It's Humidity Range is 0-100% and Temperature range is -40 - 125°C that's why I prefer DHT22 as compared to DHT11.

For Complete steps, setup & output please watch the video.

Hardware Required:

1x Arduino/Genuino UNO Purchase FromAmazon

1x DHT22 Sensor Purchase From Amazon

1x Bread Board Purchase From Amazon

3x Jumper Wires Purchase From Amazon

Let's Begin buddies.

First Pin is a VCC connect it to 5V.

Second Pin is Data Pin Connect it to Digital Pin 7.

Third Pin is called NC but i don't know why it's their i did not used it.

And Finally Fourth Pin is Ground Pin  my favorite Pin.

Now upload the code to arduino and wait for ...... output :)

Video For Complete Steps & Output:

Please find the Code in Attachment.

Code

Arduino DHT22 CodeC/C++
DHT22 Code for Arduino
/* How to use the DHT-22 sensor with Arduino uno
   Temperature and humidity sensor
*/

//Libraries
#include <DHT.h>;

//Constants
#define DHTPIN 7     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino


//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

void setup()
{
  Serial.begin(9600);
  dht.begin();
}

void loop()
{
    delay(2000);
    //Read data and store it to variables hum and temp
    hum = dht.readHumidity();
    temp= dht.readTemperature();
    //Print temp and humidity values to serial monitor
    Serial.print("Humidity: ");
    Serial.print(hum);
    Serial.print(" %, Temp: ");
    Serial.print(temp);
    Serial.println(" Celsius");
    delay(10000); //Delay 2 sec.
}

   

Schematics

DHT22 Code
Arduino Code For DHT22
DHT-22.ino

Comments

Author

Img 0296
Muhammad Afzal
  • 8 projects
  • 59 followers

Additional contributors

  • Dht22 libray by Michalis Vasilakis

Published on

April 17, 2016

Members who respect this project

DefaultDefaultDefaultDsc 0510DefaultIvanzlatni23107 1601374222 4171 nDefault

and 97 others

See similar projects
you might like

Similar projects you might like

Monitoring Temperature Remotely with Blynk for Dummies

Project in progress by Cmtelesann

  • 3,081 views
  • 4 comments
  • 11 respects

Portable Arduino Temp/Humidity Sensor with LCD

Project tutorial by ThothLoki

  • 153,365 views
  • 115 comments
  • 186 respects

DHT11 /DHT22 Temperature Sensor

Project tutorial by Daniel Porrey

  • 82,695 views
  • 106 comments
  • 133 respects

Room temperature sensor with display on Mobile

Project showcase by Kaustubh Agarwal

  • 23,926 views
  • 8 comments
  • 54 respects

Portable Temperature Station

Project tutorial by Isaac100

  • 8,086 views
  • 8 comments
  • 35 respects
Add projectSign up / Login