Quick sensor chooser: which family fits your project?
Start with the measurement you need, then match the sensor family to cable length, environment, and long-term stability.
| Project need |
Best-fit family on this page |
Key reason |
Trade-off to know |
Example products from the grid |
| Learning or demo build |
DHT11 |
Cheapest way to try a digital temperature humidity sensor and simple code |
DHT11 is mainly for demos and first projects; it is ±2 °C, limited to 0–50 °C, refreshes at 1 Hz, and is only roughly $1 cheaper than DHT22 |
DHT11 module, ASAIR DHT11 sensor |
| Low-cost room temperature + humidity |
DHT22 / AM2302 |
DHT22 is the common low-cost answer when you need both temperature and humidity |
It should be polled only every 2 s, is not true Dallas 1-Wire, and is less stable long-term than SHT or BME-class parts |
DHT22/AM2302 sensor, AOSONG DHT22 with 4 pins, AM2302 DHT22 with 20m transmission |
| Permanent Home Assistant or ESPHome node |
SHT31 / SHT35 / AHT25 / HTU21D |
Better agreement and stability than DHT22 for long-term indoor monitoring |
I2C is a short-run bus, so sensor placement needs to stay close to the controller |
SHT35 with 90° soldered header, AHT25 precision sensor, SHT31 with right-angle header, HTU21D module with pull-ups |
| Pipes, fridges, CPUs, liquids, or any job where humidity is not needed |
DS18B20 |
Temperature-only is the better choice here; DS18B20 covers −55…125 °C, supports multiple sensors on one 1-Wire pin, and suits long cable runs |
No humidity reading, and bare parts need a pull-up resistor |
DS18B20 waterproof probe, 1m, DS18B20 TO-92 sensor, DS18B20 breakout module |
| Weather, pressure, or altitude logging |
BME280 / BME680 |
Adds atmospheric pressure, and BME680 also adds VOC detection |
If you specifically need pressure or altitude data, compare the dedicated options in pressure and altitude sensors rather than humidity-only parts |
GY-BME280 3-in-1 module, MCU-680 BME680 with VOC detection |
| Non-contact surface readings |
MLX90614 IR sensors |
Reads object surface temperature without touching the target |
It reads the average temperature inside its field of view, so shiny metal and small distant targets are poor fits |
MLX90614 non-contact infrared sensor, GY-906-BAA medical-calibrated module, GY-906-BCC 35° FOV version |
| Above 125 °C |
Thermocouple interface modules |
DS18B20 stops at 125 °C, so ovens, kilns, and exhaust need a different sensor class |
No humidity, and more wiring than room-temperature modules |
MAX6675 K-type thermocouple module |
For a first real install, DHT22 is the low-cost baseline, but DHT11 remains a learning part rather than the default choice. If your project sits outside humidity modules, see broader temperature sensor options for Arduino and similar builds for analog, IR, and high-heat alternatives.
Decision table: accuracy, cable length, and bus type for temperature and humidity sensors at a glance
This environmental sensor module comparison is about practical fit: how accurate the family is, how far it can sit from the MCU, and which wiring limit matters first.
| Family / example |
Measures |
Typical accuracy stated here |
Practical cable length |
Multi-sensor capability |
Wiring / logic gotcha |
| DHT11 |
Temperature + humidity |
About ±2 °C; humidity class around 5% RH; 1 Hz refresh |
Short runs are safest |
Generally one sensor per pin |
Bare parts need a 4.7 kΩ to 10 kΩ pull-up resistor; many 3-pin modules include it |
| DHT22 / AM2302 |
Temperature + humidity |
±0.5 °C temperature; DHT22 family is the low-cost step up from DHT11 |
About 1 m at 3.3 V, up to about 20–30 m at 5 V with a stronger pull-up; the AM2302 DHT22 with 20 m transmission is the long-run version here |
Not Dallas 1-Wire; usually one sensor per pin |
Poll only once per 2 s, and a 5 V-powered DHT can put 5 V on the data line, which is not safe for 3.3 V-only GPIO on ESP32 boards or Raspberry Pi |
| DS18B20 |
Temperature only |
Varies by resolution setting; conversion time is 750 ms at 12-bit |
Tens of meters on a 1-Wire bus |
Yes; each sensor has a unique 64-bit address |
True Dallas 1-Wire; bare parts need a 4.7 kΩ to 10 kΩ pull-up resistor, while module versions simplify wiring |
| SHT / HTU / AHT I2C parts |
Temperature + humidity |
Premium class is around ±0.1–0.3 °C and ±1.5–2% RH; the SHT35 module is ±0.2 °C and ±1.5% RH, and the AHT25 module is ±0.3 °C and ±2% RH |
Ideally under 1 m |
Limited by I2C addresses |
The HTU21D module includes built-in 4.7k pull-up resistors and runs at 3 V |
| BME280 / BME680 I2C or SPI |
Temperature + humidity + pressure, plus VOC on BME680 |
Good step-up for permanent monitoring |
Ideally under 1 m on I2C |
Identical devices are limited to 0x76 and 0x77 unless you add a multiplexer |
Check addressing before multi-room plans; for pressure + humidity wiring details, see how to wire and verify a BME280 including its address |
| Analog temperature sensors |
Temperature only |
Example: LM75 shows 0.125 °C resolution, but that is not the same as ±0.125 °C accuracy |
Usually local to the controller |
Depends on part |
The LM75 temperature module supports 8 devices per bus via 7 selectable addresses; analog parts such as TMP36 need an ADC instead of a digital bus |
If you need several identical SHT31 devices, both the SHT31 DIS module and the protected SHT31 version offer two user-selectable I2C addresses. That is enough for a pair, but not a whole multi-room bus without extra hardware.
Environment fit: where humidity sensors fail and where probe sensors win
Environment matters more than the headline spec. Condensation and mounting errors ruin more installs than raw accuracy does.
For immersion, only a waterproof-probe DS18B20 is the right fit here. A DS18B20 waterproof probe with 1 m cable uses a stainless steel probe and is the suitable option for liquids; humidity sensors are not immersion sensors.
For fridge and freezer logging, the reliable pattern is probe inside, electronics outside. Keep the sensing tip in the cold space while the board and connections stay dry and accessible. A waterproof DS18B20 probe is a better choice than a combined humidity sensor, especially if you plan alarms or logging with Raspberry Pi boards.
For pipes, liquids, and cold spaces, DS18B20 is the robust route because it is temperature-only, covers a wider range, and is available as a sealed probe. If you need help with remote mounting, see using a waterproof DS18B20 probe for remote temperature logging.
For greenhouses, grow tents, incubators, and terrariums, prolonged 95–100% RH and condensation degrade capacitive humidity elements and can kill readings until the sensor dries. Even the HTU21D I2C module notes that full drops of water can damage the sensor.
For outdoor humidity monitoring, use a vented radiation shield or Stevenson-screen style mount, not a sealed waterproof box. Humidity sensors need airflow, and direct sun can add about 15 °C without shielding.
If you need a humidity sensor in dusty or high-humidity embedded equipment, the SHT31 with IP67 protective film is the better-protected option here. Its IP67 dust-proof protective film and auto-calibration help in embedded use, but it is still not an immersion sensor.
For non-contact surface checks, an MLX90614 infrared sensor reads the average temperature of everything inside its field of view. Shiny metal is a poor target because low-emissivity surfaces reflect ambient IR, and below about 0.1 emissivity, correction is impractical.
Common buying mistakes that change which sensor you should buy
Choosing a dht11 sensor module for a permanent install creates disappointment later. It is the budget learning option, but DHT22 is the minimum sensible step for real ambient monitoring.
Reading “0.125 °C resolution” as “0.125 °C accuracy” leads to the wrong purchase. Resolution is only display step size; for example, LM75 can show 0.125 °C steps while only being ±2 °C accurate.
Expecting two low-cost sensors with the same ±0.5 °C spec to match exactly is risky. Unit-to-unit spread of more than 1 °C and several % RH is common enough that critical builds should allow for comparison or calibration.
Planning a multi-sensor bus around dht22 temperature humidity parts causes wiring dead ends. DHT22 / AM2302 is not compatible with Dallas 1-Wire.
Buying a “BME280” only because you need pressure and humidity can backfire, because some cheap modules are really BMP280 with no humidity sensing. If humidity matters, verify the chip ID: 0x58 points to BMP280 and 0x60 to BME280. This matters when you need both humidity and pressure, not just pressure alone, so compare pressure and altitude sensors if that is the main requirement.
Using a YL-69 soil moisture sensor or the YL-69 relay version for a permanent plant install is a common cross-category mistake. Resistive probes like YL-69 can corrode in weeks in moist soil; capacitive probes are the better long-term choice.
Buying an MLX90614 for fever-style measurements without checking the variant leads to wrong expectations. Wide-field or standard variants can disappoint for body temperature because they read surface temperature, not core temperature.
Using the XH-W1209 thermostat module as if the onboard relay were a no-questions-asked mains switch is a safety mistake. The relay is marked 10 A / 250 VAC, but high mains loads are better handled with an external relay or contactor, and the module itself needs a 12 V DC supply.
If you still want the simplest low-cost DHT route after those trade-offs, basic DHT22 wiring for a starter build is the best starting point.
Reference matrix: temperature and humidity sensor products in this category by interface and best-fit use
| Product name |
Measures |
Interface |
Accuracy / key spec from card |
Voltage / bus note |
Best fit |
| DS18B20 waterproof probe, 1m |
Temperature |
Dallas 1-Wire |
12-bit output resolution; stainless steel waterproof probe; 1-meter cable |
1-Wire probe format |
Remote or wet temperature sensing in liquids, pipes, and fridges |
| DS18B20 TO-92 sensor |
Temperature |
Dallas 1-Wire |
Unique 64-bit serial code; selectable 9 to 12-bit resolution; parasite power support |
Requires a 4.7 kΩ resistor on the data line |
Multi-sensor 1-Wire builds on one pin |
| DS18B20 breakout module |
Temperature |
Dallas 1-Wire |
20x13 mm module form factor; unique sensor ID; selectable resolution |
Header-friendly breakout |
Easier wiring than a bare TO-92 part |
| DHT22/AM2302 sensor |
Temperature + humidity |
DHT single-wire |
±0.5 °C temperature accuracy; single-wire output; calibrated data in internal memory |
Not compatible with Dallas One Wire; avoid high humidity and strong light |
Low-cost ambient temp+humidity monitoring |
| AM2302 DHT22 with 20m transmission |
Temperature + humidity |
Single-bus digital |
20-meter signal transmission distance; automatic calibration |
3-lead module format |
Longer-cable DHT-style installs |
| ASAIR DHT21/AM2301 with 20m transmission |
Temperature + humidity |
Single-bus digital |
20-meter transmission; 25 cm wire lead; polymer capacitive humidity sensing |
Wired module style |
Alternative long-run humidity sensing |
| HTU21D module with I2C and pull-ups |
Temperature + humidity |
I2C |
Built-in 4.7k pull-up resistors; low sleep current |
3 V working voltage |
3 V-friendly I2C environmental nodes |
| SHT20 with right-angle header |
Temperature + humidity |
I2C |
Capacitive humidity sensing; right-angle pre-soldered header |
1.5 V to 3.6 V supply range |
Low-voltage I2C designs |
| SHT30 digital sensor |
Temperature + humidity |
I2C |
±0.3 °C temperature accuracy |
2.4 V to 5.5 V supply |
Accurate wide-voltage humidity module |
| SHT31 with right-angle header |
Temperature + humidity |
I2C |
±0.2 °C accuracy; 17x12 mm board |
Compact module with pre-soldered header |
Space-constrained accurate builds |
| SHT31 with IP67 protective film |
Temperature + humidity |
I2C |
IP67 protective film; auto-calibration; ±0.2 °C accuracy |
Two user-selectable I2C addresses |
Protected high-humidity embedded use |
| SHT35 with 90° soldered header |
Temperature + humidity |
I2C |
±1.5% humidity accuracy; ±0.2 °C temperature accuracy |
Pre-soldered I2C module |
Highest-accuracy humidity option in this range |
| AHT25 precision sensor |
Temperature + humidity |
I²C |
±0.3 °C temperature accuracy; ±2% RH humidity accuracy |
2.2 V to 5.5 V DC supply |
Premium I2C alternative for HVAC and IoT |
| GY-BME280 3-in-1 module |
Temperature + humidity + pressure |
I2C or SPI |
Combined atmospheric pressure, humidity, and temperature sensing |
1.8 to 5 V supply |
Weather, barometric, and altitude-related projects |
| MCU-680 BME680 with VOC detection |
Temperature + humidity + pressure + VOC |
I2C or SPI |
Adds VOC gas detection |
Dual-bus environmental module |
4-in-1 air-quality and environment logging |
| MLX90614 non-contact infrared sensor |
Non-contact temperature |
SMBus and PWM |
17-bit ADC with integrated DSP; reads average temperature across its field of view |
IR sensor family, not contact probe |
General non-contact object temperature measurement |
| GY-906-BAA medical-calibrated MLX90614 |
Non-contact temperature |
IR module output |
2 cm sensing distance; 10k pull-ups with optional jumpers; medical accuracy calibration at 0.5 °C |
Module format with configurable pull-ups |
Close-range body or surface temperature checks |
| GY-906-BCC 35° FOV MLX90614 |
Non-contact temperature |
I2C |
35° field of view; thermal gradient compensation |
5 VDC input |
Object-size and field-of-view-sensitive installs |
| TMP36 analog temperature sensor |
Temperature |
Analog |
10 mV/°C; ±2 °C accuracy |
2.7 V to 5.5 V supply; needs ADC |
Simple analog temperature measurement |
| LM75 temperature module with 8 slave addresses |
Temperature |
I2C |
0.125 °C resolution; supports 8 devices per bus via 7 selectable addresses |
Multi-device I2C temperature option |
Temp-only I2C networks |
| MAX6675 K-type thermocouple module |
High temperature |
SPI |
0 to 1024 °C range; cold-junction compensation; break detection circuitry |
Thermocouple interface |
Over-125 °C measurement |
For compact Wi‑Fi monitoring nodes, I2C parts such as SHT31, HTU21D, and BME280 pair naturally with ESP8266 boards. If you want a premium humidity node and need a wiring example first, see example wiring for an SHT31 I2C environmental sensor.
FAQs on Temperature & Humidity Sensors
Is DHT22 the same as AM2302?
Yes — AM2302 is the DHT22 in a wired or cased variant, and listings usually differ more by package style and whether a pull-up is built in than by sensing function. If you are comparing DHT22 family parts, focus on form factor, cable length, and whether you want a bare sensor or a module.
Do I need a pull-up resistor for these sensors?
Bare DHT and DS18B20 parts usually need a 4.7–10 kΩ pull-up resistor on the data line, while many 3-pin modules already include it on-board. The main buying decision is whether you want the lower-cost bare sensor or the easier-wiring module version.
Can I run several sensors from one pin or one bus?
DS18B20 can share one Dallas 1-Wire bus because each sensor has a unique 64-bit address, while DHT sensors usually need one sensor per pin and identical I2C sensors are often limited to addresses 0x76 and 0x77 unless you add a multiplexer. That makes DS18B20 the practical choice for multi-point temperature monitoring.
Why do two temperature and humidity sensors show different readings?
Unit-to-unit spread of more than 1 °C and several % RH is common on cheap sensors, and placement, self-heating, and calibration all affect the result. If the reading drives an important alarm or control action, choose a tighter-tolerance SHT or AHT-class part and avoid mounting sensors near warm electronics.
Will these sensors work with ESP32, ESP8266, Arduino, or Raspberry Pi?
DHT22, DS18B20, BME280, and SHT3x or HTU21D-class sensors are commonly used with Arduino, ESP32, and ESP8266, and they also fit Raspberry Pi projects with the right wiring. The main voltage caveat is that a 5 V data line should not be fed directly into 3.3 V-only GPIO on ESP32 or Raspberry Pi.
Can a humidity sensor be used outdoors or in a terrarium?
Only with airflow and protection: humidity sensors drift or fail under condensation and prolonged 95–100% RH, so outdoor installs need a vented radiation shield and terrarium or greenhouse setups need protection from direct wetting. A sealed waterproof box is the wrong enclosure for humidity measurement.
Can MLX90614 measure body temperature accurately?
MLX90614 reads surface temperature, not core body temperature, and even the medical-calibrated variant still depends on distance, field of view, and room conditions. It is more suitable for close-range forehead or object-surface checks than for clinical core-temperature assumptions.
Glossary
- Relative humidity (RH)
- The percentage of moisture in the air relative to the maximum the air could hold at that temperature, which is why humidity readings change with temperature.
- Accuracy vs resolution
- Accuracy is how close a sensor can be to the true value, while resolution is only the smallest step it can display or report.
- Dallas 1-Wire
- A bus protocol used by DS18B20 sensors that lets many devices share one data line because each sensor has its own unique address.
- Pull-up resistor
- A resistor that holds the data line high so sensors such as DHT and DS18B20 can communicate reliably; missing it is a common reason for failed reads.
- Condensation / dew point
- The point where moisture in air turns to liquid on surfaces, which is why fridges, terrariums, and sealed outdoor boxes can upset or damage humidity sensors.
- Field of view (FOV)
- The cone an infrared sensor sees, which determines how much of the target fills the measurement and whether background surfaces affect the reading.
Please complete your information below to login.
Sign In
Create New Account