Overview
The SHT45 is the most accurate member of Sensirion's SHT4x family: one tiny chip that measures temperature and relative humidity and reports both as calibrated digital values over I2C. The chip's typical accuracy is ±1.0 %RH and ±0.1 °C, a clear step up from DHT22 and BME280 class sensors for weather stations, incubators, filament dry boxes and indoor climate logging.
This GY-SHT45 breakout is a 13 × 11 mm board with a pre-soldered 4-pin header: VIN, GND, SCL and SDA. There is no voltage regulator on the board, so VIN goes straight to the chip and must stay between 1.08 and 3.6 V. Power it from 3.3 V, never from 5 V. ESP32, Raspberry Pi and Pico boards connect directly, and a 5 V Arduino needs a logic level converter on the I2C lines. The I2C address is 0x44.
A high-precision reading takes under 10 ms and the sensor draws only about 2 µA on average when read once a second, which suits battery-powered loggers. A built-in heater can drive off condensation in very humid places. This manual covers the pinout, wiring for Arduino, ESP32, Raspberry Pi and Pico, working code for each, and answers on accuracy, the heater and failed readings.
At a Glance
Specifications
| Parameter | Value |
| Sensor IC | Sensirion SHT45 |
| Humidity range | 0 – 100 %RH |
| Humidity accuracy | ±1.0 %RH typical (chip rating) |
| Temperature range | -40 to +125 °C |
| Temperature accuracy | ±0.1 °C typical (chip rating) |
| Interface | I2C, address 0x44 |
| Supply voltage | 1.08 – 3.6 V (use 3.3 V). Not 5 V tolerant. |
| Measurement time | Up to 8.3 ms at high precision |
| Average current | About 2.2 µA at one reading per second |
| Built-in heater | 20, 110 or 200 mW pulses of 0.1 s or 1 s |
| Board size | 13 × 11 mm |
| Header | 4-pin: VIN · GND · SCL · SDA |
Pinout Diagram
Four pins sit on one edge, in this order: VIN (power, 3.3 V), GND, SCL (I2C clock) and SDA (I2C data). The small square part marked U1 is the SHT45 itself. The opening on its top is where air reaches the sensing element, so keep it uncovered and avoid touching it. The two resistors marked 103 next to it are the 10k pull-ups for the I2C lines.
Wiring Guide
The module needs four wires: 3.3 V power, ground and the two I2C lines. The one rule that matters is voltage: nothing connected to this board may be above 3.6 V.
Arduino Uno / Nano Wiring
The SHT45 is a 3.3 V part and an Uno or Nano uses 5 V logic, so power the module from the 3.3V pin and put a bidirectional logic level converter on SDA and SCL.
| SHT45 Pin | Arduino Uno / Nano |
|---|---|
| VIN | 3.3V pin |
| GND | GND |
| SDA | A4, through the level converter |
| SCL | A5, through the level converter |
ESP32 Wiring
| SHT45 Pin | ESP32 Pin | Notes |
|---|---|---|
| VIN | 3V3 | Power |
| GND | GND | Ground |
| SDA | GPIO 21 | I2C data |
| SCL | GPIO 22 | I2C clock |
Raspberry Pi Wiring
| SHT45 Pin | Raspberry Pi Pin | Notes |
|---|---|---|
| VIN | 3.3V (Pin 1) | Power |
| GND | GND (Pin 6) | Ground |
| SDA | GPIO 2 (Pin 3) | I2C data |
| SCL | GPIO 3 (Pin 5) | I2C clock |
Raspberry Pi Pico Wiring
| SHT45 Pin | Pico Pin | Notes |
|---|---|---|
| VIN | 3V3(OUT) (Pin 36) | Power |
| GND | GND (Pin 38) | Ground |
| SDA | GP4 (Pin 6) | I2C0 data |
| SCL | GP5 (Pin 7) | I2C0 clock |
Code Examples
View or download this product's example code on GitHub.
Each example sends the high-precision measure command, waits 10 ms, reads six bytes, verifies both checksums and prints temperature and humidity every two seconds. No library is needed on any platform.
Arduino and ESP32 — Temperature and Humidity (No Library)
// GY-SHT45 temperature and humidity - raw I2C read (no library needed)
// Uno/Nano: SDA = A4, SCL = A5 through a 3.3 V level converter, VIN = 3.3V
// ESP32: SDA = GPIO 21, SCL = GPIO 22, VIN = 3V3 (direct)
#include <Wire.h>
const uint8_t SHT45_ADDR = 0x44;
const uint8_t CMD_MEASURE_HIGH = 0xFD; // high precision, heater off
float tempC = 0.0;
float humidity = 0.0;
// CRC-8 used by the SHT4x: polynomial 0x31, start value 0xFF
uint8_t crc8(const uint8_t *data, uint8_t len) {
uint8_t crc = 0xFF;
for (uint8_t i = 0; i < len; i++) {
crc ^= data[i];
for (uint8_t bit = 0; bit < 8; bit++) {
if (crc & 0x80) {
crc = (uint8_t)((crc << 1) ^ 0x31);
} else {
crc = (uint8_t)(crc << 1);
}
}
}
return crc;
}
// Takes one measurement. Returns false if the sensor does not answer or a checksum fails.
bool readSHT45() {
Wire.beginTransmission(SHT45_ADDR);
Wire.write(CMD_MEASURE_HIGH);
if (Wire.endTransmission() != 0) return false;
delay(10); // a conversion takes up to 8.3 ms
uint8_t buf[6];
if (Wire.requestFrom((int)SHT45_ADDR, 6) != 6) return false;
for (uint8_t i = 0; i < 6; i++) buf[i] = Wire.read();
if (crc8(buf, 2) != buf[2] || crc8(buf + 3, 2) != buf[5]) return false;
uint16_t rawT = ((uint16_t)buf[0] << 8) | buf[1];
uint16_t rawRH = ((uint16_t)buf[3] << 8) | buf[4];
tempC = -45.0 + 175.0 * rawT / 65535.0;
humidity = -6.0 + 125.0 * rawRH / 65535.0;
if (humidity < 0.0) humidity = 0.0;
if (humidity > 100.0) humidity = 100.0;
return true;
}
void setup() {
Serial.begin(115200);
Wire.begin();
}
void loop() {
if (readSHT45()) {
Serial.print("Temperature: ");
Serial.print(tempC, 2);
Serial.print(" C Humidity: ");
Serial.print(humidity, 1);
Serial.println(" %RH");
} else {
Serial.println("SHT45 read failed - check wiring and 3.3 V power");
}
delay(2000);
}
Raspberry Pi — Python
#!/usr/bin/env python3
# GY-SHT45 temperature and humidity on Raspberry Pi (I2C bus 1)
# Install once: sudo apt install python3-smbus2 (enable I2C in raspi-config)
import time
from smbus2 import SMBus, i2c_msg
SHT45_ADDR = 0x44
CMD_MEASURE_HIGH = 0xFD # high precision, heater off
def crc8(data):
"""CRC-8 used by the SHT4x: polynomial 0x31, start value 0xFF."""
crc = 0xFF
for byte in data:
crc ^= byte
for _ in range(8):
crc = ((crc << 1) ^ 0x31) & 0xFF if crc & 0x80 else (crc << 1) & 0xFF
return crc
def read_sht45(bus):
bus.i2c_rdwr(i2c_msg.write(SHT45_ADDR, [CMD_MEASURE_HIGH]))
time.sleep(0.01) # a conversion takes up to 8.3 ms
reply = i2c_msg.read(SHT45_ADDR, 6)
bus.i2c_rdwr(reply)
data = list(reply)
if crc8(data[0:2]) != data[2] or crc8(data[3:5]) != data[5]:
raise ValueError("Checksum mismatch - check the wiring")
raw_t = (data[0] << 8) | data[1]
raw_rh = (data[3] << 8) | data[4]
temp_c = -45 + 175 * raw_t / 65535
humidity = min(100.0, max(0.0, -6 + 125 * raw_rh / 65535))
return temp_c, humidity
with SMBus(1) as bus:
while True:
temp_c, humidity = read_sht45(bus)
print(f"Temperature: {temp_c:.2f} C Humidity: {humidity:.1f} %RH")
time.sleep(2)
Raspberry Pi Pico — MicroPython
# GY-SHT45 temperature and humidity on Raspberry Pi Pico (MicroPython)
# SDA = GP4 (pin 6), SCL = GP5 (pin 7), VIN = 3V3(OUT), GND = GND
from machine import I2C, Pin
import time
SHT45_ADDR = 0x44
CMD_MEASURE_HIGH = 0xFD # high precision, heater off
i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=100000)
print("I2C scan:", [hex(a) for a in i2c.scan()]) # expect 0x44
def crc8(data):
# CRC-8 used by the SHT4x: polynomial 0x31, start value 0xFF
crc = 0xFF
for byte in data:
crc ^= byte
for _ in range(8):
if crc & 0x80:
crc = ((crc << 1) ^ 0x31) & 0xFF
else:
crc = (crc << 1) & 0xFF
return crc
def read_sht45():
i2c.writeto(SHT45_ADDR, bytes([CMD_MEASURE_HIGH]))
time.sleep_ms(10) # a conversion takes up to 8.3 ms
data = i2c.readfrom(SHT45_ADDR, 6)
if crc8(data[0:2]) != data[2] or crc8(data[3:5]) != data[5]:
raise ValueError("Checksum mismatch - check the wiring")
raw_t = (data[0] << 8) | data[1]
raw_rh = (data[3] << 8) | data[4]
temp_c = -45 + 175 * raw_t / 65535
humidity = min(100, max(0, -6 + 125 * raw_rh / 65535))
return temp_c, humidity
while True:
temp_c, humidity = read_sht45()
print("Temperature: {:.2f} C Humidity: {:.1f} %RH".format(temp_c, humidity))
time.sleep(2)



