Collection: Temperature & Humidity Sensors

Temperature and humidity sensors are the heart of weather stations, greenhouse monitors and smart fans.

The sensors we cover:

  • The DHT11 is the cheapest, at about ±2°C, and fine for classroom demos.
  • The DHT22 is far better, at about ±0.5°C over -40 to 80°C and 0-100% RH, but it can only be read once every 2 seconds.
  • The AHT10 and AHT21B use I2C, so they share two wires with displays and other sensors.
  • The BMP280 reads pressure and temperature but not humidity.
  • The BME280 adds humidity.
  • The BME680 adds a gas (VOC) reading for indoor air quality.
  • The DS18B20 comes as a waterproof probe for liquids, fridges and aquariums.

How to choose: start with accuracy and interface. For most projects the DHT22 is the best value for accuracy. Pick an I2C sensor if your pins are limited, and a BME280 or BME680 if you want pressure or air quality too.

All of these work with Arduino and ESP32. On an ESP32, power them from 3.3V so the data line never sees 5V.

Frequently asked questions

DHT11 or DHT22?

The DHT22. It cuts temperature error from about ±2°C to ±0.5°C and covers a wider range.

Why does my DHT sensor return NaN?

Usually it is being read faster than once every 2 seconds, or the data line or pull-up is miswired.

Does the BMP280 measure humidity?

No. It measures pressure and temperature. For humidity choose the BME280; the BME680 adds VOC gas.

Can these sensors share pins?

The I2C ones can (AHT, BMP/BME). Each answers on its own address on the same SDA/SCL pair.

Guides

Reference pages on soldr.ai

More guides on soldr.ai

Describe your build on Soldr and it picks the parts, writes and compiles the code, and shows how to wire them. Sign in and get 100 credits free.