Temperature & Humidity
Interfacing AHT10 Temperature & Humidity with Raspberry Pi
What is the AHT10?
AHT10 practical reference
A compact I2C temperature/humidity sensor that replaced the DHT11/DHT22 in many designs thanks to its digital calibration and low power draw.
Key specifications
- Supply voltage: 2.2V–5.5V (breakout modules commonly run at 3.3V or 5V via onboard regulation)
- Operating current: ~0.25 mA during measurement, <0.01 mA average in idle/standby
- Humidity range: 0-100% RH
- Humidity accuracy: ±2% RH (typical, 0-100% range)
- Temperature range: -40°C to +85°C
- Temperature accuracy: ±0.3°C (typical)
- Resolution: 0.024% RH, 0.01°C
- Interface: I2C, up to 400kHz (Fast mode)
- I2C address: 0x38 (fixed, not configurable)
- Response time: ~8 seconds to 63% of a step change
Pinout and connection notes
Fixed I2C address — the AHT10 has no address-select pin, so its 0x38 address cannot be changed. If your project needs two AHT10s on one bus, you'll need an I2C multiplexer (e.g. TCA9548A) rather than an address pin trick.
Pull-up resistors — most breakout boards already include their own 10kΩ pull-ups on SDA/SCL. If you're combining several I2C breakouts on one bus, having pull-ups on every single board isn't harmful but is redundant — it just lowers the effective resistance a bit. It only becomes a real problem with many boards stacked at once.
Initialization matters — unlike the DHT11/22, the AHT10 expects a specific init sequence after power-up (a calibration-enable command, typically 0xE1 0x08 0x00) before its first reading is trustworthy. Most libraries (Adafruit_AHTX0, etc.) handle this automatically — if you're talking to it with raw Wire.h calls, check the datasheet command table first.
Check the calibration bit — each status byte returned by the sensor includes a "calibrated" flag. Skip acting on the very first reading after power-up until that bit is set, or you risk reading pre-calibration noise as valid data.
- VCC: Power, 2.2–5.5V DC depending on breakout
- GND: Ground
- SCL: I2C clock line
- SDA: I2C data line
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up AHT10 with Raspberry Pi
Library
Adafruit CircuitPython AHTx0 by Adafruit
pip3 install adafruit-circuitpython-ahtx0
Wiring
| Component pin | Raspberry Pi pin | Note |
|---|---|---|
| VCC | 3.3V (physical pin 1) | |
| GND | GND (physical pin 6) | |
| SCL | GPIO3 / SCL1 (physical pin 5) | |
| SDA | GPIO2 / SDA1 (physical pin 3) |
Swipe sideways to see every column →
Enable I2C via sudo raspi-config first, then verify with i2cdetect -y 1 — the AHT10 should appear at address 0x38.
Related Components
Related Guides & Projects
Raspberry Pi Pico W and Pico 2 W: Install MicroPython with Thonny or UF2
Hold BOOTSEL, drag the correct UF2 file, open the REPL and blink the onboard LED. Includes the Pico vs Pico W vs Pico 2 W firmware differences and what to do when the drive does not appear.
Raspberry Pi Pico W Web Server in MicroPython: Control an LED and Read a Sensor
Connect the Pico W to WiFi, serve a responsive control page, switch an LED and display the onboard temperature or an external sensor, with timeouts and reconnect handling.
Raspberry Pi Pico Oscilloscope with MicroPython
Convert a Raspberry Pi Pico into a basic 500 kSPS oscilloscope using its 12-bit ADC and MicroPython. Displays waveforms on an SSD1306 OLED or streams samples over USB serial to a Python plotter on your PC.
Self-Hosted Nextcloud NAS on Raspberry Pi 4
Build a private, durable Nextcloud NAS on a Raspberry Pi 4 -- SSD boot instead of a failure-prone SD card, Docker Compose with Redis caching, Tailscale for remote access with zero ports forwarded, and an automated backup strategy that actually runs.