Skip to content
My Account

Reference

SHT40 / SHT41 Temperature and Humidity Sensor Complete Guide

Sensirion's fourth-generation SHT4x sensors trade the SHT3x series' heater-based self-test for an ultra-low idle power budget and a slightly tighter accuracy spec. This guide covers wiring an SHT40 or SHT41 to an ESP32, real I2C addressing, and which SHT generation actually makes sense for a new project.

2 min read

No ratings yet, be the first.

The SHT40 and SHT41 are Sensirion’s newer SHT4x-series digital temperature and humidity sensors, the generation after the already-published SHT3x series. They’re factory-calibrated, communicate over I2C, and are common on small breakout boards from Adafruit, SparkFun and generic sellers.

SHT40 vs. SHT41: what's actually different

Both chips share the same package, pinout and I2C command set, the difference is factory-trimmed accuracy:

ModelTypical humidity accuracyTypical temperature accuracy
SHT40±1.8% RH±0.2°C
SHT41±1.8% RH (tighter tolerance band than SHT40)±0.2°C

In practice the two are close enough that most hobby projects won’t notice a difference, buy whichever your supplier stocks. Unlike some SHT3x variants, the SHT4x family has no heater-based self-test cycle, instead it has a built-in heater purely for demisting the sensor in condensing environments, a genuinely different feature, not a self-check.

Pinout and I2C Address

PinFunction
VCCPower, 1.08V–3.6V depending on breakout
GNDGround
SDAI2C data
SCLI2C clock

The SHT4x family ships with one of two fixed I2C addresses depending on the exact part number: 0x44 (SHT40-AD1B/SHT41-AD1B, the address almost every breakout board uses) or 0x45 (the -BD1B variant). Check your specific board’s datasheet if 0x44 doesn’t show up on an I2C scan, there’s no address-select pin to change it in software.

Idle power draw is genuinely tiny, around 0.4µW, which is the SHT4x family’s real headline feature over SHT3x for battery-powered projects.

Wiring to an ESP32

SHT4x PinESP32 Pin
VCC3.3V
GNDGND
SDAGPIO21
SCLGPIO22

Arduino code (Adafruit SHT4x library)

#include <Wire.h>
#include "Adafruit_SHT4x.h"

Adafruit_SHT4x sht4 = Adafruit_SHT4x();

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22);
  if (!sht4.begin()) {
    Serial.println("Couldn't find SHT4x sensor!");
    while (1) delay(10);
  }
  sht4.setPrecision(SHT4X_HIGH_PRECISION);
}

void loop() {
  sensors_event_t humidity, temp;
  sht4.getEvent(&humidity, &temp);

  Serial.print("Temperature: ");
  Serial.print(temp.temperature);
  Serial.print(" degC   Humidity: ");
  Serial.print(humidity.relative_humidity);
  Serial.println(" %RH");

  delay(2000);
}

Install “Adafruit SHT4x Library” via the Arduino Library Manager, it depends on Adafruit’s BusIO and Unified Sensor libraries.

SHT3x or SHT4x: which should you buy?

Honest answer: for most indoor projects it doesn’t matter much, both are accurate, reliable, factory-calibrated I2C sensors from the same manufacturer. Pick SHT4x specifically if idle power draw genuinely matters (a coin-cell or solar-powered sensor node), the ~0.4µW idle figure is a real, meaningful improvement over SHT3x’s idle current. Pick SHT3x if your supplier already stocks it cheaper or you need its optional ALERT pin, which most SHT4x breakouts drop. See the SHT3x series guide for that generation’s own wiring and code.

Conclusion

The SHT40/SHT41 give you the same reliable Sensirion accuracy as the SHT3x series with a much smaller idle power footprint, at the cost of losing the ALERT pin some SHT3x boards expose. Either family pairs cleanly with an ESP32 over I2C.

Advertisement

Related

All guides

More guides

Keep building.

From ESP32 HomeKit accessories to Arduino and ATtiny reference guides, there’s more where this came from.

All guides