DHT11 Temperature and Humidity Sensor

DHT11 Temperature and Humidity Sensor image

View on Amazon

Overview

The DHT11 is a low-cost digital sensor for measuring temperature and humidity. It provides calibrated digital outputs and is easy to interface with microcontrollers. With a temperature measurement range of 0-50°C and humidity range of 20-90%, it's suitable for basic environmental sensing applications.

About DHT11 Temperature and Humidity Sensor

The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and outputs a digital signal on the data pin (no analog input pins needed). It’s fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds.

Where to Buy

Get Your DHT11

DHT11 Temperature and Humidity Sensor

Starting from

$2 per unit

Amazon com
Amazon.com Ships worldwide
Amazon de
Amazon.de Ships to EU
Aliexpress
AliExpress Best value option

💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specs

DHT11 Specifications

Complete technical specification details for DHT11 Temperature and Humidity Sensor

📊 Technical Parameters

Interface Single-Wire Digital
Temperature Range 0°C to 50°C
Humidity Range 20% to 90% RH
Temperature Accuracy ±2°C
Humidity Accuracy ±5% RH
Operating Voltage 3.3V to 5.5V
Sampling Rate Once every 2 seconds
Pin Configuration

DHT11 Pinout

The DHT11 features a simple 4-pin design for power and single-wire digital communication.

Visual Pinout Diagram

Pinout Diagram Primary
DHT11 Temperature and Humidity Sensor pinout
4
Total Pins

Pin Types

Power
2
Communication
1
Control
1

Quick Tips

🔌

Sensor uses single-wire digital interface,⚠️ Requires 10kΩ pull-up resistor on DATA pin

💡

Works with both 3.3V and 5V power supplies

⏱️

Sampling rate limited to once per second

Pin Descriptions

Pin NameTypeDescriptionNotes
1 VCC
Power

Power supply input (3.3V or 5V)

Compatible with both 3.3V and 5V logic levels

2 DATA
Communication

Digital signal output

Connect to any digital GPIO pin on microcontroller

3 NC
Control

Not connected

Leave this pin unconnected

4 GND
Power

Ground connection

Connect to ESP32 ground

Connection Guide

Wiring DHT11 to ESP32

Connect the DHT11 using the single-wire digital interface with a pull-up resistor for reliable communication.

Visual Wiring Diagram

Wiring Diagram Recommended
DHT11 Temperature and Humidity Sensor wiring with ESP32
4
Connections

Connection Status

Required
4

Protocol

OneWire

Pin Connections

DHT11 PinConnectionESP32 PinDescription
1 VCC Required
3.3V

Power supply (can use 3.3V or 5V)

2 GND Required
GND

Ground connection

3 DATA Required
GPIO4

Digital data line

4 DATA (Pull-up) Required
10kΩ to VCC

Pull-up resistor for reliable communication

💡

GPIO4 is commonly used but any GPIO pin works

🔧

10kΩ pull-up resistor between DATA and VCC is required

Use 3.3V for ESP32 compatibility, 5V also works

⏱️

Wait at least 2 seconds between readings

Help & Support

DHT11 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

DHT11 Programming Examples

Ready-to-use code examples for different platforms and frameworks

Summary

Wrapping Up DHT11

The ESP32 DHT11 Temperature and Humidity Sensor is a powerful environment sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

Best Practices

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Safety First

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.

Ready to Start Building?

Now that you have all the information you need, it's time to integrate the DHT11 into your ESP32 project and bring your ideas to life!