meta data for this page
LamaPLC: SHT Sensirion Temperature/humidity sensor with I²C communication
Sensirion SHT sensors are a series of highly accurate, reliable digital humidity and temperature sensors built on the company's proprietary CMOSens Technology, offering fully calibrated outputs and long-term stability for a wide range of applications.
| Type of measurement | Model | Power voltage | Measurement, range, accuracy | Communication | Note |
|---|---|---|---|---|---|
![]() Temperature Humidity | Sensirion SHT20 ![]() | 3.3V (2.1 .. 3.6V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.3°C Humidity measurement range: 0..100% RH Humidity measurement accuracy:±3% | I²C default addr.: 0x40/41 | 3.2 µW (at 8 bits, 1 measurement /s) |
![]() Temperature Humidity | Sensirion SHT21 ![]() | 3.3V (2.1 .. 3.6V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.3°C Humidity measurement range: 0..100% RH Humidity measurement accuracy: ±2% | I²C default addr.: 0x40/41 | 3.2 µW (at 8 bits, 1 measurement /s) |
![]() Temperature Humidity | Sensirion SHT25 ![]() | 3.3V (2.1 .. 3.6V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.2°C Humidity measurement range: 0..100% RH Humidity measurement accuracy: ±1.8% | I²C default addr.: 0x40/41 | 3.2 µW (at 8 bits, 1 measurement /s) |
![]() Temperature Humidity | Sensirion SHT30 ![]() | 3.3 / 5 V (2.15 .. 5.5V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.2°C Humidity measurement range: 0..100% RH Humidity measurement accuracy: ±2% (10..90%) | I²C default addr.: 0x44/45 | 4.8 µW (1 measurement/s) |
![]() Temperature Humidity | Sensirion SHT31 ![]() | 3.3 / 5 V (2.15 .. 5.5V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.2°C Humidity measurement range: 0..100% RH Humidity measurement accuracy: ±2% (0..100%) | I²C default addr.: 0x44/45 | 4.8 µW (1 measurement/s) |
![]() Temperature Humidity | Sensirion SHT35 ![]() | 3.3 / 5 V (2.15 .. 5.5V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.2°C Humidity measurement range: 0..100% RH Humidity measurement accuracy: ±1.5% (0..80%) | I²C default addr.: 0x44/45 | 4.8 µW (1 measurement/s) |
![]() Temperature Humidity | Sensirion SHT40 ![]() | 3.3 (1.08 .. 3.6V) | Temperature measurement range: -40 .. +125 °C Temperature measurement accuracy: ±0.2°C Humidity measurement range: 0..100% RH Humidity measurement accuracy: ±1.8% | I²C default addr.: 0x44/45 | 4.0 µW (1 measurement/s) |
The SGP sensors can be integrated with the Tasmota system. For more information, see here.
If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.
Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.
SHT Sensor Comparison Table
| Model | Typical RH Accuracy | Typical Temperature Accuracy | Supply Voltage Range | Interface | Key Features |
|---|---|---|---|---|---|
| SHT20 | ±3% RH (@20-80% RH) | ±0.3°C (@10-40°C) | 2.1V to 3.6V | I²C, PWM, SDM | Low-cost version of SHT2x series |
| SHT21 | ±2% RH (@0-100% RH) | ±0.3°C (@10-40°C) | 2.1V to 3.6V | I²C, PWM, SDM | Standard version of SHT2x series |
| SHT25 | ±1.5% RH (@0-80% RH) | ±0.2°C (@5-60°C) | 2.1V to 3.6V | I²C, PWM, SDM | Highest performance of SHT2x series |
| SHT30 | ±3% RH (@20-80% RH) | ±0.2°C (@0-65°C) | 2.15V to 5.5V | I²C (two addresses) | Low-cost version of SHT3x series, integrated heater |
| SHT31 | ±2% RH (@0-100% RH, @25°C) | ±0.2°C (@0-90°C) | 2.15V to 5.5V | I²C (two addresses) | Standard version of SHT3x series, integrated heater |
| SHT35 | ±1% RH (@20-60% RH) | ±0.1°C (@20-60°C) | 2.15V to 5.5V | I²C (two addresses) | Premium version of SHT3x series, highest accuracy |
| SHT40 | ±1.8% RH (@25-75% RH) | ±0.2°C (@0-75°C) | 1.08V to 3.6V | I²C (two addresses) | Fourth generation, ultra-low power, faster response time, smaller package |
Moduls
| Type of measurement | Name | Pics | Sensors | Description |
|---|---|---|---|---|
![]() - Temperature - Humidity | SHTxx modul | ![]() | SHT20 SHT30 SHT40 | I²C interface default address: 0x44/45 wiring colors: - black: GND - red: VCC (3.3V / 5V) - white: SDA - yellow: SCL |
![]() - Temperature - Humidity | GY-21 | ![]() | HTU21 Si-7021 SHT21 | I²C interface (only 1 modul, default address: 0x40) GY-21 is a reliable and durable module for detecting temperature and humidity values compatible with Arduino, Atmega328p, ESP and Raspberry Typical measurement accuracy temperature: +/-1°C deviation between -30°C and 90°C Typical measurement accuracy humidity: +/-2% RL between 5% and 95% RL |
¹: The SHT20, HTU20, and Si7020 are different manufacturers' versions of essentially the same I²C digital humidity and temperature sensor chip, designed to be hardware- and software-compatible. The GY-20 is a generic breakout board that uses one of these chips.
²: The SHT21, HTU21, and Si7021 are very similar digital humidity and temperature sensor chips from different manufacturers (Sensirion, Measurement Specialties, and Silicon Labs, respectively), while the GY-21 is a generic breakout board that uses one of these chips. They are largely interchangeable in hardware and software for most general-purpose applications.
³: The SHT31, HTU31, and Si7031 are high-accuracy digital temperature and humidity sensor chips from different manufacturers (Sensirion, TE Connectivity, and Silicon Labs, respectively) that are designed to be largely interchangeable. The GY-31 is a generic name for a breakout board that typically uses the SHT31 chip.
Arduino & SHT21
Wiring
- SCL: A5
- GND: GND
- SDA: A4
- Vdd: 5V or 3.3V
Arduino code
This example uses the SHT21 library to read temperature and humidity every 2 seconds
#include <Wire.h> #include "SHT21.h" // Install "SHT21" or "HTU21D" library via Library Manager SHT21 sht; void setup() { Wire.begin(); // Initialize I2C communication Serial.begin(115200); // Set baud rate for Serial Monitor Serial.println("GY-21 (SHT21) Sensor Test"); } void loop() { // Read values from the sensor float temperature = sht.getTemperature(); float humidity = sht.getHumidity(); // Check if readings are valid if (!isnan(temperature) && !isnan(humidity)) { Serial.print("Temperature: "); Serial.print(temperature, 1); // Print with 1 decimal place Serial.print(" °C\t"); Serial.print("Humidity: "); Serial.print(humidity, 1); Serial.println(" %"); } else { Serial.println("Failed to read from GY-21 sensor!"); } delay(2000); // Wait 2 seconds before the next reading }
Example codes
none
This page has been accessed for: Today: 1, Until now: 31








