Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Sensors & Modules

Best Humidity Sensors for IoT Projects: DHT22 vs SHT31 vs HTU21D

Best Humidity Sensors for IoT Projects: DHT22 vs SHT31 vs HTU21D

March 11, 2026 /Posted byJayesh Jain / 0

Table of Contents

  • Introduction
  • Why Humidity Sensing Matters in India
  • How Capacitive Humidity Sensors Work
  • DHT22 (AM2302): Overview & Specs
  • SHT31: Overview & Specs
  • HTU21D: Overview & Specs
  • Full Comparison Table
  • Wiring & Arduino Code for Each Sensor
  • Calculating Dew Point and Heat Index
  • IoT Use Cases for Indian Conditions
  • Buying Guide for India
  • Frequently Asked Questions
  • Conclusion

Introduction

Humidity monitoring is one of the most common requirements in IoT projects — from smart home weather stations and greenhouse automation to server room monitoring and food storage logistics. For makers and engineers in India, choosing the right humidity sensor means balancing accuracy, power consumption, interface complexity, and price. Three sensors dominate the market: the DHT22, the SHT31, and the HTU21D.

This guide gives you a complete, technically detailed comparison of all three, including wiring diagrams, working Arduino and ESP32 code, and a frank buying recommendation for different project types.

Why Humidity Sensing Matters in India

India’s climate presents some of the world’s most extreme humidity conditions. Mumbai and coastal cities experience relative humidity (RH) above 90% during monsoon. The Rajasthan desert drops to below 10% RH in summer. This 80+ percentage point swing means any humidity sensor used in India must have a wide operating range and ideally perform well across this entire span.

Key applications driving humidity sensor demand in India:

  • Agriculture: Greenhouse humidity control prevents fungal diseases in crops. Smart drip irrigation combined with humidity sensing saves water in drought-prone regions.
  • Warehousing: Pharmaceutical companies, electronics manufacturers, and food storage facilities must maintain specific humidity ranges (typically 40–60% RH) to prevent product spoilage or component corrosion.
  • HVAC: Air conditioning systems with humidity feedback loops are more efficient and comfortable than temperature-only control.
  • Server rooms & data centres: Server hardware is rated for 20–80% RH. High humidity causes corrosion; low humidity causes electrostatic discharge.
  • Textile mills: Maharashtra and Tamil Nadu’s textile industry requires precise humidity for yarn tensile strength and loom operation.

How Capacitive Humidity Sensors Work

All three sensors in this comparison use capacitive sensing. A thin polymer layer (the sensing element) absorbs water molecules from the surrounding air. As humidity rises, more water molecules enter the polymer, changing its dielectric constant. This changes the capacitance of a tiny capacitor formed between two electrodes with the polymer in between. An on-chip ADC measures this capacitance change and converts it to a humidity percentage.

Capacitive sensors are preferred over resistive humidity sensors because they:

  • Work across the full 0–100% RH range without saturation
  • Have lower drift over time
  • Are less susceptible to contamination from salt, chemicals, or condensation
  • Can fully recover after brief condensation events

DHT22 (AM2302): Overview & Specs

The DHT22 (also sold as AM2302) is the most widely used humidity sensor in the maker world. It is a digital sensor with a proprietary single-wire protocol and includes a resistive heating element to assist recovery from condensation. It has been the default choice for Arduino weather station projects for over a decade.

Key Specifications

Parameter DHT22
Humidity Range 0–100% RH
Humidity Accuracy ±2–5% RH (typical ±2%)
Temperature Range -40°C to +80°C
Temperature Accuracy ±0.5°C
Interface Single-wire (1-Wire proprietary)
Supply Voltage 3.3–6 V
Sampling Rate 1 reading every 2 seconds (minimum)
Response Time ~2 seconds (in airflow)
Current Draw 1–1.5 mA active, 50 µA standby
Price in India ₹120–₹250

DHT22 vs DHT11

The cheaper DHT11 (₹40–₹80) is often recommended for beginners, but its limitations are significant: humidity accuracy is only ±5%, range is 20–95% RH (no readings at low or high extremes), and temperature accuracy is ±2°C. For any real project beyond initial prototyping, DHT22 is worth the extra ₹80–₹150.

DHT11 Humidity Sensor

DHT11 Digital Humidity & Temperature Sensor Module

Start your humidity sensing journey with the DHT11 — great for learning the protocol before upgrading to the more accurate DHT22 for production projects.

View on Zbotic

SHT31: Overview & Specs

The SHT31 from Sensirion is a professional-grade humidity and temperature sensor in a tiny 2.5 × 2.5 mm DFN package. It communicates over I2C, offers fully calibrated digital output, and includes an on-chip heater for condensation recovery — without any external resistors or pull-ups required (the module handles this).

Key Specifications

Parameter SHT31
Humidity Range 0–100% RH
Humidity Accuracy ±2% RH (typical ±1.5% between 20–80% RH)
Temperature Range -40°C to +125°C
Temperature Accuracy ±0.3°C (typical)
Interface I2C (2 addresses: 0x44 or 0x45)
Supply Voltage 2.4–5.5 V
Sampling Rate Up to 10 readings/second
Response Time ~8 seconds (63% response in still air)
Current Draw 1.5 mA active, 0.3 µA sleep
On-chip heater Yes (clears condensation)
Price in India ₹400–₹700 (module)

The SHT31 has two configurable I2C addresses (by pulling the ADDR pin HIGH or LOW), allowing two sensors on the same bus — useful for differential humidity measurement (e.g., inside vs. outside a box).

HTU21D: Overview & Specs

The HTU21D from TE Connectivity (formerly Measurement Specialties) is a mid-range sensor that sits between DHT22 and SHT31 in accuracy and price. It communicates via I2C at a fixed address (0x40) and is well-suited for IoT nodes where moderate accuracy and low power are both required.

Key Specifications

Parameter HTU21D
Humidity Range 0–100% RH
Humidity Accuracy ±3% RH (±2% at 25°C, 50% RH)
Temperature Range -40°C to +125°C
Temperature Accuracy ±0.3°C
Interface I2C (fixed 0x40)
Supply Voltage 1.5–3.6 V (ideal for 3.3 V systems)
Sampling Rate Up to 4 readings/second
Current Draw 0.5 mA active, 0.02 µA sleep
Price in India ₹250–₹450 (module)

The HTU21D’s sleep current of 20 nA makes it the best choice for battery-powered IoT nodes that wake up, take a reading, and go back to sleep. A coin cell battery can power an HTU21D node for months.

Full Comparison Table

Feature DHT22 SHT31 HTU21D
RH Accuracy ±2–5% ±2% (±1.5% typical) ±2–3%
Temp Accuracy ±0.5°C ±0.3°C ±0.3°C
Interface 1-Wire proprietary I2C I2C
Sample Rate 0.5 Hz (1/2s) 10 Hz 4 Hz
Sleep Current 50 µA 0.3 µA 0.02 µA
Multi-sensor/bus 1 per pin 2 per bus 1 per bus
3.3V friendly Yes (with care) Yes (native) Yes (native)
On-chip heater No Yes Yes
Library quality DHT library (Arduino) Adafruit SHT31 Adafruit HTU21DF
Price (India) ₹120–₹250 ₹400–₹700 ₹250–₹450
Best for Beginners, indoor stations Industrial, high-accuracy Battery IoT nodes

Wiring & Arduino Code for Each Sensor

DHT22 Wiring (Arduino Uno)

DHT22 Pin Arduino
VCC 5V
GND GND
DATA D2 + 10kΩ pull-up to 5V
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  delay(2000); // DHT22 needs 2s between readings
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  if (isnan(h) || isnan(t)) {
    Serial.println("DHT22 read error!");
    return;
  }
  Serial.print("RH: "); Serial.print(h); Serial.print("%  ");
  Serial.print("Temp: "); Serial.print(t); Serial.println(" C");
}

SHT31 Wiring (Arduino Uno)

SHT31 Pin Arduino
VIN 5V (or 3.3V)
GND GND
SDA A4
SCL A5
#include <Wire.h>
#include <Adafruit_SHT31.h>

Adafruit_SHT31 sht31 = Adafruit_SHT31();

void setup() {
  Serial.begin(9600);
  if (!sht31.begin(0x44)) {
    Serial.println("SHT31 not found!");
    while (1);
  }
}

void loop() {
  float t = sht31.readTemperature();
  float h = sht31.readHumidity();
  if (!isnan(t) && !isnan(h)) {
    Serial.print("RH: "); Serial.print(h, 1); Serial.print("%  ");
    Serial.print("Temp: "); Serial.print(t, 2); Serial.println(" C");
  }
  delay(1000);
}

HTU21D Wiring (same as SHT31: SDA → A4, SCL → A5)

#include <Wire.h>
#include <Adafruit_HTU21DF.h>

Adafruit_HTU21DF htu;

void setup() {
  Serial.begin(9600);
  if (!htu.begin()) {
    Serial.println("HTU21D not found!");
    while (1);
  }
}

void loop() {
  float h = htu.readHumidity();
  float t = htu.readTemperature();
  Serial.print("RH: "); Serial.print(h, 1); Serial.print("%  ");
  Serial.print("Temp: "); Serial.print(t, 2); Serial.println(" C");
  delay(500);
}

Calculating Dew Point and Heat Index

Once you have temperature and humidity readings, you can calculate two important derived quantities:

Dew Point

Dew point is the temperature at which moisture in the air starts condensing on surfaces. Critical for HVAC design and condensation prevention in electronics enclosures.

// Magnus formula for dew point
float dewPoint(float T, float RH) {
  float a = 17.27, b = 237.7;
  float alpha = ((a * T) / (b + T)) + log(RH / 100.0);
  return (b * alpha) / (a - alpha);
}

Heat Index (Feels-Like Temperature)

The Steadman heat index formula combines temperature and humidity into a “feels like” temperature that reflects human thermal comfort — highly relevant for outdoor IoT weather stations in India’s humid summer.

// Simplified heat index (Rothfusz regression, Celsius)
float heatIndex(float T, float RH) {
  float hi = -8.78469475556 + 1.61139411*T + 2.33854883889*RH
             - 0.14611605*T*RH - 0.012308094*T*T
             - 0.016424828*RH*RH + 0.002211732*T*T*RH
             + 0.00072546*T*RH*RH - 0.000003582*T*T*RH*RH;
  return hi;
}

IoT Use Cases for Indian Conditions

Smart Greenhouse Automation

A network of SHT31 sensors distributed across a greenhouse provides spatial humidity mapping. Areas with higher humidity (near water tanks or drip lines) can be identified and ventilation adjusted selectively. Pair with a relay module to control exhaust fans automatically when humidity exceeds 80% RH.

Cold Chain Monitoring

Pharmaceutical distributors and food companies in India must maintain documented temperature and humidity logs for their supply chains. A low-power HTU21D on an ESP8266 with a deep-sleep duty cycle of 5 minutes can run for 6+ months on a LiPo battery, logging data to a cloud dashboard via Wi-Fi.

Heritage Site Conservation

Indian museums and heritage buildings (wooden structures, textile archives) need precise humidity control to prevent wood swelling or cotton degradation. A mesh of SHT31 sensors with differential monitoring (inside vs outside a display case) is a professional-grade solution.

DHT20 Sensor

DHT20 SIP Packaged Temperature & Humidity Sensor

The upgraded DHT20 uses I2C instead of single-wire protocol, with improved accuracy vs DHT11/22 and a compact SIP package perfect for IoT board integration.

View on Zbotic

BME280 Sensor

GY-BME280-5V Temperature, Humidity & Pressure Sensor

The BME280 adds barometric pressure to temperature and humidity — a complete environmental sensor in one module. Ideal for weather station IoT projects.

View on Zbotic

Buying Guide for India

For Beginners

Start with the DHT22. It is inexpensive, has the largest community of tutorials in Hindi and English, and works with the well-documented DHT Arduino library. Its ±2% accuracy is sufficient for most first projects. Buy the module version (with PCB, LED, and decoupling capacitor) rather than the bare sensor for easier breadboard use.

For Battery-Powered IoT Nodes

Choose the HTU21D. Its 20 nA sleep current is 2,500× lower than DHT22’s standby current. For a node that wakes every 5 minutes for 1 second of measurement, the HTU21D consumes less than 0.1 mAh per day — a 1000 mAh LiPo lasts over 27 years theoretically (limited by self-discharge in practice to ~2 years).

For Industrial or Commercial Projects

Invest in the SHT31. The ±0.3°C temperature accuracy, on-chip heater, and two addressable I2C instances justify the higher cost. Sensirion’s calibration certificates and NIST-traceable accuracy make the SHT31 suitable for regulated applications (pharmaceutical, food safety).

When Budget Allows: BME280

The Bosch BME280 adds barometric pressure sensing to humidity and temperature — all in one I2C chip. For weather station and altitude-compensation projects, it is the best value all-in-one environmental sensor available in India.

Frequently Asked Questions

Q1: Can DHT22 work reliably outdoors in Indian monsoon (>90% RH)?

Yes, but protect it from direct rain. The DHT22 is rated to 100% RH but contact with liquid water damages the sensor. Use it inside a vented, weatherproof enclosure (like a louvred Stevenson screen). SHT31 handles condensation better due to its on-chip heater.

Q2: Why does my DHT22 return NaN readings intermittently?

The most common cause is insufficient pull-up resistance on the DATA line (should be 10 kΩ) or wire length over 20 cm causing signal degradation. Also, DHT22 requires at least 2 seconds between readings — reading faster causes errors. Check all three factors.

Q3: Is the SHT31 worth the extra cost over DHT22 for a home weather station?

If you are comparing readings with a reference standard or logging data for analysis, yes. For a simple home display showing today’s humidity, DHT22’s ±2% is probably sufficient and saves ₹300–₹400 per node.

Q4: Can I use multiple DHT22 sensors with one Arduino?

Yes — each DHT22 needs its own digital pin and 10 kΩ pull-up. On Arduino Uno, you can comfortably run 5–6 DHT22 sensors on separate digital pins. Space your readings across different pins (read sensor 1, wait 2 sec, read sensor 2, etc. — or stagger them).

Q5: How do I reduce humidity sensor self-heating errors?

Sensors mounted inside a compact enclosure heat up from nearby components (microcontroller, Wi-Fi module), causing the sensor to read lower humidity than ambient (hot air holds less moisture). Always place the humidity sensor on the outside of the main enclosure, or use an extension cable to move it away from heat sources.

Conclusion

Choosing the best humidity sensor for your IoT project in India comes down to three questions: How accurate do you need to be? How much power can you spare? How much can you spend? The DHT22 answers the beginner’s needs perfectly at low cost. The HTU21D excels in battery-powered applications. The SHT31 is the professional’s choice for high-accuracy or industrial deployment.

All three sensors are available in India at competitive prices. Whether you are building a smart greenhouse in Maharashtra, a cold chain monitor in a Delhi warehouse, or a classroom weather station project, Zbotic has the sensors and modules you need to get started today.

Shop Humidity & Temperature Sensors at Zbotic

Tags: DHT22, HTU21D, humidity sensor, iot india, SHT31
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Digital Potentiometer MCP4131:...
blog digital potentiometer mcp4131 software controlled resistance 596580
blog sim800l vs sim7600 gsm vs 4g lte module comparison india 596586
SIM800L vs SIM7600: GSM vs 4G ...

Related posts

Svg%3E
Read more

Encoder Module: Position and Speed Measurement with Arduino

April 1, 2026 0
A rotary encoder converts the angular position and rotation speed of a shaft into electrical signals that Arduino can count... Continue reading
Svg%3E
Read more

Infrared Obstacle Sensor: Line Follower and Object Detection

April 1, 2026 0
Infrared obstacle sensors are the building blocks of line-following robots, edge detection systems, and proximity triggers. These tiny modules emit... Continue reading
Svg%3E
Read more

Rain Sensor and Raindrop Detection Module: Arduino Guide

April 1, 2026 0
A rain sensor module detects the presence of water droplets on its surface, giving Arduino a simple signal to trigger... Continue reading
Svg%3E
Read more

LiDAR Sensor TFmini: Distance Measurement Beyond Ultrasonic

April 1, 2026 0
When ultrasonic sensors hit their limits — range too short, accuracy too coarse, outdoor sunlight causing interference — LiDAR sensors... Continue reading
Svg%3E
Read more

Pressure Sensor BMP280: Weather Station and Altitude Meter

April 1, 2026 0
The BMP280 barometric pressure sensor by Bosch measures atmospheric pressure with ±1 hPa accuracy and temperature with ±1°C precision. These... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now