Environment & Temperature

# Aosong AHT20 digital twin

Factory-calibrated I2C temperature and relative humidity sensor.

standing: provisional I2C 0x38 (fixed)

Vendor Aosong Environment & Temperature

Interface I2C 0x38 (fixed)

Record Status 2026-11-19 rev c3f5f9950 (clean tree)

## Driver oracle & capability record

Part of the 27-part, 44-case twin-factory oracle suite (44/44 passed, generator 0.1.0+policy.12).

| Driver reference  | Twin-factory vendor-driver oracle (0.1.0+policy.12)                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Evidence standing | provisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples).         |
| Published record  | [accuracy/twin-factory-oracles-2026-11-19b.json](https://circuittwin.ai/evidence/accuracy/twin-factory-oracles-2026-11-19b.json) (SHA-256 caa6e32e53c5) |

## Key registers & reset values

| Address / Field | Register      | Reset / Expected | Purpose                                            |
| --------------- | ------------- | ---------------- | -------------------------------------------------- |
| 0x71            | STATUS        | Bit 3 CAL=1      | Busy flag (bit 7) and calibration status (bit 3)   |
| 0xAC 0x33 0x00  | TRIGGER\_MEAS | 6-byte + CRC     | Starts 20-bit RH and 20-bit temperature conversion |

## Attach with ct CLI

Shell - run firmware with AHT20

```
# Run compiled firmware with AHT20 attached on esp32c3-devkitm
ct run --json --board esp32c3-devkitm --device aht20 build/app.elf

# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/aht20.xml tests/aht20-fault.suite.yaml
```

## Fault-injection test snippet (suite.yaml)

tests/aht20-fault.suite.yaml

```
version: 1
board: esp32c3-devkitm
firmware: build/app.elf
tests:
  - name: aht20-i2c-nack-and-bad-id
    faults:
      - at_ms: 30
        bus: I2C1
        kind: nack
        address: 0x38
        count: 2
      - at_ms: 150
        part: aht20
        kind: frozen_reading
    expect:
      console_contains: "DRIVER_FAULT_DETECTED"
      exit_code: 0
```

## Compatible board twins

[Board: esp32c3-devkitm](https://circuittwin.ai/boards/esp32c3-devkitm) [Board: nucleo-f401re](https://circuittwin.ai/boards/nucleo-f401re) [Board: seeed-xiao-nrf52840](https://circuittwin.ai/boards/seeed-xiao-nrf52840) [Accuracy report](https://circuittwin.ai/docs/accuracy)

## More in Environment & Temperature

[BME280 (Bosch)](https://circuittwin.ai/twins/bme280) [BME680 (Bosch)](https://circuittwin.ai/twins/bme680) [BME688 (Bosch)](https://circuittwin.ai/twins/bme688) [DS18B20 (Analog)](https://circuittwin.ai/twins/ds18b20) [HDC1080 (Texas)](https://circuittwin.ai/twins/hdc1080) [HDC2080 (Texas)](https://circuittwin.ai/twins/hdc2080)

> ## Inject AHT20 bus faults in CI
>
> Wire AHT20 onto your MCU board twin, drive physical stimuli and fail builds when your driver hangs on NACKs or frozen registers.
>
> [Start now](https://app.circuittwin.ai/try) [Inputs & fault injection docs](https://circuittwin.ai/docs/inputs) [Connect a coding agent](https://circuittwin.ai/docs/agents)
