Component guide · Beginner · 3 min read
AHT10 Temperature and Humidity Sensor

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The AHT10 from Aosong is a low-cost digital temperature and humidity sensor on I2C at address 0x38. It reads 0 to 100 % RH with ±2 % accuracy and −40 to 85 °C with ±0.3 °C. Geekobot stocks it in a vented shell and in a stainless-steel probe with a 1 m cable, ready for greenhouses, cold rooms and outdoor stations.
Key specs at a glance
- Humidity
- 0 to 100 % RH, ±2 %
- Temperature
- −40 to 85 °C, ±0.3 °C
- Interface
- I2C, address 0x38 (0x39 on some boards)
- Supply
- 1.8 to 3.6 V chip; check the cable version's wiring label
- Resolution
- 20-bit humidity and temperature
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the AHT10 is
The AHT10 is the earlier member of the AHT family; the AHT20 is the newer version with the same address. It is calibrated at the factory and needs only a short command to start a measurement.
Some AHT10 parts do not behave well when other devices share the I2C bus, because of how they respond to general commands. If you see other sensors stop answering, give the AHT10 its own bus or switch to the AHT20.
AHT10 pinout
The pins on the AHT10 and what each one does.
| Pin | Function |
|---|---|
| VCC (red) | Supply, 3.3 V (check the label on the cable) |
| GND (black) | Ground |
| SDA | I2C data (often yellow or blue on the probe) |
| SCL | I2C clock (often white or green on the probe) |
- VCC (red)
- Supply, 3.3 V (check the label on the cable)
- GND (black)
- Ground
- SDA
- I2C data (often yellow or blue on the probe)
- SCL
- I2C clock (often white or green on the probe)
Wiring the AHT10
Wire colours on probes and shell versions vary between batches, so check the label on the cable before connecting. With a 5 V board, use a level shifter. Long cables need stronger pull-ups (2.2 to 4.7 kΩ) and a slow I2C clock.
| AHT10 pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 3.3V | 3V3 |
| GND | GND | GND |
| SDA | A4 (via level shifter) | GPIO 21 |
| SCL | A5 (via level shifter) | GPIO 22 |
- VCC
- Arduino Uno:
- 3.3V
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- SDA
- Arduino Uno:
- A4 (via level shifter)
- ESP32:
- GPIO 21
- SCL
- Arduino Uno:
- A5 (via level shifter)
- ESP32:
- GPIO 22
Example code
Install "Adafruit AHTX0" from the Library Manager. On a long cable, call Wire.setClock(50000) after begin() for reliable reads.
#include <Adafruit_AHTX0.h>
Adafruit_AHTX0 aht; // works with AHT10 and AHT20
void setup() {
Serial.begin(115200);
if (!aht.begin()) { Serial.println("No AHT10 found"); while (1); }
}
void loop() {
sensors_event_t hum, temp;
aht.getEvent(&hum, &temp);
Serial.print(temp.temperature); Serial.print(" C ");
Serial.print(hum.relative_humidity); Serial.println(" %RH");
delay(2000);
}Setup and tuning
I2C is meant for short distances; up to about 1 to 2 m works with a slow clock and good pull-ups.
keep the vented end out of direct water spray and sunlight.
every 2 seconds or slower to avoid self-heating.
What you need
Shop this list6 of 6 found in our store · ₹1,375
AHT10 Digital Temperature & Humidity Sensor Module with White Shell, Built-in Cotton Core, Card Holder & 1m Cable: the part this guide coversAHT10 Digital Temperature & Humidity Sensor Module with White Shell, Built-in Cotton Core, Card Holder & 1m Cable₹419
AHT10 stainless steel probe (1 m): a sealed version for outdoor and cold-room useAHT10 Stainless Steel Probe Line 1 Meter – I2C Digital Temperature & Humidity Sensor₹359Closest match, check the specs
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
4-channel logic level converter (BSS138): to connect 5 V and 3.3 V signals safely4-Channel Logic Level Converter (BSS138)₹20
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- AHT20: newer version that shares the bus without trouble.
- SHT3x and SHT4x: higher accuracy and long-term stability.
- DS18B20: when you only need temperature on a long cable.
Try it: I2c pullup calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Guessing the probe's wire colours instead of reading the label.
- Using a long cable at the default 100 kHz clock with weak pull-ups.
- Sharing the bus with other sensors and getting errors from all of them.
- Powering it from 5 V without checking the module.
Frequently asked questions
What is the AHT10's I2C address?
0x38, or 0x39 on boards with the address pin pulled high.
AHT10 or AHT20?
The AHT20 is the improved version and behaves better on a shared I2C bus.
How long can the cable be?
About 1 to 2 m with a slow I2C clock; longer runs need an I2C extender.
Does it work with ESP32?
Yes, connect it directly to the 3.3 V I2C pins.
How accurate is it?
±2 % RH and ±0.3 °C typical.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 26 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.
