By | November 22, 2017
Hi, Hello Electronics Lovers welcome to this tutorial, in this tutorial I will show you how to Interface DHT11 a very popular temperature and humidity sensor with Arduino. Unlike LM35 this is a digital sensor which has only a single pin output and easily displayed humidity and temperature. We have our regular setup our 16×2 LCD and our DHT 11 sensor. DHT 11 sensor has four pins the third pin which is NC means not connected, the first pin goes to VCC mean 5 Volts the second pin is a digital output and the fourth pin is for ground. 
We will make this circuit by using the Digital pin D7 of the Arduino Nano as an input pin, of course, you can use any available digital input-output pins also. Before move further so let’s see the documentation data sheet for DHT11, you people can easily check and read the datasheet of DHT 11 humidity and temperature sensor in google or an Arduino official website| Temperature and Humidity Sensor.
Library up-gradation in Arduino is very valuable for the case of interfacing new sensors or components with Arduino microcontroller. In this case, we will need the library of DHT 11 sensor, you can download library of this sensor from our website under the section of Arduino tab. Kindly, make sure that library is updated After extracting or copying DHT 11 library into Arduino library folder. The next step is to write the code for this project, further details of the project and code are available in below video.
*Arduino added simplicity and beauty to the embedded world. 

Components Required: 

  • Arduino Nano ( You can use other boards such as Arduino Uno, Mega ….)
  • DHT11 ( Temperature and Humidity Sensor)
  • 16×2 LCD
  • Resistor 220 Ohms
  • Jumper wires 
  • Bread Board

LCD Pins Configuration : 

  •  LCD Enable pin to digital pin 11
  •  LCD RS pin to digital pin 12
  •  LCD D4 pin to digital pin 5
  •  LCD D5 pin to digital pin 4
  •  LCD D6 pin to digital pin 3
  •  LCD D7 pin to digital pin 2
  •  LCD R/W pin to ground
  •  LCD VDD to 5V 
  •  LCD VSS to Ground
  •  LCD Vee or Vo to Ground

Schematic Diagram :

I have designed this graphical Schematic diagram by using a free simulation tool known as Fritzing. I really like this tool, if you are new and haven’t heard about this wonderful tool, must visit the official website of Fritizing and download this user-friendly tool for yourself now. 
Code : 
#include <dht.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
dht DHT;
#define DHT11_PIN 7
void setup(){
  lcd.begin(16, 2);
void loop()
  int chk = DHT.read11(DHT11_PIN);
  lcd.print(“Temp: “);
  lcd.print(“Humidity: “);
Watch Video:
Must try this project at school or university lab, it,s an easy project. Don’t hesitate to ask any question related to this project If you found any difficulty while making this project | Temperature and Humidity Sensor . 
Category: Arduino

About Abid Jamal

Abid Jamal Received his B.S. Degree in Electronics & Communication in 2014 (Gold Medalist) from University of Lahore, Islamabad, Pakistan and Master’s Degree in Electrical Engineering from Capital University of science and technology, Islamabad, Pakistan, in 2016. He is the Creator of website. Awarded by “A” grade in Electronic & circuits MIT online certificate. He achieved an academic Excellence certificate in the year 2014. He received Dean Honor Roll award for earning GPA 3.67, Spring-2015 in MSEE. He has done many projects using Different kinds of microcontroller. His research interests include Radar Cross Section measurements, Smart Grid communications, Intelligent transportation systems, driver-less car, cellular mobile communication & networks, improve Smartphone’s battery life for 3G+LTE user’s, and embedded systems.

Leave a Reply

Your email address will not be published. Required fields are marked *