Key facts
- Brand
- SENSIRION
- Model
- SHT21
- Industry
- Industrial
- Documents
- 5
- Languages
- EN · ZH
- Last added
- 2012-04-11
Start here

Sensirion SHT21 Sample Code Communication Software
This document provides a complete set of C source files that demonstrate how to interface a microcontroller with the Sensirion SHT21 (SHT2x family) humidity and temperature sensor. It includes a hardware abstraction layer for I²C communication, sensor driver functions, and example usage in a main program.
The code is organized into modules (system, I2C HAL, sensor driver, display) and shows how to initialize the hardware, read measurements, handle CRC checks, reset the sensor, and retrieve the 64‑bit serial number. It is intended for developers who need a ready‑to‑use reference implementation for the SHT21 sensor.
SENSIRION SHT21 specifications
| I²C write address | 0x80 (128) |
|---|---|
| I²C read address | 0x81 (129) |
| CRC polynomial | 0x131 |
| Resolution options | RH 12‑bit / T 14‑bit (0x00), RH 8‑bit / T 12‑bit (0x01), RH 10‑bit / T 13‑bit (0x80), RH 11‑bit / T 11‑bit (0x81) |
| Heater command | 0x04 (on), 0x00 (off) |
All SENSIRION SHT21 documents by type
Disassembly, diagnostics and part numbers, for repair.
Ratings, dimensions and ordering codes, for selection and design work.
Instruction set, parameters and examples for configuring or programming the device.
Questions answered in these manuals
How do I perform a soft reset of the SHT21 sensor?
Call the function SHT2x_SoftReset(), which sends the soft‑reset command over I²C and waits for the sensor to restart.
How can I read the 64‑bit serial number of the sensor?
Use the SHT2x_GetSerialNumber() routine; it reads the serial number from the sensor’s on‑chip memory and returns it in an 8‑byte array.
What measurement resolution does the SHT21 provide?
It offers 12‑bit resolution for humidity (0.04 %RH) and 14‑bit resolution for temperature (0.01 °C).
How large is the SHT21 package?
The sensor is packaged in a 3 × 3 mm DFN footprint with a height of 1.1 mm.
What supply voltage should be used for the SHT21 sensor?
The sensor operates from 2.1 V to 3.6 V, with a recommended supply of 3.0 V.
What is the operating voltage range for the SHT21?
The sensor operates from 2.1 V to 3.6 V.
