Aziz Bench

AHT20 vs SHT31

6 of the 10 features in our table differ between the AHT20 and the SHT31.

Aosong

AHT20

±0.3 °C · ±2 %RH · I²C · 2 to 5.5 V

A small, low-cost I²C sensor with ±0.3 °C and ±2 %RH: the usual upgrade from a DHT22.

Watch out: Fixed address 0x38, so one per bus. In ESPHome, use the aht10 component with variant AHT20.

Sensirion

SHT31

±0.2 °C · ±2 %RH · I²C · 2.15 to 5.5 V

Sensirion’s well-proven sensor: ±0.2 °C, ±2 %RH, two I²C addresses and a supply from 2.15 to 5.5 V.

Watch out: The SHT4x is newer, smaller and more accurate on humidity for the same job.

Differences

FeatureAHT20SHT31
Temperature accuracy±0.3 °C±0.2 °C
Temperature range−40 to 85 °C−40 to 125 °C
I²C address0x380x44, 0x45 (set with a pin)
Supply2 to 5.5 V2.15 to 5.5 V
Current between readings0.25 µA0.2 µA
ESPHomeaht10sht3xd

Same on both: measures · humidity accuracy · interface · status.

When to choose the AHT20

In our table the AHT20 has nothing the SHT31 lacks: choose it for price, availability or a board you already have.

Choose the SHT31 if you need

Open the sensor comparison →Tick what your project needs and see which sensor fits best.

AHT20: I²C address, wiring and pull-ups →
SHT31: I²C address, wiring and pull-ups →

Frequently asked questions

What is the difference between the AHT20 and the SHT31?

The SHT31 offers better temperature accuracy, a wider temperature range, a choice of I²C addresses, and a ready-made configuration in this site’s ESPHome generator; in our table the AHT20 has no advantage of its own, apart from price or availability.

Which is more accurate, the AHT20 or the SHT31?

Typical datasheet figures: temperature ±0.3 °C for the AHT20 and ±0.2 °C for the SHT31; humidity ±2 %RH and ±2 %RH. Placement matters as much as accuracy: keep either away from the board’s warm parts.

Can I replace the AHT20 with the SHT31?

Often yes: both use I²C. Change the driver or, in ESPHome, the component (aht10 → sht3xd). The I²C address changes too (0x38 → 0x44/0x45).

Other comparisons

Figures from the makers’ datasheets and product pages and the ESPHome documentation, checked in November 2026.