DHT11,DHT22 Sensor

DHT11 Sensor Interfacing With Arduino, ESP01,ESP8266 And ESP32


In this article, we interface The DHT11  temperature and humidity sensor is commonly used in college projects to find out the temperature and humidity of the environment. The sensor logic output is in digital format and is required only 5v. we will just interface the DHT11 Sensor with Arduino and we display the sensor reading in the serial monitor,16×2 LCD Display and OLED Display

Screenshot 2022 12 18 at 9.16.42 PM e1671378965280

Principle of Operation

They present a small chip that contains a capacitive humidity sensor and a thermistor for temperature measurement.

  • Sensing Elements: It has two sensing elements: a humidity sensor and a temperature sensor. Humidity elements find out the moisture present in the air, and temperature elements find out the temperature.

Screenshot 2023 06 19 at 11.23.11 PM


  • Analogue-to-Digital Conversion: The temperature & humidity in analog format and are converted into digital signals by an internal analogue-to-digital converter (ADC) within the sensor chip.
  • Single-Wire Interface: The DHT11 sensor communicates single wire because its digital sensor is required only one digital Pin.
  • Timing Protocol: The sensor responds by pulling the line low and then high to transmit the data.
  • Data Transmission: The sensor data format is 40-bit binary. includes 16 bits for humidity, 16 bits for temperature, and 8 bits for a checksum.
  • Calibration and Accuracy: The DHT11 sensor calibration is easy and the accuracy is not good but The DHT22 is higher Accuracy sensors.
  • Power Requirements: 3.3V and 5V, to DC Voltage required.

Specifications of the DHT11 sensor

  • Temperature Range:  0°C to 50°C (32°F to 122°F).
  • Temperature Accuracy:  ±2°C.
  • Humidity Range: 20% to 90%.
  • Humidity Accuracy:  ±5%.
  • Resolution:  1°C for temperature measurements & 1% for humidity measurements.
  • Response Time: 2 seconds for temperature readings & 2-5 seconds for humidity readings.
  • Supply Voltage:  3.3V and 5V DC.
  • Current Consumption: 1.5mA
  • Communication:  single-wire (Digital Sensor).
  • Sampling Rate: 2 seconds.

Advantages of the DHT11 sensor

  • Cost-Effective
  • Ease of Use
  • Wide Availability
  • Low Power Consumption
  • Reliable Performance
  • Compact Size

Disadvantages of DHT11 Sensor

  • Limited Accuracy:
  • Slower Response Time
  • Limited Operating Range only 0°C to 50°C (32°F to 122°F) 
  • No Negative Temperature Measurement

Application of DHT11 Sensor

  • Home Automation
  • Weather Stations
  • Greenhouses and Agriculture
  • Indoor Environmental Monitoring

Example With Arduino,ESP01,ESP8266 And ESP32

Now We just interfacing the DHT11 sensor with Arduino and we just connected the sensor of the D4 pin number to Arduino. the DHT11 Sensor is a digital temperature sensor that’s why we used D4 Pin Number.

Code With Serial Monitor

Before you used the code is required to add a library for dht. h

Circuit Diagram With 16×2 LCD Display

lcd circuit diagram


Code With 16×2 LCD Display

DHT11 Sensor Interfacing With Arduino And Blutooth App

Circuit Diagram

Circuit diagram 42


DHT11 Sensor Interfacing With ESP8266 And OLED Display

Circuit Diagram

Circuit diagram 40 e1687502940312


DHT11 Sensor Interfacing With ESP01 And Blynk App

Circuit Diagram

Circuit diagram 41


DHT11 Sensor Interfacing With ESP32 

Circuit Diagram

cicuit diagram e1687503458822





  • In this article, we interface with the DH11 sensor but the response time of the sensor is not good slow we will try with the Arduino, ESP01, ESP8266 And ESP32 microcontrollers. if you want good response time then we suggest you used the DHT22 sensor but is a little bit costly.



Hi, Prateek Here I’m interested in Electronics That's why I Make Soo Many Projects, I’m currently Pursuing M Tech.. if you Relay Like To My Blog Plz Comment Below...Thanks To All Electronics Lover...❤️

Leave a Reply

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

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker