Temperature Monitoring With DHT22 & Arduino

Temperature Monitoring With DHT22 & Arduino © Apache-2.0

Simple Temperature Monitoring with DHT22 & Arduino.

  • 214,772 views
  • 58 comments
  • 137 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 View at Amazon

1x DHT22 Sensor View at Amazon

1x Bread Board View at Amazon

3x Jumper Wires View at 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
  • 85 followers

Additional contributors

  • Dht22 libray by Michalis Vasilakis

Published on

April 17, 2016

Members who respect this project

DefaultDefaultDefaultDsc 0510DefaultIvanzlatni23107 1601374222 4171 nDefault

and 129 others

See similar projects
you might like

Similar projects you might like

Portable Arduino Temp/Humidity Sensor with LCD

Project tutorial by ThothLoki

  • 214,470 views
  • 134 comments
  • 296 respects

DHT11 /DHT22 Temperature Sensor

Project tutorial by Daniel Porrey

  • 100,022 views
  • 107 comments
  • 147 respects

Temperature Monitor with DHT22 and I2C 16x2 LCD

Project tutorial by adrakhmat

  • 9,592 views
  • 5 comments
  • 27 respects

Monitoring Temperature Remotely with Blynk for Dummies

Project in progress by Cmtelesann

  • 6,867 views
  • 12 comments
  • 15 respects

Temperature and Humidity Data Logger

Project tutorial by Wimpie van den Berg

  • 32,420 views
  • 2 comments
  • 31 respects
Add projectSign up / Login