Overview
The SHT21 is a high-accuracy digital relative humidity and temperature sensor manufactured by Sensirion. Built on Sensirion's proprietary CMOSens technology, it integrates a capacitive humidity sensor element, a bandgap temperature sensor, and a 14-bit ADC inside a compact 6-pin DFN package.
Delivering typical accuracies of and , user-configurable resolution (12-bit RH / 14-bit Temp down to 8-bit / 11-bit), CRC-8 checksum verification, an internal heating element, and an interface (0x40), the SHT21 draws a standby current of just .
Quick reference
Operating voltage (VIN) | 3.3 V to 5.0 V DC (breakout with 3.3V LDO regulator) |
IC supply voltage (VDD) | 2.1 V to 3.6 V DC (3.3 V nominal) |
| Interface | Fast-Mode (up to 400 kHz) |
| Fixed address | 0x40 |
| Humidity range & accuracy | ( typical) |
| Temperature range & accuracy | ( typical) |
| Resolution options | 12-bit RH / 14-bit Temp (Default) or 8-bit RH / 11-bit Temp |
| Internal heater | Onboard programmable heater for diagnostic testing |
| Standby current | typical at |
Pinout
Breakout module 4-pin header:
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | VCC | Power | Supply power input (+3.3 V to +5.0 V DC) |
| 2 | GND | Power | Ground reference (0 V) |
| 3 | SDA | Digital Input / Output | Serial Data |
| 4 | SCL | Digital Input | Serial Clock |
Specifications
| Parameter | Symbol | Min | Typ | Max | Unit | Conditions |
|---|---|---|---|---|---|---|
| Supply Voltage (Module) | 3.3 | 3.3 / 5.0 | 5.5 | V | Power rail with LDO | |
| Active Measurement Current | — | 150 | 330 | µA | Active sampling | |
| Sleep Current | — | 0.15 | 0.4 | µA | Sleep mode | |
| Temp Accuracy () | -0.3 | +0.3 | °C | At | ||
| RH Accuracy () | -2.0 | +2.0 | % RH | At | ||
| Measuring Time (14-bit Temp) | — | 66 | 85 | ms | Max resolution | |
| Measuring Time (12-bit RH) | — | 22 | 29 | ms | Max resolution |
Command Opcodes & Math
- Hold Master Mode Temp:
0xE3 - Hold Master Mode RH:
0xE5 - No Hold Master Mode Temp:
0xF3 - No Hold Master Mode RH:
0xF5
Temperature Calculation ()
Relative Humidity Calculation ()
Wiring
| SHT21 Pin | → | Arduino / MCU | ESP32 | Notes |
|---|---|---|---|---|
VCC | 5V / 3.3V | 3.3V | Power rail | |
GND | GND | GND | System ground | |
SCL | A5 | GPIO 22 | Clock | |
SDA | A4 | GPIO 21 | Data |
Example (SHT21 Arduino Library)
cpp
#include <Wire.h>
#include "SHT21.h"
SHT21 sht;
void setup() {
Serial.begin(115200);
Wire.begin();
Serial.println("Sensirion SHT21 Sensor Test");
sht.begin();
}
void loop() {
float temp = sht.getTemperature();
float humidity = sht.getHumidity();
Serial.print("Temperature: "); Serial.print(temp); Serial.print(" °C | ");
Serial.print("Humidity: "); Serial.print(humidity); Serial.println(" % RH");
delay(1000);
}
Common mistakes
- Leaving lines un-pulled: SHT21 requires pull-up resistors on
SDAandSCL. - Forgetting address
0x40collision: SHT21 shares fixed address0x40with HTU21D and HDC1080.
Notes
- Sensirion SHT Series Evolution: SHT11 (1-Wire-like protocol) SHT21 ( 0x40) SHT31 ( 0x44/0x45) SHT40 ( 0x44 ultra-low power).
Assets & downloads
- datasheetdatasheet
- product-pagereference