Diagrama de pines
Pines de Sensor de temperatura y humedad AHT10 / AHT20

Pines
- VIN — voltage tolerance depends on which die is actually on the board: the AHT20 is rated 2.0–5.5V, but the older AHT10 die is only rated 1.8–3.6V (absolute max 3.6V per its datasheet). Most of these small blue breakouts wire VIN straight to the sensor with no onboard regulator, so feeding 5V into a genuine AHT10-chip board can exceed its absolute maximum rating — stick to 3.3V unless you've confirmed which die is on it. Whatever voltage you do feed VIN also sets the logic level on SDA/SCL.
- GND
- SCL — I2C clock; add a pull-up to VIN if the breakout doesn't already carry one (most stock boards do, typically around 10kΩ)
- SDA — I2C data at the fixed address 0x38, with no address-select pin, so two AHT10/AHT20 units cannot share one bus without a multiplexer
Especificaciones
| Tensión de alimentación | AHT20: 2.0–5.5 V; AHT10: 1.8–3.6 V |
|---|---|
| Interfaz | I2C |
| I2C address | 0x38 (fixed) |
| Humidity range | 0–100 %RH |
| Humidity accuracy | ±2 %RH typical |
| Temperature range | −40–85 °C |
| Temperature accuracy | ±0.3 °C typical |
| Measurement time | ≈80 ms after trigger (0xAC) |
| Init / calibration command | AHT10: 0xE1; AHT20: 0xBE |
| Supply current (AHT20) | ≈980 µA measuring, 0.25 µA sleep |
| Power-up delay | 20–40 ms before first command |
Notas
- Unlike the DHT11/DHT22 already in this app, which bit-bang a single proprietary one-wire data line, the AHT10/AHT20 is a normal I2C device on SDA/SCL — it shares the bus with everything else instead of needing its own GPIO pin, and drops the DHT's fragile microsecond-timed read.
- Needs a short warm-up after power-up — typically 20–40ms — before its first command will succeed; triggering a measurement too early is a common cause of a garbage or all-zero first reading.
- The AHT10 is effectively discontinued, and many boards still printed and sold as "AHT10" now actually ship an AHT20 die; the two share the same pinout, address and read sequence but use a different low-level calibration/init byte (0xE1 vs 0xBE), so a driver hard-coded for one can fail the calibration check on the other. The two dies' voltage ratings also differ — AHT20 tolerates up to 5.5V, AHT10 only up to 3.6V absolute max — so treat any of these boards as 3.3V-only unless you've confirmed which die is actually on it.
- More accurate and cheaper than the DHT11 (typically ±2%RH / ±0.3°C versus the DHT11's ±5%RH / ±2°C); the fixed I2C address 0x38 has no address-select pin, so only one AHT10/AHT20 can sit on a given bus without a multiplexer or bus switch.
- These are generic, unbranded modules from many different factories, so the VIN/GND/SCL/SDA order printed on the silkscreen is not fully standardized — check the board's own labels rather than assuming the same left-to-right order every time.







