Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

DHT22 vs BME280 vs SHT31 — best temperature and humidity sensor

DHT22, BME280 and SHT31 compared on accuracy, interface, speed, pressure sensing and price in India, plus how to spot a BMP280 sold as a BME280.

Community draft — report a mistake

DHT22BME280SHT31
MeasuresTemperature, humidityTemperature, humidity, air pressureTemperature, humidity
Temperature accuracy±0.5 °C±1 °C±0.3 °C
Humidity accuracy±2 % RH typical±3 % RH±2 % RH
InterfaceOwn single-wire protocolI2C (0x76 / 0x77) or SPII2C (0x44 / 0x45)
Fastest readingOnce every 2 sMany per secondMany per second
Supply3.3–6 V3.3 V chip; VIN boards with a regulator take 3.3–5 V2.4–5.5 V
Extras—Pressure ±1 hPa → weather trend, altitudeOn-chip heater to clear condensation
Typical price in India₹180–320₹350–650 (genuine)₹300–600

All three are common in Indian shops and all have mature Arduino and MicroPython libraries. Which one is “best” depends on whether you need accuracy, pressure, or the lowest price. Accuracy figures are typical values from the Aosong, Bosch and Sensirion datasheets; prices are indicative.

DHT22 — the cheap, simple one

  • One data wire on any GPIO; no I2C address to worry about.
  • Good enough for room monitoring and most home projects.
  • Slow (one reading per 2 s) and its timing-sensitive protocol occasionally fails a read — code must handle NaN.
  • Drifts after long periods in very humid air.

Guides: DHT22 with ESP32, DHT22 with Uno.

BME280 — the weather-station one

  • Adds barometric pressure: a falling pressure trend often comes before rain, which is genuinely useful in monsoon season.
  • I2C, so it shares two wires with an OLED or RTC.
  • Its temperature reads slightly high if the chip is busy (self-heating) — use the library’s “forced mode” with slow sampling for room readings.
  • The fake problem: many cheap “BME280” boards actually carry a BMP280, which has no humidity sensor. Signs: the library says “Could not find a valid BME280” while an I2C scan finds a device, or humidity always reads 0/NaN. The chip ID tells you for sure — the BME280 not found fix shows how. Buy from a seller who shows the chip markings.

Guide: BME280 with ESP32. Component: BME280.

SHT31 — the accurate one

  • Best accuracy of the three and stable over time. The choice for incubators, cold-chain logging, mushroom rooms or anything where a degree matters.
  • Fast I2C readings; two selectable addresses so you can use two on one bus.
  • The built-in heater can dry the sensor after condensation — useful outdoors in the monsoon.
  • Wide supply range makes it easy on both 3.3 V and 5 V boards.

Component page: SHT31.

Placement matters more than the sensor

Any of these will read 2–3 °C high if it sits next to a voltage regulator, an ESP32 doing Wi-Fi, or in direct sun. Mount the sensor away from the board, give it airflow, and use a vented, shaded box outdoors.

Verdict

Need Pick
Cheapest that’s good enough DHT22
Weather station, rain trend, altitude BME280 (check it’s not a BMP280)
Best accuracy, fast logging, humid environments SHT31

Only need temperature, especially in water or soil? See best temperature sensors for the DS18B20 and others.

↑↓ to move · Enter to open