> Source: https://www.tinkered.ai/components/sht40 (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/sht40. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# SHT40

A Sensirion SHT40 (SHT4x family) breakout that reads humidity and temperature over I2C with ±1.8 %RH and ±0.2 °C typical accuracy at microamp currents.

Source page: https://www.tinkered.ai/components/sht40
Datasheet: https://sensirion.com/products/catalog/SHT40

## In short

The SHT40 is Sensirion's fourth-generation humidity and temperature sensor: ±1.8 %RH and ±0.2 °C typical, 0 to 100 %RH and -40 to 125 °C, drawing 0.4 µA on average at one reading per second (Sensirion SHT4x datasheet v1, pp. 1, 4 to 5). The chip runs from 1.08 V to 3.6 V and answers at I2C address 0x44 (0x45 on the SHT40-BD1B) (pp. 1, 7). The Adafruit breakout adds a regulator and level shifting, so VIN takes 3 V or 5 V.

The SHT4x family replaced the SHT3x with a smaller package, a lower supply range and lower current. The SHT40 is the base grade at ±1.8 %RH and ±0.2 °C typical; the SHT41 keeps the same typical accuracy with a tighter maximum, and the SHT45 reaches ±1.5 %RH and ±0.1 °C (Sensirion datasheet v1, pp. 4 to 5; Adafruit guide, p. 3). All share the same pins, commands and code.

It is built for battery work: 80 nA idle, 350 µA while measuring and 0.4 µA averaged at one reading per second, with a high-precision measurement taking 6.9 ms typical and 8.2 ms at most (pp. 1, 7 to 8). Humidity responds in 6 s and temperature in 2 s to 63 % of a step (pp. 4 to 5).

A built-in heater offers 20, 110 or 200 mW pulses of 0.1 s or 1 s to drive off condensation or creeping offsets, with a maximum on-time of 1 s (pp. 10 to 11). Because the chip is a 3.6 V part, the Adafruit breakout includes a regulator and level shifting so 5 V boards can use it directly (Adafruit guide, pp. 5 to 6).

## Agent rules

Follow these when you wire this part or write code for it.

- Do: Check the order code if a second sensor must share the bus: the AD1B parts answer at 0x44 and the BD1B at 0x45 (datasheet, p. 1).
- Do: Keep the heater off while logging, and never leave it on for more than 1 s at a time (p. 11).
- Do: Put the sensor where air moves and away from the regulator and microcontroller; humidity needs 6 s to reach 63 % of a step (p. 4).
- Do: Power a bare SHT4x board (no regulator) from 3.3 V or less: the chip's range ends at 3.6 V (p. 7).
- Never put 5 V on a bare SHT4x chip or its pins; pins are limited to VDD + 0.3 V (p. 8).
- Never seal the sensor opening with glue, coating or tape: solvents and out-gassing shift humidity readings (p. 4).
- Never run the 200 mW heater continuously; it is meant for short pulses (pp. 10 to 11).
- On an Arduino Uno: This assumes a breakout with a regulator and level shifter, like Adafruit's. A bare SHT4x board is a 3.6 V part (datasheet, p. 7): power it from 3.3V and use a level shifter on SDA and SCL.
- On an ESP32 DevKit V1: Power VIN from 3V3 so the I2C lines are pulled up to 3.3 V.
- On a Raspberry Pi Pico: Power VIN from 3V3(OUT), not VBUS, so the I2C lines stay at 3.3 V.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| VIN | VIN · 3 V to 5 V, equal to your board's logic level | power in |
| 3V | 3V · 3.3 V | power out |
| GND | GND | power in |
| SCL | I2C SCL · Level shifted to VIN | input |
| SDA | I2C SDA · Level shifted to VIN | bidirectional |

## Wiring

### Arduino Uno

| SHT40 | Arduino Uno | Note |
| --- | --- | --- |
| VIN | 5V |  |
| GND | GND |  |
| SCL | A5 |  |
| SDA | A4 |  |

Warning: This assumes a breakout with a regulator and level shifter, like Adafruit's. A bare SHT4x board is a 3.6 V part (datasheet, p. 7): power it from 3.3V and use a level shifter on SDA and SCL.

### ESP32 DevKit V1

| SHT40 | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| SCL | GPIO22 (D22) |  |
| SDA | GPIO21 (D21) |  |

Warning: Power VIN from 3V3 so the I2C lines are pulled up to 3.3 V.

### Raspberry Pi Pico

| SHT40 | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VIN | 3V3(OUT) |  |
| GND | GND |  |
| SCL | GP5 |  |
| SDA | GP4 |  |

Warning: Power VIN from 3V3(OUT), not VBUS, so the I2C lines stay at 3.3 V.

## Code

### Arduino Uno

Libraries: adafruit/Adafruit SHT4x Library, adafruit/Adafruit Unified Sensor

```cpp
// SHT40 on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/sht40
// SHT40 on an Arduino Uno: VIN 5V, SDA A4, SCL A5, address 0x44
#include <Wire.h>
#include <Adafruit_SHT4x.h>

Adafruit_SHT4x sht4;

void setup() {
  Serial.begin(115200);
  Wire.begin();
  if (!sht4.begin(&Wire)) {
    Serial.println("SHT4x not found at 0x44. Check wiring.");
    while (true) delay(10);
  }
  Serial.print("SHT4x serial number 0x");
  Serial.println(sht4.readSerial(), HEX);
  sht4.setPrecision(SHT4X_HIGH_PRECISION);  // 8.2 ms max per reading
  sht4.setHeater(SHT4X_NO_HEATER);
}

void loop() {
  sensors_event_t humidity, temp;
  sht4.getEvent(&humidity, &temp);
  Serial.print("Temperature: ");
  Serial.print(temp.temperature, 2);
  Serial.print(" C   Humidity: ");
  Serial.print(humidity.relative_humidity, 2);
  Serial.println(" %RH");
  delay(2000);
}
```

Compiled for arduino:avr:uno on 2026-10-30.

### ESP32 DevKit V1

Libraries: adafruit/Adafruit SHT4x Library, adafruit/Adafruit Unified Sensor

```cpp
// SHT40 on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/sht40
// SHT40 on an ESP32 DevKit V1: VIN 3V3, SDA GPIO21, SCL GPIO22, address 0x44
#include <Wire.h>
#include <Adafruit_SHT4x.h>

Adafruit_SHT4x sht4;

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22);  // SDA, SCL
  if (!sht4.begin(&Wire)) {
    Serial.println("SHT4x not found at 0x44. Check wiring.");
    while (true) delay(10);
  }
  Serial.print("SHT4x serial number 0x");
  Serial.println(sht4.readSerial(), HEX);
  sht4.setPrecision(SHT4X_HIGH_PRECISION);  // 8.2 ms max per reading
  sht4.setHeater(SHT4X_NO_HEATER);
}

void loop() {
  sensors_event_t humidity, temp;
  sht4.getEvent(&humidity, &temp);
  Serial.print("Temperature: ");
  Serial.print(temp.temperature, 2);
  Serial.print(" C   Humidity: ");
  Serial.print(humidity.relative_humidity, 2);
  Serial.println(" %RH");
  delay(2000);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

### Raspberry Pi Pico

Libraries: adafruit/Adafruit SHT4x Library, adafruit/Adafruit Unified Sensor

```cpp
// SHT40 on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/sht40
// SHT40 on a Raspberry Pi Pico (arduino-pico): VIN 3V3(OUT), SDA GP4, SCL GP5, address 0x44
#include <Wire.h>
#include <Adafruit_SHT4x.h>

Adafruit_SHT4x sht4;

void setup() {
  Serial.begin(115200);
  Wire.setSDA(4);
  Wire.setSCL(5);
  Wire.begin();
  if (!sht4.begin(&Wire)) {
    Serial.println("SHT4x not found at 0x44. Check wiring.");
    while (true) delay(10);
  }
  Serial.print("SHT4x serial number 0x");
  Serial.println(sht4.readSerial(), HEX);
  sht4.setPrecision(SHT4X_HIGH_PRECISION);  // 8.2 ms max per reading
  sht4.setHeater(SHT4X_NO_HEATER);
}

void loop() {
  sensors_event_t humidity, temp;
  sht4.getEvent(&humidity, &temp);
  Serial.print("Temperature: ");
  Serial.print(temp.temperature, 2);
  Serial.print(" C   Humidity: ");
  Serial.print(humidity.relative_humidity, 2);
  Serial.println(" %RH");
  delay(2000);
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Chip supply | 1.08 V to 3.6 V (3.3 V typical) | Sensirion SHT4x datasheet v1 (Oct 2020), p. 7 |
| Pin voltage limit | -0.3 V to VDD + 0.3 V on any pin | Sensirion SHT4x datasheet v1 (Oct 2020), p. 8 |
| I2C address | 0x44 (SHT40-AD1B, the common part); 0x45 on SHT40-BD1B | Sensirion SHT4x datasheet v1 (Oct 2020), p. 1 |
| Humidity accuracy | SHT40 and SHT41 ±1.8 %RH typical; SHT45 ±1.5 %RH; 0 to 100 %RH | Sensirion SHT4x datasheet v1 (Oct 2020), p. 4 |
| Temperature accuracy | SHT40 and SHT41 ±0.2 °C typical; SHT45 ±0.1 °C; -40 to 125 °C | Sensirion SHT4x datasheet v1 (Oct 2020), p. 5 |
| Response time | 6 s humidity, 2 s temperature (to 63 %) | Sensirion SHT4x datasheet v1 (Oct 2020), pp. 4 to 5 |
| Current | 80 nA idle, 350 µA measuring, 0.4 µA average at 1 Hz | Sensirion SHT4x datasheet v1 (Oct 2020), pp. 1, 7 |
| Measurement time | High precision 6.9 ms typical, 8.2 ms max; low precision 1.3 ms typical | Sensirion SHT4x datasheet v1 (Oct 2020), p. 8 |
| Heater | 20, 110 or 200 mW (at 3.3 V) for 0.1 s or 1 s; 1 s maximum on-time | Sensirion SHT4x datasheet v1 (Oct 2020), pp. 10 to 11 |
| Breakout | Regulator and level shifting; VIN at your board's logic level (3 V or 5 V); 3V output | Adafruit SHT40/SHT41/SHT45 guide (PDF), pp. 5 to 6 |

## Circuit notes

- Every reading arrives with a CRC; the library checks it and returns calibrated values in °C and %RH.
- The heater pulses combine with a high-precision measurement at the end of the pulse (p. 10), useful to test that the sensor still responds.
- At 0.4 µA average (p. 1), the sensor's own draw is negligible next to the breakout's regulator and power LED; a coin-cell design should use the bare chip.
- The SHT4x tolerates condensing conditions and recovers (p. 1), but a wet sensor reads 100 %RH until it dries.

## Common mistakes

- **Assuming SHT3x code works.** The SHT4x uses different commands from the SHT31. Use an SHT4x library (Adafruit_SHT4x or Sensirion's), not the SHT31 one, even though both answer at 0x44.
- **Reading high after using the heater.** A 200 mW pulse warms the die for a while. Wait several seconds after any heater pulse before trusting temperature or humidity.
- **Mounting on top of an ESP32.** Self-heating of the board raises temperature and lowers relative humidity. Use a short cable and an edge mount.
- **5 V on a bare module.** Generic SHT40 boards without a regulator are 3.3 V parts. Check for a regulator before connecting VIN to 5 V.

## Questions

### What is the SHT40's I2C address?

0x44 on the standard SHT40-AD1B, which the Adafruit board uses; Sensirion also sells an SHT40-BD1B at 0x45 (SHT4x datasheet v1, p. 1). The address is fixed by the part number, not by a pin.

### SHT40 or SHT31?

The SHT40 is newer, smaller and draws less (0.4 µA average at 1 Hz) with ±1.8 %RH typical against the SHT31's ±2 %RH. The SHT31 runs up to 5.5 V and has an address pin; the SHT40 is a 3.6 V part with the address set by order code.

### SHT40, SHT41 or SHT45?

Same pins and code. The SHT41 has the SHT40's typical accuracy with tighter maximum limits; the SHT45 improves to ±1.5 %RH and ±0.1 °C (pp. 4 to 5). Pick the SHT45 for reference-grade work.

### Can I power the SHT40 from 5 V?

Not the bare chip: 1.08 V to 3.6 V (p. 7). The Adafruit breakout's regulator and level shifting make it safe on a 5 V Uno.

### What is the heater for?

Short heating pulses (20, 110 or 200 mW for 0.1 s or 1 s) drive off condensation and creep after long high-humidity exposure (pp. 10 to 11).

## Related parts

- [SHT31](https://www.tinkered.ai/components/sht31.md): Previous generation, runs up to 5.5 V
- [AHT20](https://www.tinkered.ai/components/aht20.md): Low-cost I2C humidity alternative
- [BME280](https://www.tinkered.ai/components/bme280.md): Adds barometric pressure
- [SCD41 CO₂ Sensor](https://www.tinkered.ai/components/scd41-co2-sensor.md): CO2 with the same Sensirion style API

## Try it

Tinkered can design a circuit with the SHT40, draw its schematic and check it. Free to start at https://www.tinkered.ai.
