Skip to Content

Temperature And Humidity Sensor GY-21 HTU21 SHT21

The SHT21 sensor is a high-precision solution for temperature and humidity measurement. This compact module is designed for seamless integration into a variety of applications such as thermostats, indoor weather monitors, and humidity control systems. It uses the I2C communication protocol, making it compatible with platforms like Arduino and Raspberry Pi.

Package Includes:

  • 1x SHT21 Temperature Sensor Module

34.65 AED 34.65 AED Tax Included
34.65 AED Tax Included

Not Available For Sale

This combination does not exist.

Digital Temperature Sensor

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

Features:

  • High Precision: Offers accurate measurement of temperature and humidity.
  • I2C Communication: Supports direct data reading via the I2C protocol.
  • Versatile Integration: Suitable for thermostats, weather stations, and more.
  • Wide Humidity Range: 0% to 100% RH.
  • Extended Temperature Range: -40°C to 125°C.
  • Accuracy: ±2% RH, ±0.3°C in the 0°C to 70°C range.
  • Resolution Options: Adjustable precision for different applications.
  • Compact Size: 21mm x 16mm for easy integration.
  • Power Efficiency: Low current consumption, ideal for battery-powered devices.
  • Enhanced Precision Mode: Higher resolution with longer measurement times.
  • Integrated IC: Built around the SHT21 chip for consistent performance.

 

Principle of Work:

The SHT21 sensor uses a capacitive sensor for humidity and a band gap sensor for temperature. These analog signals are converted via a 14-bit ADC and communicated digitally over I2C. I2C enables simple two-wire communication (SDA & SCL) and supports multiple devices, multi-master configurations, and open-drain signaling for low power and noise immunity.

Pinout of the Board:

SHT21 pinout

Pin Name Function
VCC Power supply pin (+)
GND Ground pin (-)
SCL Serial Clock (I2C)
SDA Serial Data (I2C)

Applications:

  1. Weather Stations: Accurate environmental monitoring.
  2. HVAC Systems: Control indoor air quality.
  3. Industrial Automation: Maintain factory conditions.
  4. Agriculture: Optimize greenhouses and storage environments.
  5. Food and Beverage: Ensure quality during storage.
  6. Medical Devices: Support sensitive applications like incubators.
  7. Data Centers: Prevent overheating and improve efficiency.
  8. Automotive: Monitor cabin climate.
  9. Consumer Electronics: Smart home and wearable integration.
  10. R&D: Accurate measurements for experimental setups.
  11. Energy Efficiency: Optimize building energy use.
  12. Environmental Monitoring: Study ecosystems and climate.

Circuit Diagram:

Connect the SHT21 sensor to an Arduino UNO as follows:

  • VCC → 3.3V
  • GND → GND
  • SDA → A4
  • SCL → A5

SHT21 circuit

Library Installation:

  1. Download the SHT21 Arduino library.
  2. Open Arduino IDE.
  3. Go to Sketch > Include Library > Add .ZIP Library.
  4. Select the downloaded .ZIP file.
  5. Verify it appears under Sketch > Include Library.

Example Code:

#include "SHT21.h"
SHT21 sht;
float temperature;
float humidity;

void setup() {
  Wire.begin();
  Serial.begin(9600);
  Serial.println("SHT21 Sensor Data:");
}

void loop() {
  temperature = sht.getTemperature();
  humidity = sht.getHumidity();

  if (isnan(temperature) || isnan(humidity)) {
    Serial.println("Error reading data from sensor");
    return;
  }

  Serial.print("Temperature: ");
  Serial.print(temperature, 2);
  Serial.print(" °C\t");

  Serial.print("Humidity: ");
  Serial.print(humidity, 2);
  Serial.println(" %");

  delay(2000);
}

Technical Details:

  • IC: SHT21
  • Operating Voltage: 3V – 5V DC
  • Current Consumption: 150mA
  • Humidity Range: 0% – 100% RH
  • Temperature Range: -40°C – 125°C
  • Accuracy: ±2% RH, ±0.3°C
  • Resolution: 0.04% RH, 0.01°C (Max)
  • Module Size: 21mm x 16mm

Resources:

Comparison with Other Modules:

Feature SHT21 DHT11 LM75
Temperature Accuracy ±0.3°C ±2°C ±2°C
Humidity Accuracy ±2% RH ±5% RH
Humidity Range 0–100% RH 20–80% RH
Temp Range -40°C to 125°C 0°C to 50°C -55°C to 125°C
Interface I2C Single-Wire I2C
Measures Humidity Yes Yes No
Use Case Precision sensing, indoor climate Basic monitoring Temp-only, industrial