Temperature monitor using Arduino and dht22


In this Arduino-based project, we monitor the temperature inside the room, using the DHT22 sensor and Arduino programming here we calculate the temperature as well as the humidity. Which can be helpful in implementing several consumer products and industrial devices for students and electronics enthusiasts


Required components

Arduino Uno R3 x 1Buy Now
Dht22 x 1Buy Now
Bread Board x 1Buy Now
Jumper wire male to female x 1Buy Now

VCC connect it to 5V of arduino.

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

And Finally Fourth Pin is Ground Pin


/* How to use the DHT-22 sensor with Arduino uno
   Temperature and humidity sensor

#include <DHT.h>;

#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

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

void setup()

void loop()
    //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(" %, Temp: ");
    Serial.println(" Celsius");
    delay(10000); //Delay 2 sec.


Leave a Reply

Your email address will not be published.

Main Menu