

The SHT31, manufactured by Sensirion, is a digital humidity and temperature sensor designed for high-precision environmental monitoring. It combines a capacitive humidity sensor and a band-gap temperature sensor on a single chip, providing accurate and reliable measurements. The SHT31 communicates via the I2C interface, making it easy to integrate into a wide range of applications.








The SHT31 sensor offers excellent performance and reliability. Below are its key technical details:
| Parameter | Value |
|---|---|
| Supply Voltage (VDD) | 2.4V to 5.5V |
| Average Current Consumption | 2 µA (at 1 measurement per second) |
| Communication Interface | I2C |
| Humidity Measurement Range | 0% RH to 100% RH |
| Humidity Accuracy | ±2% RH (typical) |
| Temperature Measurement Range | -40°C to +125°C |
| Temperature Accuracy | ±0.3°C (typical) |
| Response Time (τ63%) | 8 seconds (typical) |
| Dimensions | 2.5 mm x 2.5 mm x 0.9 mm |
The SHT31 is typically available in a 4-pin package. Below is the pinout description:
| Pin | Name | Description |
|---|---|---|
| 1 | VDD | Power supply (2.4V to 5.5V) |
| 2 | GND | Ground |
| 3 | SDA | Serial Data Line for I2C communication |
| 4 | SCL | Serial Clock Line for I2C communication |
0x44. Some variants allow changing the address to 0x45 by pulling a specific pin high or low (refer to the datasheet for details).Below is an example of how to interface the SHT31 with an Arduino UNO using the I2C protocol:
#include <Wire.h>
#include "Adafruit_SHT31.h" // Include the Adafruit SHT31 library
Adafruit_SHT31 sht31 = Adafruit_SHT31();
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
if (!sht31.begin(0x44)) { // Initialize the sensor with I2C address 0x44
Serial.println("SHT31 sensor not found. Check wiring!");
while (1); // Halt execution if the sensor is not detected
}
Serial.println("SHT31 sensor initialized successfully.");
}
void loop() {
float temperature = sht31.readTemperature(); // Read temperature in Celsius
float humidity = sht31.readHumidity(); // Read relative humidity
if (!isnan(temperature) && !isnan(humidity)) { // Check for valid readings
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %RH");
} else {
Serial.println("Failed to read from SHT31 sensor!");
}
delay(2000); // Wait for 2 seconds before the next reading
}
Sensor Not Detected:
Inaccurate Readings:
I2C Communication Errors:
Q1: Can the SHT31 operate at 5V?
A1: Yes, the SHT31 supports a supply voltage range of 2.4V to 5.5V.
Q2: How do I protect the sensor from dust and water?
A2: Use a protective filter or housing designed for environmental sensors.
Q3: What is the maximum cable length for I2C communication?
A3: The maximum cable length depends on the pull-up resistor values and the I2C clock speed. For standard applications, keep the cable length under 1 meter to ensure reliable communication.
Q4: Can I use the SHT31 with a 3.3V microcontroller?
A4: Yes, the SHT31 is compatible with 3.3V systems. Ensure the I2C lines are properly connected.
This concludes the documentation for the SHT31 sensor. For further details, refer to the official Sensirion datasheet.