SHT30 Temperature and Humidity Sensor

View on Amazon
Overview
About SHT30 Temperature and Humidity Sensor
The SHT30, developed by Sensirion, is a high-precision digital sensor designed for temperature and humidity measurement. With excellent long-term stability and reliability, it is ideal for HVAC systems, data loggers, and weather stations.
⚡ Key Features
- High Accuracy – ±2% RH (humidity) and ±0.3°C (temperature).
- I²C Communication – Easy integration with ESP32, Arduino, and other microcontrollers.
- Long-Term Stability – Ensures consistent performance over time.
- Versatile Applications – Used in climate control, industrial monitoring, and smart home systems.
With its reliability and precision, the SHT30 is a great choice for environmental sensing applications. 🚀
For enhanced performance and additional features, consider the SHT31 sensor, which offers improved accuracy and response time.
Get Your SHT30
💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
SHT30 Specifications
Complete technical specification details for SHT30 Temperature and Humidity Sensor
📊 Technical Parameters
SHT30 Pinout
The SHT30 uses standard I²C communication with 4 pins, featuring wider voltage range (2.4V-5.5V).
Visual Pinout Diagram

Pin Types
Quick Tips
Standard I²C interface for easy integration,📡 Default I²C address is 0x44 or 0x45 (configurable)
Excellent accuracy: ±0.2°C temp, ±2% humidity,⚡ Wide voltage range (2.4V-5.5V) works with 3.3V and 5V systems
Professional-grade sensor with fast measurements
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 VDD | Power | Power supply input (2.4V to 5.5V) | Wide voltage range for flexible power options |
2 GND | Power | Ground connection | Connect to ESP32 ground |
3 SDA | Communication | I²C data line | Bidirectional data communication |
4 SCL | Communication | I²C clock line | Clock signal from master device |
Wiring SHT30 to ESP32
Connect the SHT30 using standard I²C interface for high-precision measurements.
Pin Connections
| SHT30 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 VDD Required | 3.3V | Power supply (2.4V to 5.5V supported) | |
2 GND Required | GND | Ground connection | |
3 SDA Required | GPIO21 | I²C data line (default SDA) | |
4 SCL Required | GPIO22 | I²C clock line (default SCL) |
GPIO21/22 are default I²C pins on ESP32
I²C address is 0x44 or 0x45 (check your module)
Add 10kΩ pull-up resistors on SDA/SCL if needed
Can share I²C bus with other devices
SHT30 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The SHT30 sensor functions correctly upon initial power-up but fails to be detected on the I2C bus after pressing the Arduino reset button or uploading new code. The serial monitor displays: Couldn't find SHT31.
Possible causes include the sensor not resetting properly when the Arduino is reset, leading to communication issues.
Solution: Implement a power cycle for the sensor by briefly disconnecting and reconnecting its power supply after resetting the Arduino. This ensures both the Arduino and the sensor initialize correctly. Alternatively, consider adding a manual reset mechanism for the sensor or using a microcontroller that can control the sensor's power line programmatically. ([forums.adafruit.com](https://forums.adafruit.com/viewtopic.php?t=196956))
Issue: When using the LOLIN Wemos SHT30 Shield with ESPHome, the following error message is encountered: Communication with SHT3xD failed!.
Possible causes include incorrect I2C pin configuration, insufficient pull-up resistors, or improper initialization in the software.
Solution: Verify that the correct I2C pins are configured in the ESPHome YAML file, matching the hardware connections. Ensure that appropriate pull-up resistors (typically 4.7kΩ) are present on the SDA and SCL lines. Confirm that the sensor is properly initialized in the code, and consider testing with different I2C frequencies if issues persist. ([community.home-assistant.io](https://community.home-assistant.io/t/solved-lolin-wemos-sht30-shield-not-working-communication-with-sht3xd-failed-esphome/331751))
Issue: When interfacing the SHT30 sensor with ESP32 Pico using MicroPython, the following error occurs: SHT30Error: Bus error.
Possible causes include incorrect I2C address configuration, improper pin assignments, or missing initialization parameters in the I2C setup.
Solution: Ensure that the correct I2C address (typically 0x44) is specified in the code. Verify that the SDA and SCL pins are correctly assigned and correspond to the physical connections. Modify the I2C initialization to include the bus ID parameter, for example: self.i2c = I2C(0, scl=Pin(scl_pin), sda=Pin(sda_pin)). Adding appropriate pull-up resistors on the I2C lines may also help resolve the issue. ([github.com](https://github.com/rsc1975/micropython-sht30/issues/3))
Issue: The SHT30 sensor fails to generate readings when placed outside a Faraday cage, but functions correctly inside it. The serial monitor may display: Failed to read temperature and Failed to read humidity.
Possible causes include electromagnetic interference (EMI) affecting sensor performance when not shielded.
Solution: To mitigate EMI, consider enclosing the sensor in a grounded metal enclosure or Faraday cage during operation. Ensure that the sensor's wiring is properly shielded and kept away from sources of electromagnetic noise, such as high-frequency circuits or wireless transmitters. Additionally, verify that the sensor's power supply is stable and free from noise. ([forum.arduino.cc](https://forum.arduino.cc/t/sht30-sensor-not-generating-readings/1157377))
Debugging Tips
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Additional Resources
SHT30 Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <Wire.h>
#include "Adafruit_SHT31.h"
Adafruit_SHT31 sht31 = Adafruit_SHT31();
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
if (!sht31.begin(0x44)) { // Set to 0x45 for alternate i2c addr
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
}
void loop() {
float t = sht31.readTemperature();
float h = sht31.readHumidity();
if (!isnan(t) && !isnan(h)) { // check if 'is not a number'
Serial.print("Temp *C = "); Serial.print(t); Serial.print(" ");
Serial.print("Hum. % = "); Serial.println(h);
} else {
Serial.println("Failed to read from SHT31 sensor");
}
delay(1000);
}#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/i2c.h"
#define I2C_MASTER_SCL_IO 22 /*!< GPIO number used for I2C master clock */
#define I2C_MASTER_SDA_IO 21 /*!< GPIO number used for I2C master data */
#define I2C_MASTER_NUM I2C_NUM_0 /*!< I2C master I2C port number */
#define I2C_MASTER_FREQ_HZ 100000 /*!< I2C master clock frequency */
#define SHT30_SENSOR_ADDR 0x44 /*!< SHT30 I2C address */
static esp_err_t i2c_master_init(void) {
i2c_config_t conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = I2C_MASTER_SDA_IO,
.scl_io_num = I2C_MASTER_SCL_IO,
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
.master.clk_speed = I2C_MASTER_FREQ_HZ,
};
esp_err_t err = i2c_param_config(I2C_MASTER_NUM, &conf);
if (err != ESP_OK) {
return err;
}
return i2c_driver_install(I2C_MASTER_NUM, conf.mode, 0, 0, 0);
}
void read_sht30_sensor() {
uint8_t data[6];
i2c_master_write_read_device(I2C_MASTER_NUM, SHT30_SENSOR_ADDR, NULL, 0, data, sizeof(data), pdMS_TO_TICKS(1000));
uint16_t temp_raw = (data[0] << 8) | data[1];
uint16_t hum_raw = (data[3] << 8) | data[4];
float temperature = -45 + 175 * ((float)temp_raw / 65535.0);
float humidity = 100 * ((float)hum_raw / 65535.0);
printf("Temperature: %.2f °C, Humidity: %.2f %%\n", temperature, humidity);
}
void app_main() {
ESP_ERROR_CHECK(i2c_master_init());
while (1) {
read_sht30_sensor();
vTaskDelay(pdMS_TO_TICKS(2000));
}
}i2c:
sda: GPIO21
scl: GPIO22
scan: true
sensor:
- platform: sht3x
address: 0x44
temperature:
name: "Room Temperature"
humidity:
name: "Room Humidity"
update_interval: 60splatformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
adafruit/Adafruit SHT31 Library @ ^1.1.0
monitor_speed = 115200main.cpp
#include <Wire.h>
#include "Adafruit_SHT31.h"
Adafruit_SHT31 sht31 = Adafruit_SHT31();
void setup() {
Serial.begin(115200);
if (!sht31.begin(0x44)) {
Serial.println("Couldn't find SHT30 sensor. Check wiring!");
while (1);
}
Serial.println("SHT30 initialized.");
}
void loop() {
float temperature = sht31.readTemperature();
float humidity = sht31.readHumidity();
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 from SHT30 sensor!");
}
delay(2000);
}from machine import Pin, I2C
from time import sleep
import sht31
# Initialize I2C (SDA=21, SCL=22)
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
sensor = sht31.SHT31(i2c)
print("SHT30 Sensor Example")
while True:
temperature, humidity = sensor.measure()
print("Temperature: {:.2f} °C".format(temperature))
print("Humidity: {:.2f} %".format(humidity))
sleep(2)Wrapping Up SHT30
The ESP32 SHT30 Temperature and Humidity Sensor is a powerful environment sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.
Best Practices
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Safety First
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.
Ready to Start Building?
Now that you have all the information you need, it's time to integrate the SHT30 into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the SHT30? Check out these similar sensors that might fit your project needs.

SHT11 Temperature and Humidity Sensor
The SHT11 is a high-precision digital temperature and humidity sensor that offers fully calibrated digital output. Its compact design, low...

BMP280 Barometric Pressure and Temperature Sensor
The BMP280 is a high-precision digital barometric pressure and temperature sensor, ideal for weather monitoring, altimetry, and navigation....

BME688 Environmental Sensor
The BME688 is a compact environmental sensor that measures temperature, humidity, barometric pressure, and gas concentrations. With...





