Aziz Bench

DS18B20 vs DHT22

7 of the 10 features in our table differ between the DS18B20 and the DHT22.

Analog Devices (Maxim)

DS18B20

±0.5 °C · temperature only · 1-Wire · 3 to 5.5 V

A 1-Wire temperature sensor, ±0.5 °C from −10 to 85 °C, often sold in sealed probes for water, soil and outdoors.

Watch out: Temperature only, and up to 750 ms per 12-bit reading. The data line needs a pull-up resistor.

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.

Differences

FeatureDS18B20DHT22
Measurestemperaturetemperature · humidity
Humidity accuracyNo humidity±2 %RH
Temperature range−55 to 125 °C−40 to 80 °C
Interface1-WireSingle wire (own protocol)
Supply3 to 5.5 V3.3 to 6 V
Current between readings0.75 µA50 µA
ESPHomedallas_tempdht

Same on both: temperature accuracy · status.

Choose the DS18B20 if you need

Choose the DHT22 if you need

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

Frequently asked questions

What is the difference between the DS18B20 and the DHT22?

The DS18B20 offers a wider temperature range, less current between readings, and sealed probes. The DHT22 offers humidity as well as temperature.

Which is more accurate, the DS18B20 or the DHT22?

Typical datasheet figures for temperature: ±0.5 °C for the DS18B20 and ±0.5 °C for the DHT22. Only the DHT22 measures humidity (±2 %RH). Placement matters as much as accuracy: keep either away from the board’s warm parts.

Can I replace the DS18B20 with the DHT22?

Not as a drop-in: the DS18B20 uses 1-Wire and the DHT22 a proprietary single-wire protocol, so the wiring and the code change.

Other comparisons

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