The SHT31, manufactured by Sensirion, is a digital humidity and temperature sensor designed to deliver highly accurate measurements of relative humidity and temperature. It features a high level of precision, low power consumption, and a fast response time. The SHT31 is equipped with a digital I²C interface, making it easy to integrate into a wide range of applications.
Explore Projects Built with SHT31
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit features an Arduino Nano microcontroller interfaced with an Ethernet W5500 module for network connectivity and an SHT31 sensor for temperature and humidity measurements. The Arduino Nano communicates with the Ethernet module via SPI and reads data from the SHT31 sensor using I2C, enabling remote monitoring of environmental conditions.
This circuit integrates an ESP32 microcontroller with a DHT22 temperature and humidity sensor, an Adafruit SHTC3 sensor, and a 2-channel relay module. The ESP32 reads environmental data from the sensors and can control external devices through the relay module.
This circuit features a Nano 3.0 ATmega328P microcontroller connected to an LED dot display, a real-time clock (RTC DS3231), and a humidity and temperature sensor (SHT21). The microcontroller communicates with the RTC and SHT21 via I2C (using A4 and A5 as SDA and SCL lines, respectively), and it controls the LED display through SPI-like signals (using D10, D11, and D12 for DIN, CS, and CLK). The circuit is designed to display time and environmental data on the LED display, with all components sharing a common power supply and ground.
This circuit features an ESP32 microcontroller interfaced with two sensors: a DHT11 for temperature and humidity data, and an AHT10 for more precise temperature and humidity measurements. The ESP32 collects data from these sensors via GPIO pins and I2C communication, respectively, and powers both sensors through its 3.3V and GND pins.
HVAC (Heating, Ventilation, and Air Conditioning) systems
Environmental monitoring
Industrial process control
Smart home devices
Data loggers
Technical Specifications
The SHT31 sensor is designed to provide reliable and precise measurements under various environmental conditions. Below are its key technical details:
Key Specifications
Parameter
Value
Supply Voltage (VDD)
2.4V to 5.5V
Average Current Consumption
2 µA (standby), 150 µA (active)
Humidity Measurement Range
0% to 100% RH
Humidity Accuracy
±2% RH (typical)
Temperature Measurement Range
-40°C to +125°C
Temperature Accuracy
±0.3°C (typical)
Communication Interface
I²C (up to 1 MHz)
Response Time (τ63%)
8 seconds (typical)
Dimensions
2.5 mm x 2.5 mm x 0.9 mm
Pin Configuration
The SHT31 is typically available in a 4-pin package. Below is the pinout description:
Pin Number
Pin Name
Description
1
VDD
Power supply (2.4V to 5.5V)
2
GND
Ground
3
SDA
Serial Data Line for I²C communication
4
SCL
Serial Clock Line for I²C communication
Usage Instructions
The SHT31 is straightforward to use in a circuit, thanks to its I²C interface. Below are the steps and considerations for integrating the sensor:
Circuit Connection
Connect the VDD pin to a 3.3V or 5V power supply.
Connect the GND pin to the ground of your circuit.
Connect the SDA pin to the I²C data line of your microcontroller (e.g., Arduino UNO).
Connect the SCL pin to the I²C clock line of your microcontroller.
Use pull-up resistors (typically 4.7 kΩ) on the SDA and SCL lines if not already present.
Example Code for Arduino UNO
Below is an example Arduino sketch to read temperature and humidity data from the SHT31 sensor using the Adafruit SHT31 library:
#include <Wire.h>
#include "Adafruit_SHT31.h"
// Create an instance of the SHT31 sensor
Adafruit_SHT31 sht31 = Adafruit_SHT31();
void setup() {
Serial.begin(9600); // Initialize serial communication
while (!Serial) delay(10); // Wait for serial monitor to open
// Initialize the SHT31 sensor
if (!sht31.begin(0x44)) { // 0x44 is the default I²C address
Serial.println("Failed to find SHT31 sensor!");
while (1) delay(1); // Halt execution if sensor is not found
}
Serial.println("SHT31 sensor initialized.");
}
void loop() {
// Read temperature and humidity
float temperature = sht31.readTemperature();
float humidity = sht31.readHumidity();
// Check if readings are valid
if (!isnan(temperature) && !isnan(humidity)) {
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
} else {
Serial.println("Failed to read data from SHT31 sensor.");
}
delay(2000); // Wait 2 seconds before the next reading
}
Best Practices
Use decoupling capacitors (e.g., 0.1 µF) near the VDD pin to stabilize the power supply.
Avoid exposing the sensor to extreme conditions (e.g., condensation, dust) to maintain accuracy.
Calibrate the sensor if required for high-precision applications.
Ensure proper pull-up resistors are used on the I²C lines to avoid communication issues.
Troubleshooting and FAQs
Common Issues and Solutions
Sensor Not Detected on I²C Bus
Ensure the correct I²C address (default: 0x44) is used in your code.
Verify the SDA and SCL connections and check for proper pull-up resistors.
Confirm that the power supply voltage is within the specified range (2.4V to 5.5V).
Incorrect or Unstable Readings
Check for noise or instability in the power supply. Use decoupling capacitors if needed.
Ensure the sensor is not exposed to condensation or contaminants.
Verify that the sensor is not placed near heat sources or strong airflow.
Arduino Code Compilation Errors
Ensure the Adafruit SHT31 library is installed in the Arduino IDE.
Verify that the correct board and port are selected in the Arduino IDE.
FAQs
Q: Can the SHT31 operate at 5V?
A: Yes, the SHT31 can operate with a supply voltage between 2.4V and 5.5V, making it compatible with both 3.3V and 5V systems.
Q: What is the default I²C address of the SHT31?
A: The default I²C address is 0x44. Some variants of the sensor may support an alternate address of 0x45.
Q: How can I protect the sensor in harsh environments?
A: Use a protective cover or filter to shield the sensor from dust, water, and other contaminants while allowing air to pass through.
Q: Can the SHT31 measure dew point?
A: The SHT31 does not directly measure dew point, but you can calculate it using the temperature and humidity readings.
By following this documentation, you can effectively integrate and use the SHT31 sensor in your projects.