Pre-soldered SHT45 temperature and humidity sensor board, angled view

GY-SHT45 Pre-Soldered Temperature & Humidity I2C Sensor Module | ShillehTek Product Manual

ArduinoESP32Raspberry PiPicomanual-product-10645385838879
$14.99 USD In stock · Order by 3pm ET, ships today

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

Sensor
Sensirion SHT45
Humidity
0 – 100 %RH, ±1.0 % typical
Temperature
-40 to 125 °C, ±0.1 °C typical
Interface
I2C, address 0x44
Supply
3.3 V (1.08 – 3.6 V)
Header
VIN · GND · SCL · SDA

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.

GY-SHT45 temperature and humidity sensor module pinout diagram showing VIN, GND, SCL and SDA pins

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
Never 5 V: VIN connects straight to the sensor chip, which is rated for 3.6 V at most. 5 V on VIN, or 5 V logic on SDA and SCL, can destroy it.
Converter: LV goes to 3.3V, HV to 5V and GND to GND. The sensor's SDA and SCL go on the LV side, and A4 and A5 go on the matching HV pins.

ESP32 Wiring

SHT45 Pin ESP32 Pin Notes
VIN 3V3 Power
GND GND Ground
SDA GPIO 21 I2C data
SCL GPIO 22 I2C clock
Avoid heat: Mount the sensor a few centimeters away from the ESP32, voltage regulators and displays. Their warmth raises the temperature reading and lowers the humidity reading.

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
Enable I2C: Run sudo raspi-config, open Interface Options and turn on I2C. Then i2cdetect -y 1 should show the sensor as 44.

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
No driver: The MicroPython example sends the measure command and decodes the six reply bytes itself, so there is nothing extra to copy onto the Pico.

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)

sht45_read.ino
// 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

sht45_read.py
#!/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

sht45_pico.py
# 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)

Frequently Asked Questions

Can I power the GY-SHT45 from 5 V?
No. This board has no regulator, so VIN feeds the SHT45 directly and the chip is rated for 1.08 to 3.6 V. Use the 3.3 V pin of your board. On a 5 V Arduino, also add a logic level converter on SDA and SCL, because the chip's inputs must not go more than 0.3 V above its supply.
How accurate is it?
The SHT45 chip is rated at ±1.0 %RH and ±0.1 °C typical. Accuracy has not been characterized separately for this module, and in practice placement matters more than the chip: heat from nearby electronics, sunlight and still air all shift the reading. Give the sensor free airflow and a few minutes to settle after moving it.
Is there a library I can use instead of the raw code?
Yes. In the Arduino IDE, the Adafruit SHT4x Library supports the SHT40, SHT41 and SHT45 at address 0x44. On a Raspberry Pi, adafruit-circuitpython-sht4x does the same job in Python. The examples in this manual talk to the sensor directly so that nothing has to be installed, and they read the same values.
Why does the read fail, or why is nothing found at 0x44?
Check power first: VIN needs 3.3 V and a solid ground. Then make sure SDA and SCL are not swapped, and on a Raspberry Pi that I2C is enabled. With an Uno or Nano, confirm the level converter's LV side is on 3.3V and its HV side on 5V. A checksum error with correct wiring usually points to a loose jumper or wires that are too long.
What is the built-in heater for?
It warms the sensing element to drive off condensation, which helps in fog, greenhouses and other very humid places. The heater fires in short pulses of 0.1 s or 1 s at 20, 110 or 200 mW, and it should stay off at least 90% of the time. Readings taken while it runs do not reflect the surrounding air. The examples leave the heater off.
How often should I read the sensor?
Once every second or two is plenty for room climate, and the examples read every two seconds. A reading takes less than 10 ms, so faster is possible, but frequent measurements warm the chip slightly. For battery projects, read once a minute and let the microcontroller sleep in between. The sensor itself idles at a tiny fraction of a microamp.
How does the SHT45 compare with the SHT40, DHT22 and BME280?
The SHT40, SHT41 and SHT45 share the same commands and address, and the SHT45 is the most accurate of the three. Compared with a DHT22 it uses standard I2C instead of a timing-critical single-wire protocol, and it is faster and more precise. A BME280 adds barometric pressure, but the SHT45 is the better choice when humidity and temperature accuracy matter most.

Related Tutorials

Datasheets & downloads

Reference documents for the GY-SHT45 Pre-Soldered Temperature & Humidity I2C Sensor Module. This manual covers wiring and code; the documents below carry the full electrical specifications.