SHT40 temperature and humidity sensor
SHT40 / SHT4x breakout pinout, I2C address 0x44, 3.3 V vs 5 V boards, the built-in heater, and fixes for missing or stuck readings.
Community draft — report a mistake
3.3 V or 5 V? The chip is 1.08–3.6 V only. Boards with a regulator and level shifting (Adafruit-style, with a VIN pin) accept 5 V. Plain 4-pin clones often have neither — power them from 3.3 V and keep SDA/SCL at 3.3 V; on an Uno use a level shifter.
The Sensirion SHT40 is the current generation of the SHT family: ±0.2 °C and ±1.8 % RH typical, in a tiny 1.5 mm chip, over I2C. It’s more accurate and more stable than the DHT22 or AHT20 and smaller than the older SHT31, which makes it a good choice for weather stations, cold-storage loggers and greenhouses.
Address: the common SHT40-AD1B answers at 0x44. Other factory variants use 0x45 or 0x46 — the address is fixed in the chip, not set by a pin, so run the I2C scanner if begin() fails.
The heater is there to drive off condensation, not for normal use. In monsoon fog a sensor will read 100 % until it dries; a short heater pulse every few hours (then a minute to cool) brings it back. Protect it from direct rain and sun with a small radiation shield.
Prices are indicative (Nov 2026) and vary by seller.
Pinout
| Pin | What it does |
|---|---|
VCC | 3.3 V (labelled VIN on boards with a regulator, which also take 5 V) |
GND | Ground |
SCL | I2C clock |
SDA | I2C data |
I2C address:0x440x45
Library
Adafruit SHT4x Library by Adafruit (also install Adafruit Unified Sensor and Adafruit BusIO)
Arduino IDE → Library Manager → search the name above. Each guide lists the exact version we compile against.
Use it with
Common errors
“Couldn’t find SHT4x” but the scanner shows a device
On ESP32 with custom pins, call Wire.begin(SDA, SCL) before sht4.begin(). A scanner hit at 0x45 or 0x46 means a different factory variant (SHT40-BD1B / CD1B) — pass that address to begin().
Humidity reads 100 % for a long time after fog or a wash
Condensation on the sensor. Run the built-in heater for a second (setHeater(SHT4X_HIGH_HEATER_1S)) a few times, then let it cool before reading.
Temperature reads 1–3 °C high
Heat from the board or regulator. Mount the sensor on a short cable away from the ESP32 and don’t use the heater during normal logging.