Humidity measurement is essential in many electronics projects, including weather stations, indoor climate monitoring, greenhouse control and industrial applications. While many temperature sensors also provide humidity readings, not all sensors deliver the same level of accuracy and stability.
This article compares the most common humidity sensor families used in Arduino and ESP32 projects, including DHT, AHT, SHT and HDC1080.
How Humidity Sensors Work
Most modern humidity sensors are based on capacitive measurement. They detect changes in capacitance caused by moisture in the air.
Higher humidity changes the dielectric properties of the sensor material
This change is converted into a digital value
Temperature compensation is usually built into the sensor
Because humidity measurement is sensitive to environmental conditions, calibration and sensor quality are very important.
SHT sensors from Sensirion are known for high accuracy and excellent long-term stability.
Advantages:
Very high precision
Excellent repeatability
Reliable calibration
Typical use cases:
Weather stations
Indoor climate monitoring
Industrial and laboratory environments
HDC1080: A Strong Alternative
Interface: I2C
Humidity accuracy: typically ±2%
Low power consumption
The HDC1080 from Texas Instruments is another reliable humidity sensor, offering good accuracy and very low power consumption.
It is particularly useful in battery-powered applications where energy efficiency is critical.
Comparison Overview
Sensor
Interface
Accuracy
Speed
Stability
Recommendation
DHT11
Custom
Low
Very slow
Poor
Avoid
DHT22
Custom
Moderate
Slow
Moderate
Legacy use
AHT20/21/25
I2C
Good
Fast
Good
Best value
SHT30/40
I2C
Very high
Fast
Excellent
Precision applications
HDC1080
I2C
Good
Fast
Good
Low-power projects
Environmental Factors
Humidity sensors are sensitive to environmental conditions:
Condensation can damage sensors
Dust and chemicals affect accuracy
Long-term exposure can cause drift
Proper placement and occasional recalibration improve reliability.
Power and Integration
Most sensors operate at 3.3V
I2C sensors require pull-up resistors
Keep wiring short for best accuracy
Practical Recommendations
Use AHT20 or AHT21 for general-purpose projects
Use SHT30 or SHT40 when accuracy matters
Use HDC1080 for low-power designs
Avoid DHT sensors in new designs
Conclusion
Humidity measurement requires stable and well-calibrated sensors. While DHT sensors are still common, modern I2C-based sensors such as AHT and SHT provide significantly better performance and reliability.
For most applications, AHT sensors offer the best balance between cost and performance, while SHT sensors are the preferred choice for precision systems.