Temperature Monitoring With DHT22 & Arduino

Temperature Monitoring With DHT22 & Arduino © Apache-2.0

Simple Temperature Monitoring with DHT22 & Arduino.

  • 105,328 views
  • 43 comments
  • 78 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

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,623 views
  • 42 comments
  • 236 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,498 views
  • 95 comments
  • 671 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,386 views
  • 38 comments
  • 236 respects

OpenCat

Project in progress by Team Petoi

  • 195,913 views
  • 154 comments
  • 1,361 respects
Add projectSign up / Login