Elegoo Arduino Uno R3- “Temperature and Humidity Monitor”


By: Conner Elling, Reporter

In this article, you will hopefully learn how to create a working temperature and humidity monitor using the Elegoo Arduino Uno R3. The pieces you will need for this are:

  1. DHT11 Temperature module or DHT22
  2. Elegoo Arduino Uno
  3. Breadboard (if you are using male to male jumper wires)
  4. Jumper Wires


I am doing this with female to male jumper wires so I do not need the breadboard. First off you need to connect a jumper wire to the very left pin of the DHT11 to 5v on the Arduino. This connects it to the power. Next, you need to connect a jumper wire from the second pin on the DHT11 to pin 7 on the Elegoo Arduino. That connects it to the data. And lastly, connect a jumper from the third pin on the DHT11 to the ground in the power section near 5v.

Code: You can copy and paste the code into the Arduino editor and it should work when you plug in your Arduino.

/* 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.