DHT21 / AM2301A Temperature and Humidity Sensor

DHT21 / AM2301A Temperature and Humidity Sensor image

View on Amazon

Overview

The DHT21 is a reliable sensor for measuring temperature and humidity, offering calibrated digital output and ease of integration with microcontrollers. With a temperature measurement range of -40°C to 80°C and a humidity range of 0% to 100%, the DHT21 is suitable for various applications, including environmental monitoring and HVAC systems.

About DHT21 / AM2301A Temperature and Humidity Sensor

The DHT21, also known as AM2301, is a digital temperature and humidity sensor that provides accurate environmental measurements. It uses a capacitive humidity sensor and a thermistor to ensure reliable data collection.

Key Features

  • High Accuracy – Delivers precise temperature and humidity readings.
  • Single-Wire Digital Communication – Easy integration with ESP32, Arduino, and other microcontrollers.
  • Capacitive Humidity Sensing – Provides stable and long-term performance.
  • Similar to DHT22 – Slight differences in casing and specifications.

With its ease of use and reliable performance, the DHT21 is ideal for climate monitoring, smart home systems, and industrial automation. 🚀

Where to Buy

Get Your DHT21 / AM2301A

DHT21 / AM2301A Temperature and Humidity Sensor

Starting from

$5 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

DHT21 / AM2301A Specifications

Complete technical specification details for DHT21 / AM2301A Temperature and Humidity Sensor

📊 Technical Parameters

Operating Voltage 3.3V to 5.5V
Temperature Range -40°C to 80°C
Humidity Range 0% to 100% RH
Temperature Accuracy ±0.5°C
Humidity Accuracy ±3% RH
Sampling Rate 0.5 Hz (once every 2 seconds)
Dimensions 59mm x 27mm x 13.5mm
Pin Configuration

DHT21 / AM2301A Pinout

The DHT21/AM2301A features the same 4-pin layout as DHT22, with nearly identical specifications and performance.

Visual Pinout Diagram

Pinout Diagram Primary
DHT21 / AM2301A Temperature and Humidity Sensor pinout
4
Total Pins

Pin Types

Power
2
Communication
1
Control
1

Quick Tips

🔌

Uses same single-wire protocol as DHT22,⚠️ Requires 5kΩ to 10kΩ pull-up resistor on DATA pin

💡

Nearly identical to DHT22 in performance,⏱️ Read interval of 2 seconds minimum

🌡️

Wide temperature range (-40°C to 80°C)

Pin Descriptions

Pin NameTypeDescriptionNotes
1 VCC
Power

Power supply input (3.3V to 6V)

Compatible with both 3.3V and 5V systems

2 DATA
Communication

Digital signal output

Single-wire digital interface for data

3 NC
Control

Not connected

Leave this pin unconnected

4 GND
Power

Ground connection

Connect to ESP32 ground

Connection Guide

Wiring DHT21 / AM2301A to ESP32

Connect the DHT21/AM2301A using the single-wire digital interface, identical to DHT22 wiring.

Visual Wiring Diagram

Wiring Diagram Recommended
DHT21 / AM2301A Temperature and Humidity Sensor wiring with ESP32
4
Connections

Connection Status

Required
4

Protocol

OneWire

Pin Connections

DHT21 / AM2301A PinConnectionESP32 PinDescription
1 VCC Required
3.3V

Power supply (3.3V to 6V supported)

2 GND Required
GND

Ground connection

3 DATA Required
GPIO4

Digital data line

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

Pull-up resistor for reliable data transfer

💡

Any GPIO pin works - GPIO4 is commonly used

🔧

5kΩ pull-up resistor recommended (10kΩ also works)

Use 3.3V for ESP32 compatibility

⏱️

Minimum 2 second delay between readings

🔄

Compatible with DHT22 libraries and code

Help & Support

DHT21 / AM2301A Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

DHT21 / AM2301A Programming Examples

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

Summary

Wrapping Up DHT21 / AM2301A

The ESP32 DHT21 / AM2301A 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 DHT21 / AM2301A into your ESP32 project and bring your ideas to life!