SHT2x Temperature and Humidity Sensor
Overview
A sensor capable of measuring temperature (℃) and relative humidity (%) using I2C interface.

Compatible Modules
- SHT20
- SHT21
- SHT25
Specifications (SHT21)
- Operating Voltage: 3.3/5V
- Communication Interface: I2C / IIC
- Protection Class: waterproof anti-condensation
- RH Response Time: 8s (tau63%)
- Accuracy: ±2% RH / ±0.3 ℃
- Measuring Range: 0-100% RH / -40-125 ℃
Supported GPIO
- Raspberry Pi 0~4
- Raspberry Pi 5
- BeagleBone Black/Green
- Jetson Nano
- FT232H, FT2232H, FT4232H
- MCP2221
Commands
[READ_DATA]
Reads temperature and humidity from the module.
Item | Type | Description |
---|---|---|
Temperature(℃) | READ | Measured temperature. |
Relative Humidity(%) | READ | Measured relative humidity. |
[SET_HEATER_LEVEL]
Sets the level of the built-in heater. The heater can be used to evaporate moisture condensed on the humidity sensor for accurate humidity measurements.
Item | Type | Description |
---|---|---|
Heater Level | WRITE | Sets the heater level to a value between 0 and 15. |
[HEATER_ON]
Turns on the heater.
[HEATER_OFF]
Turns off the heater.
[GET_FIRMWARE_VERSION]
Reads the firmware version.
Item | Type | Description |
---|---|---|
Firmware Version | READ | Returns the module’s firmware version as a decimal number. |
[RESET]
Resets the module.
Example
Objective
Display temperature and relative humidity readings from the sensor on dashboard gauge widgets.
Parts
Part | Quantity |
---|---|
Raspberry Pi 4 * | 1 |
SHT20 | 1 |
* Other compatible hardware may be used. See Supported GPIO for details.
Wiring
Connect each SHT20 pin to the corresponding GPIO pin as listed in each row below.
SHT20 | GPIO |
---|---|
VIN | 3.3V |
GND | GND |
SCL | 3 (I2C1 SCL) |
SDA | 2 (I2C1 SDA) |

Project Link