> Source: https://www.tinkered.ai/components/sht31 (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/sht31. 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

# SHT31

A Sensirion SHT31 breakout that reads relative humidity and temperature over I2C with ±2 %RH and ±0.2 °C typical accuracy.

Source page: https://www.tinkered.ai/components/sht31
Datasheet: https://sensirion.com/media/documents/213E6A3B/63A5A569/Datasheet_SHT3x_DIS.pdf

## In short

The SHT31 is Sensirion's digital humidity and temperature sensor, typically accurate to ±2 %RH and ±0.2 °C from 0 to 90 °C, running from 2.15 V to 5.5 V (Sensirion SHT3x-DIS datasheet v7, pp. 2, 6). It talks I2C at address 0x44, or 0x45 with ADDR tied high (p. 9). The Adafruit SHT31-D breakout has no regulator: power VIN from your board's logic voltage (5V on an Uno, 3.3 V on an ESP32 or Pico), because its 10 kΩ SDA and SCL pull-ups go to VIN.

The SHT31 is the middle grade of Sensirion's SHT3x family: the SHT30 is cheaper and looser, the SHT35 tighter. It reports humidity across 0 to 100 %RH with 0.01 %RH resolution and temperature from -40 to 125 °C, with a typical accuracy of ±2 %RH and ±0.2 °C between 0 and 90 °C (Sensirion datasheet v7, p. 2). Each sensor is calibrated and linearized at the factory, and every reading arrives with a CRC byte.

Unlike most humidity chips, the SHT31 runs directly from 2.15 V to 5.5 V (p. 6), so the Adafruit SHT31-D breakout skips the regulator and level shifter: VIN powers the chip and pulls SDA and SCL up through 10 kΩ, which puts the I2C lines at whatever voltage you feed VIN (Adafruit SHT31-D guide, pp. 6 to 7). Feed it the same voltage your microcontroller's pins use.

A high-repeatability measurement takes 12.5 ms typical and 15 ms at most (p. 7). Between measurements the chip idles at 0.2 µA typical, so it suits battery loggers. An on-chip heater (3.6 to 33 mW, p. 6) can drive off condensation or test that the sensor responds; it also warms the die, so temperature reads high while it is on.

## Agent rules

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

- Do: Power VIN from the same voltage your board's I/O uses (5V on an Uno, 3.3 V on an ESP32 or Pico): the breakout's 10 kΩ pull-ups tie SDA and SCL to VIN (Adafruit SHT31-D guide, p. 6).
- Do: Leave ADR unconnected for address 0x44, or tie it to VIN for 0x45 so two sensors can share one bus (Sensirion datasheet, p. 9).
- Do: Keep the sensor away from the board's regulator and the microcontroller, and give it airflow: humidity takes 8 s to reach 63 % of a step even at 1 m/s (datasheet, p. 2).
- Do: Switch the heater off before logging temperature; it dissipates up to 33 mW (p. 6) and warms the die.
- Never feed VIN from 5 V when the board is an ESP32 or a Pico: the I2C lines would sit at 5 V.
- Never exceed 6 V on VIN, the absolute maximum (datasheet, p. 7).
- Never cover the sensor opening with conformal coat, glue or tape: Sensirion warns that out-gassing tapes and adhesives make the humidity reading drift (p. 2).
- On an ESP32 DevKit V1: Keep VIN on 3V3, never VIN or 5 V: this breakout's pull-ups go to VIN and would put 5 V on GPIO21 and GPIO22.
- On a Raspberry Pi Pico: Keep VIN on 3V3(OUT), never VBUS or VSYS: the pull-ups go to VIN and the Pico's pins are not 5 V tolerant.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| VIN | VIN · 2.5 V to 5 V, equal to your board's logic level | power in |
| GND | GND | power in |
| SCL | I2C SCL · Pulled up to VIN through 10 kΩ | input |
| SDA | I2C SDA · Pulled up to VIN through 10 kΩ | bidirectional |
| ADR | I2C address select | input |
| ALR | Alert interrupt | output |
| RST | Reset (active low) | input |

## Wiring

### Arduino Uno

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

### ESP32 DevKit V1

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

Warning: Keep VIN on 3V3, never VIN or 5 V: this breakout's pull-ups go to VIN and would put 5 V on GPIO21 and GPIO22.

### Raspberry Pi Pico

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

Warning: Keep VIN on 3V3(OUT), never VBUS or VSYS: the pull-ups go to VIN and the Pico's pins are not 5 V tolerant.

## Code

### Arduino Uno

Libraries: adafruit/Adafruit SHT31 Library

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

Adafruit_SHT31 sht31;

void setup() {
  Serial.begin(115200);
  Wire.begin();
  if (!sht31.begin(0x44)) {
    Serial.println("SHT31 not found at 0x44. Check wiring and ADR.");
    while (true) delay(10);
  }
  sht31.heater(false);
  Serial.println("SHT31 ready");
}

void loop() {
  float tempC, humidity;
  if (sht31.readBoth(&tempC, &humidity)) {
    Serial.print("Temperature: ");
    Serial.print(tempC, 2);
    Serial.print(" C   Humidity: ");
    Serial.print(humidity, 2);
    Serial.println(" %RH");
  } else {
    Serial.println("Read failed (CRC or bus error)");
  }
  delay(2000);
}
```

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

### ESP32 DevKit V1

Libraries: adafruit/Adafruit SHT31 Library

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

Adafruit_SHT31 sht31;

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22);  // SDA, SCL
  if (!sht31.begin(0x44)) {
    Serial.println("SHT31 not found at 0x44. Check wiring and ADR.");
    while (true) delay(10);
  }
  sht31.heater(false);
  Serial.println("SHT31 ready");
}

void loop() {
  float tempC, humidity;
  if (sht31.readBoth(&tempC, &humidity)) {
    Serial.printf("Temperature: %.2f C   Humidity: %.2f %%RH\n", tempC, humidity);
  } else {
    Serial.println("Read failed (CRC or bus error)");
  }
  delay(2000);
}
```

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

### Raspberry Pi Pico

Libraries: adafruit/Adafruit SHT31 Library

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

Adafruit_SHT31 sht31(&Wire);

void setup() {
  Serial.begin(115200);
  Wire.setSDA(4);
  Wire.setSCL(5);
  Wire.begin();
  if (!sht31.begin(0x44)) {
    Serial.println("SHT31 not found at 0x44. Check wiring and ADR.");
    while (true) delay(10);
  }
  sht31.heater(false);
  Serial.println("SHT31 ready");
}

void loop() {
  float tempC, humidity;
  if (sht31.readBoth(&tempC, &humidity)) {
    Serial.print("Temperature: ");
    Serial.print(tempC, 2);
    Serial.print(" C   Humidity: ");
    Serial.print(humidity, 2);
    Serial.println(" %RH");
  } else {
    Serial.println("Read failed (CRC or bus error)");
  }
  delay(2000);
}
```

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

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Supply voltage | 2.15 V to 5.5 V (3.3 V typical) | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 6 |
| Absolute maximum | -0.3 V to 6 V on VDD; SDA, SCL, ADDR, ALERT at most VDD + 0.3 V | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 7 |
| I2C address | 0x44 (ADDR low, default) or 0x45 (ADDR high) | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 9 |
| I2C clock | Up to 1000 kHz | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 8 |
| Humidity accuracy (SHT31) | ±2 %RH typical, 0.01 %RH resolution, 0 to 100 %RH specified range | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 2 |
| Temperature accuracy (SHT31) | ±0.2 °C typical from 0 to 90 °C; specified range -40 to 125 °C | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 2 |
| Humidity response time | 8 s to 63 % of a step (25 °C, 1 m/s airflow) | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 2 |
| Supply current | 0.2 µA typical idle (single shot), 600 µA typical while measuring (1500 µA max) | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 6 |
| Measurement time | 12.5 ms typical, 15 ms max at high repeatability | Sensirion SHT3x-DIS datasheet v7 (Dec 2022), p. 7 |
| Breakout pull-ups | 10 kΩ from SDA and SCL to VIN; ADR pulled down (0x44); RST pulled up | Adafruit SHT31-D breakout guide (PDF), pp. 6 to 7 |

## Circuit notes

- The SHT31 needs no regulator: it runs from 2.15 V to 5.5 V (datasheet, p. 6), so the breakout passes VIN straight to the chip.
- SDA and SCL already have 10 kΩ pull-ups to VIN on the breakout. With several I2C boards on one bus the pull-ups add in parallel; above three or four boards, remove some or check the rise time.
- The I2C bus may run up to 1000 kHz (p. 8); the default 100 kHz of every Arduino core is fine.
- ALR is an alert output you can program with humidity and temperature limits; leave it unconnected if you only poll.
- The 0x44 and 0x45 addresses are the only two, so a third SHT31 needs an I2C multiplexer or a second bus.

## Common mistakes

- **Powering the breakout from 5 V on a 3.3 V board.** This board has no level shifter: its pull-ups go to VIN. Wire VIN to 5 V on an ESP32 or Pico and SDA and SCL idle at 5 V on 3.3 V pins. Use the board's 3.3 V pin instead.
- **Mounting it next to something warm.** A sensor taped to the back of an ESP32 or a regulator reads several degrees high and its relative humidity low, since RH falls as the air around the die warms. Put it on a short cable or at the edge of the enclosure, in moving air.
- **Leaving the heater on.** The heater is for de-fogging and self-test. If a reading looks too warm and too dry, call heater(false) and check isHeaterEnabled().
- **Scanning for 0x40 or 0x76.** Those are other sensors' addresses. The SHT31 answers only at 0x44 (ADR low) or 0x45 (ADR high), per the datasheet, p. 9.

## Questions

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

0x44 by default, with ADR low; tie ADR to VIN and it moves to 0x45 (Sensirion datasheet v7, p. 9). The Adafruit breakout pulls ADR low through 10 kΩ, so it answers at 0x44 out of the box.

### Does the SHT31 work at 5 V?

Yes. The chip runs from 2.15 V to 5.5 V (datasheet, p. 6), so on an Uno you can power the breakout from 5V. On a 3.3 V board, power it from 3.3 V instead, because the I2C pull-ups follow VIN.

### SHT31 or DHT22?

The SHT31 is the better sensor: ±2 %RH and ±0.2 °C typical (datasheet, p. 2), a standard I2C bus with CRC-checked data, and 12.5 ms per measurement. The DHT22 uses a timing-critical one-wire protocol and allows one reading every two seconds.

### What is the difference between the SHT30, SHT31 and SHT35?

The same package and commands with different accuracy grades: ±2 %RH for the SHT30 and SHT31, ±1.5 %RH for the SHT35, and ±0.2 °C for the SHT30 and SHT31 over different ranges (0 to 65 °C and 0 to 90 °C), ±0.1 °C for the SHT35 (datasheet, p. 2). Code written for one runs on the others.

### Why does my humidity reading creep up after a humid night?

Long stays above 80 %RH can offset the reading temporarily, about +3 %RH after 60 hours (datasheet, p. 6). Back in 20 to 80 %RH the sensor recovers to its calibration by itself, and the heater can speed that up.

## Related parts

- [AHT20](https://www.tinkered.ai/components/aht20.md): Cheaper I2C humidity sensor at a fixed 0x38 address
- [BME280](https://www.tinkered.ai/components/bme280.md): Adds barometric pressure to humidity and temperature
- [DHT22](https://www.tinkered.ai/components/dht22.md): The classic one-wire humidity sensor it usually replaces
- [SCD41 CO₂ Sensor](https://www.tinkered.ai/components/scd41-co2-sensor.md): Pairs with it for a full indoor air monitor
- [OLED 128×64](https://www.tinkered.ai/components/oled-128x64.md): Shares the I2C bus to show the readings

## Try it

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