Hardware · Sensor family

Temperature & humidity sensors.

What these are
The most common sensors a grower starts with
They measure
Air temperature and relative humidity
Open Agriculture Technology pick
SHT31 when a reading has to be trusted

Temperature and humidity are the first things most growers measure, and these are the sensors they reach for. A handful of low-cost parts cover almost every need: the DHT11 and DHT22 for a few dollars, the more accurate SHT31, the BME280 that adds air pressure, and the rugged DS18B20 for temperature in wet or tough spots. The right one depends on how much you need to trust the reading.

A temperature and humidity sensor module
Image: adafruit.com

What they measure.

Two things, usually together: air temperature, in degrees, and relative humidity, the percentage of moisture the air is holding compared with the most it could hold at that temperature. Together they describe the climate a plant’s leaves actually feel, and they are the inputs to vapor pressure deficit, the number serious growers watch.

Dumb or smart.

It is worth knowing how much work the sensor does for you. At the simplest end, a bare thermistor is not smart at all: it is a resistor whose resistance changes with temperature, and the microcontroller has to read that change and do the math. Most of the parts on this page are a step up: they include a tiny chip and hand over a finished digital reading, so the microcontroller just asks and receives a number. The DHT and DS18B20 sensors speak a simple one-wire signal; the SHT31 and BME280 speak I²C, a small two-wire bus. Digital sensors are easier to trust because the conversion happens inside the part, away from electrical noise.

Compare the sensors.

The five you will actually meet, side by side. The tinted column is the value-for-accuracy pick. Notice the jump in accuracy from the DHT parts to the SHT31, and that the DS18B20 measures temperature only but survives places the others cannot.

Common temperature and humidity sensors · verified 2026-06-23; rated humidity 2026-11-23
Spec DHT11 DHT22 SHT31Accuracy pick BME280 DS18B20
Measures Temp + RH Temp + RH Temp + RH Temp + RH + pressure Temp only
Interface 1-wire digital 1-wire digital I²C I²C / SPI 1-wire (Dallas)
Temp accuracy ±2 °C ±0.5 °C ±0.3 °C ±1 °C ±0.5 °C
RH accuracy ±5 % ±2–5 % ±2 % ±3 % n/a
Temp range 0 to 50 °C −40 to 80 °C −40 to 125 °C −40 to 85 °C −55 to 125 °C
Rated humidity Not stated 0–100 % 0–100 % (best 20–80 %) 0–100 %, non-condensing n/a
Waterproof option No No No No Yes (probe)
Best for Toys, first tests Hobby and prototypes When accuracy matters Weather and air pressure Rugged or wet temperature

The DHT22 is also sold as the AM2302 (the same sensor on a small board). Accuracy figures are from the manufacturer datasheets and drift over time, especially the lower-cost humidity elements. For a fuller side-by-side including light and air sensors, see the sensor comparison. For the deep dive on one part, see the DHT22, BME280, SHT31, and DS18B20 pages.

In a fruiting room or other wet room.

A mushroom fruiting room sits near the top of the scale: UC Cooperative Extension gives oyster mushrooms 95% relative humidity while pins form and 85 to 92% while they crop (Cultivating Mushrooms on Small Farms, pages 29 and 34). The rated-humidity row above is each maker’s own figure. Here, what the makers add matters more than the range:

  • SHT31. Sensirion specifies it from 0 to 100% but says it performs best between 20 and 80%. Long exposure above 80% can temporarily offset the reading (its example: +3% after 60 hours above 80%), and the sensor slowly returns to calibration once conditions are back in range (SHT3x-DIS datasheet, version 7, December 2022).
  • BME280. Bosch Sensortec rates it 0 to 100%, for a non-condensing environment only (BME280 datasheet, revision 1.24, February 2024).
  • DHT22 (AM2302). Aosong gives an operating range of 0 to 100% (DHT22 datasheet; no version or date printed).
  • DHT11. Aosong’s manual states no humidity range. It says to avoid long-term condensation and that use outside the proposed range can make the signal drift (DHT11 product manual; no version or date printed).

This matters most for the SHT31, which stays the pick on this page for its accuracy. At 85 to 95% it runs above Sensirion’s best-performance band all the time, so plan for an offset like Sensirion’s example and check it against a reference now and then (Trust Your Gauge shows how). None of these ratings covers a part that is wet, so keep the sensor out of the path of the mist; that is our advice rather than a maker’s. The DS18B20 measures temperature only and comes as a sealed probe. The growing side is on the Mushrooms page.

Why both numbers matter (VPD).

Temperature and humidity are most useful together. Combined, they give vapor pressure deficit, a single number for how strongly the air pulls moisture out of a leaf. VPD predicts transpiration, stress, and disease pressure better than either reading alone, which is why a good temperature and humidity sensor is the foundation of climate control in a tunnel or a grow room. A sensor with honest accuracy on both numbers gives a VPD you can act on; a sloppy one does not.

Where they fit, and where they don’t.

Where they fit

  • Greenhouse, tunnel, and grow-room climate.
  • Feeding a VPD reading for climate control.
  • Low-cost, plentiful nodes where one odd reading is averaged out.
  • Waterproof temperature in soil or water (DS18B20).

Where they don’t

  • Audit-grade or compliance measurement without calibration.
  • Direct sun or rain, unless in a vented shield (or a sealed probe).
  • Fast-changing conditions; low-cost sensors respond slowly.
  • Humidity from a DS18B20: it measures temperature only.

Which to buy.

One rule covers most of it: if the number drives a decision, spend the few extra dollars on an SHT31. If it is for a rough sense of the room, a DHT22 is fine. And whatever you choose, read Trust Your Gauge before you rely on it.

Datasheets.

Straight from the makers; these open in a new tab:

Sensirion SHT31 Bosch BME280 Analog Devices DS18B20 Open Agriculture Technology sensor comparison

Frequently asked questions.

What is the best temperature and humidity sensor for a grower?

For readings you intend to act on, the SHT31 is the value pick: accurate to about a third of a degree and 2 percent humidity, for a few dollars. The DHT22 is fine for low-cost hobby use, and the DS18B20 is the choice for temperature in wet or rugged spots.

What is the difference between the DHT22 and the SHT31?

The SHT31 is noticeably more accurate (about plus or minus 0.3 degrees C and 2 percent humidity versus the DHT22 at 0.5 degrees and 2 to 5 percent), reads faster, and uses the I2C bus. The DHT22 costs less and uses a simple one-wire signal. Choose the SHT31 when the reading drives a decision.

What is VPD and why does it need both temperature and humidity?

VPD, or vapor pressure deficit, is how strongly the air pulls moisture from a leaf. It is calculated from temperature and humidity together, and it predicts transpiration and stress better than either alone. That is why a sensor that reads both, accurately, is the foundation of climate control.

Can temperature and humidity sensors be used outdoors or in water?

Most cannot be used directly. Common boards like the DHT22, SHT31, and BME280 are not weatherproof and need a vented radiation shield outdoors. For temperature in soil or water, use a DS18B20 in its sealed waterproof probe form, which is built for it.

Which humidity sensor works in a mushroom fruiting room?

Check each maker’s rating and its limits. Sensirion specifies the SHT31 from 0 to 100% relative humidity but says it performs best from 20 to 80%, and long exposure above 80% can offset the reading by a few percent until conditions return to normal. Bosch Sensortec rates the BME280 from 0 to 100%, non-condensing only. A fruiting room at 85 to 95% sits above the SHT31’s best band all the time, so check it against a reference now and then, and keep any sensor out of the mist.

What is the difference between I2C and one-wire sensors?

Both are digital, so the sensor sends a finished number. I2C is a small two-wire bus that lets several sensors share the same pair of pins, used by the SHT31 and BME280. The one-wire signal used by the DHT sensors and the DS18B20 is simpler but carries one sensor per pin in practice for the DHT parts.