DHT11 Temperature and Humidity Sensor With Arduino

In these tutorials, we will measure Temperature and Humidity by using DHT11 with Arduino. Here we also display those readings on an LCD Display.

The DHT11 Temperature and Humidity Sensor senses, measures and regularly reports the relative humidity in the air. It measures both moisture and air temperature. The warmer the air is, the more moisture it can hold, so relative humidity changes with fluctuations in the temperature.

Humidity sensors detect the relative humidity of immediate environments in which they are placed. They measure both moisture and temperature in the air and express relative humidity as a percentage of the ratio of moisture in the air to the maximum amount that can be held in the air at the current temperature. As the air becomes hotter, it holds more moisture, so the relative humidity changes with the temperature.

dht11 temperature and humidity sensor

Components List


Pin Connection of DHT11

DHT11Arduino Pins
Vcc +5v5v
GNDGND
Vout (out)A0

Circuit Diagram of DHT11 with Arduino

With the help of the below circuit diagram connect the sensor and Arduino.

Circuit Diagram of DHT11 with Arduino

DHT11 Library For Below Code

You need to install the below DHT11 library. Just download the below library and open Arduino IDE. Now go to Sketch > Include Library > Add .Zip Library.

Code for DHT11 with Arduino

After installing the DHT11 Library, upload the below code on the Arduino board.

Output 

OUTPUT OF DHT11 WITH ARDUINO CODE 1

Library Used in Below Code

These libraries are used to display some additional about the sensor like its DHT11 or DHT22 and used for the below code.

Code 2

Output 

OUTPUT OF DHT11 WITH ARDUINO CODE 2

Circuit Diagram of DHT11 and LCD with Arduino

Now we will display the temperature and humidity readings on the LCD 16×2 display. For this, following the circuit diagram given below, connect the sensor, LCD with the Arduino.

Circuit of DHT11 and LCD with Arduino

Code for DHT11, LCD with Arduino


Here some more tutorials for you:

Scroll to Top