ESPBoards Learn – Early Access!

AHT20 Temperature and Humidity Sensor

AHT20 Temperature and Humidity Sensor image

View on Amazon

Overview

The AHT20 datasheet provides comprehensive technical details about the AHT20 digital temperature and humidity sensor, a highly accurate and reliable component designed for industrial-grade applications. This document includes information on the sensor's specifications, electrical characteristics, communication protocols, and recommended usage guidelines, ensuring users can integrate it seamlessly into their projects.

About AHT20 Temperature and Humidity Sensor

The AHT series, developed by AOSONG (Aosong Electronics Co., Ltd.), consists of high-precision digital temperature and humidity sensors.

Key Features

  • Upgraded Performance – The AHT20 offers higher accuracy and improved reliability compared to the AHT10.
  • Reliable Environmental Monitoring – Ideal for weather stations, indoor climate control, and industrial applications.
  • Compact & Efficient – Digital output with I²C interface for seamless integration.

🔗 Learn more about the AHT20 sensor.
🔗 Check out the AHT10 sensor for a more affordable option.

Where to Buy

Get Your AHT20

AHT20 Temperature and Humidity Sensor

Starting from

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

AHT20 Specifications

Complete technical specification details for AHT20 Temperature and Humidity Sensor

📊 Technical Parameters

Interface I2C
Accuracy ±2% RH, ±0.3 °C
Operating Range -40°C to 85°C, 0–100% RH
Voltage 2.0V to 5.5V (typical 3.3V)
Pin Configuration

AHT20 Pinout

The AHT20 pinout includes four pins: VCC (power), GND (ground), SDA (I2C data), and SCL (I2C clock). This upgraded sensor provides improved temperature and humidity measurements via I2C protocol.

Visual Pinout Diagram

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

Pin Types

Power
1

Quick Tips

Upgraded

version of AHT10 with improved performance,Temperature accuracy: ±0.3°C,Humidity accuracy: ±2% RH

Operating

voltage: 3.3V to 5V,I2C address: 0x38 (same as AHT10),Enhanced reliability compared to AHT10

Digital

output with I2C interface,Ideal for weather stations and indoor climate control

Pin Descriptions

Pin NameTypeDescriptionNotes
1 VCC
Power

Power supply input (3.3V to 5V)

Typically 3.3V for ESP32

2 GND
Ground

Ground connection

Common ground

3 SDA
I2C Data

I2C Serial Data line

Bidirectional data (requires pull-up)

4 SCL
I2C Clock

I2C Serial Clock line

Clock signal (requires pull-up)

Connection Guide

Wiring AHT20 to ESP32

Connect the AHT20 to your ESP32 via I2C (SDA and SCL pins). This upgraded sensor offers improved accuracy and reliability compared to the AHT10. Pull-up resistors (typically 4.7kΩ) are required on I2C lines.

Visual Wiring Diagram

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

Connection Status

Required
4

Protocol

I2C

Pin Connections

AHT20 PinConnectionESP32 PinDescription
1 VCC Required
3.3V

Power supply (3.3V or 5V)

2 GND Required
GND

Ground connection

3 SDA Required
GPIO21

I2C data line (with 4.7kΩ pull-up)

4 SCL Required
GPIO22

I2C clock line (with 4.7kΩ pull-up)

I2C

address: 0x38 (same as AHT10 - cannot coexist on same bus)

Pull-up

resistors (4.7kΩ) required on SDA and SCL

Most

modules include pull-up resistors on board

Factory

calibrated - no user calibration needed

Position

away from heat sources to avoid self-heating

Use

longer wires to distance sensor from ESP32 heat

Better

reliability and accuracy than AHT10

In

ESPHome: Specify variant: AHT20 in configuration

Multiple

AHT20 sensors require I2C multiplexer (fixed address)

Ensure

proper ventilation around sensor for accurate readings

Ideal

for precision environmental monitoring

Help & Support

AHT20 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

AHT20 Programming Examples

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

Summary

Wrapping Up AHT20

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