7 of the 10 features in our table differ between the DHT22 and the SHT31.
Aosong
DHT22
±0.5 °C · ±2 %RH · Single wire (own protocol) · 3.3 to 6 V
A step up from the DHT11: ±0.5 °C, ±2 %RH typical and down to −40 °C, still on one data wire.
Watch out: The humidity error can reach ±5 %RH, one reading every 2 s at most, and its own protocol needs precise timing. About 50 µA between readings.
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
Feature
DHT22
SHT31
Temperature accuracy
±0.5 °C
±0.2 °C
Temperature range
−40 to 80 °C
−40 to 125 °C
Interface
Single wire (own protocol)
I²C
I²C address
Not I²C
0x44, 0x45 (set with a pin)
Supply
3.3 to 6 V
2.15 to 5.5 V
Current between readings
50 µA
0.2 µA
ESPHome
dht
sht3xd
Same on both: measures · humidity accuracy · status.
When to choose the DHT22
In our table the DHT22 has nothing the SHT31 lacks: choose it for price, availability or a board you already have.
Choose the SHT31 if you need
better temperature accuracy (±0.2 °C against ±0.5 °C)
a wider temperature range (−40 to 125 °C)
a standard I²C bus shared with other sensors
less current between readings (0.2 µA against 50 µA)
What is the difference between the DHT22 and the SHT31?
The SHT31 offers better temperature accuracy, a wider temperature range, a standard I²C bus shared with other sensors, and less current between readings; in our table the DHT22 has no advantage of its own, apart from price or availability.
Which is more accurate, the DHT22 or the SHT31?
Typical datasheet figures: temperature ±0.5 °C for the DHT22 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 DHT22 with the SHT31?
Not as a drop-in: the DHT22 uses a proprietary single-wire protocol and the SHT31 I²C, so the wiring and the code change.