SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor

SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor image

View on Amazon

Overview

The SHT21, HTU21, GY-21, and SI7021 sensors utilize I2C for reliable communication and provide calibrated, linearized temperature and humidity readings. Their compact form factor and low power consumption make them ideal for precise environmental monitoring.

About SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor

The SHT21, HTU21, GY-21, and SI7021 are compact digital temperature and humidity sensors that provide high-precision measurements. Using the I²C communication protocol, they are ideal for HVAC systems, data loggers, weather stations, and consumer electronics.

Key Features

  • High Accuracy & Stability – Reliable temperature and humidity sensing.
  • I²C Communication – Easy integration with ESP32, Arduino, and other microcontrollers.
  • Compact & Energy-Efficient – Ideal for low-power and battery-powered applications.
  • Versatile Applications – Used in climate control, weather monitoring, and industrial automation.

🔗 Looking for alternatives in the SHT series? Check out:

  • SHT20 – Cost-effective option.
  • SHT25 – Improved accuracy.
  • SHT30 – Enhanced performance and additional features.
Where to Buy

Get Your SHT21 / HTU21 / GY-21 / SI7021

SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor

Starting from

$5 per unit

Amazon com
Amazon.com Ships worldwide
Amazon de
Amazon.de Ships to EU
Aliexpress
AliExpress Best value option

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specs

SHT21 / HTU21 / GY-21 / SI7021 Specifications

Complete technical specification details for SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor

📊 Technical Parameters

Operating Voltage 2.1V to 3.6V
Temperature Range -40°C to 125°C
Humidity Range 0% to 100% RH
Temperature Accuracy ±0.3°C
Humidity Accuracy ±2% RH
Interface I2C
Dimensions 3mm x 3mm x 1.1mm
Pin Configuration

SHT21 / HTU21 / GY-21 / SI7021 Pinout

The SHT21/HTU21/GY-21/SI7021 sensors use standard I²C communication with 4 pins.

Visual Pinout Diagram

Pinout Diagram Primary
SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor pinout
4
Total Pins

Pin Types

Power
2
Communication
2

Quick Tips

🔌

Standard I²C interface for easy integration,📡 Default I²C address is 0x40

💡

Multiple sensor names (SHT21/HTU21/GY-21/SI7021) - same chip,⚡ Pull-up resistors (10kΩ) recommended on SDA/SCL

🌡️

High accuracy: ±0.3°C temperature, ±3% humidity

Pin Descriptions

Pin NameTypeDescriptionNotes
1 VCC
Power

Power supply input (2.1V to 3.6V)

Low voltage operation for battery applications

2 GND
Power

Ground connection

Connect to ESP32 ground

3 SDA
Communication

I²C data line

Bidirectional data communication

4 SCL
Communication

I²C clock line

Clock signal from master device

Connection Guide

Wiring SHT21 / HTU21 / GY-21 / SI7021 to ESP32

Connect the SHT21/HTU21/GY-21/SI7021 using standard I²C interface.

Visual Wiring Diagram

Wiring Diagram Recommended
SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor wiring with ESP32
4
Connections

Connection Status

Required
4

Protocol

I2C

Pin Connections

SHT21 / HTU21 / GY-21 / SI7021 PinConnectionESP32 PinDescription
1 VCC Required
3.3V

Power supply (2.1V to 3.6V)

2 GND Required
GND

Ground connection

3 SDA Required
GPIO21

I²C data line (default SDA)

4 SCL Required
GPIO22

I²C clock line (default SCL)

💡

GPIO21/22 are default I²C pins on ESP32

🔧

I²C address is 0x40 (standard for this sensor)

Add 10kΩ pull-up resistors on SDA/SCL if needed

📡

Compatible with SHT20 libraries and code

Help & Support

SHT21 / HTU21 / GY-21 / SI7021 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

SHT21 / HTU21 / GY-21 / SI7021 Programming Examples

Ready-to-use code examples for different platforms and frameworks

Summary

Wrapping Up SHT21 / HTU21 / GY-21 / SI7021

The ESP32 SHT21 / HTU21 / GY-21 / SI7021 Temperature and Humidity Sensor is a powerful environment sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

Best Practices

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Safety First

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.

Ready to Start Building?

Now that you have all the information you need, it's time to integrate the SHT21 / HTU21 / GY-21 / SI7021 into your ESP32 project and bring your ideas to life!

Similar Options

Explore Alternative Sensors

Looking for alternatives to the SHT21 / HTU21 / GY-21 / SI7021? Check out these similar sensors that might fit your project needs.

SHT41 / SHT41-D / GY-SHT41-D Temperature and Humidity Sensor

SHT41 / SHT41-D / GY-SHT41-D Temperature and Humidity Sensor

ENVIRONMENT I2C

The SHT41 sensor is part of Sensirion's SHT4x series and offers high-accuracy temperature and humidity measurements. It is factory...

View Details
BMP280 Barometric Pressure and Temperature Sensor

BMP280 Barometric Pressure and Temperature Sensor

ENVIRONMENT I2C,SPI

The BMP280 is a high-precision digital barometric pressure and temperature sensor, ideal for weather monitoring, altimetry, and navigation....

View Details
DHT20 Temperature and Humidity Sensor

DHT20 Temperature and Humidity Sensor

ENVIRONMENT I2C

The DHT20 is a high-precision digital temperature and humidity sensor with an I²C interface. It features low power consumption, fast...

View Details