SHT25 Temperature and Humidity Sensor

View on Amazon
Overview
About SHT25 Temperature and Humidity Sensor
The SHT25, developed by Sensirion, is a high-accuracy digital sensor designed for precise temperature and humidity measurement. With superior stability and reliability, it is ideal for industrial monitoring, HVAC systems, and environmental data logging.
⚡ Key Features
- Superior Accuracy – Higher precision than standard SHT sensors.
- I²C Communication – Seamless integration with ESP32, Arduino, and other microcontrollers.
- Long-Term Stability – Reliable performance for demanding environments.
- Versatile Applications – Used in climate control, industrial automation, and data logging.
🔗 Looking for alternatives? Check out:
Get Your SHT25
Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
SHT25 Specifications
Complete technical specification details for SHT25 Temperature and Humidity Sensor
📊 Technical Parameters
SHT25 Pinout
The SHT25 uses standard I²C communication with 4 pins, offering improved accuracy over SHT20.
Visual Pinout Diagram

Pin Types
Quick Tips
Standard I²C interface for easy integration,📡 Default I²C address is 0x40
Enhanced accuracy over SHT20: ±0.2°C temp, ±2% humidity,⚡ Pull-up resistors (10kΩ) recommended on SDA/SCL
Professional-grade sensor for precision applications
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 VDD | Power | Power supply input (2.1V to 3.6V) | Low voltage operation for battery applications |
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 SHT25 to ESP32
Connect the SHT25 using standard I²C interface for high-precision measurements.
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| SHT25 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 VDD Required | 3.3V | Power supply (2.1V to 3.6V) | |
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 0x40 (standard)
Add 10kΩ pull-up resistors on SDA/SCL if needed
Compatible with SHT20/SHT21 libraries
SHT25 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The SHT25 sensor is expected to have an I2C address of 0x40, but an I2C scanner detects it at 0x38. Attempting to communicate using the standard address results in no response or incorrect data.
Possible causes include counterfeit or mislabeled sensors that do not conform to standard specifications.
Solution: Use the detected I2C address (0x38) in your code instead of the expected 0x40. If communication issues persist, consider verifying the authenticity of the sensor or replacing it with a genuine SHT25 sensor.
Issue: Attempts to read data from the SHT25 sensor over I2C result in receiving 0xF0 or 0x00, indicating unsuccessful communication.
Possible causes include incorrect I2C implementation, timing issues, or improper sensor initialization.
Solution: Ensure that the I2C communication is correctly implemented with appropriate timing delays as specified in the SHT25 datasheet. Verify that the sensor is properly initialized and that the correct commands are being sent. Reviewing and following the sensor's datasheet can provide guidance on proper communication protocols.
Issue: The SHT25 sensor reports temperatures higher than the actual ambient temperature, leading to inaccurate measurements.
Possible causes include heat generated by nearby components affecting the sensor or inadequate ventilation around the sensor.
Solution: Ensure that the sensor is placed away from heat sources and has proper ventilation. Consider implementing software calibration to offset any consistent discrepancies. If the issue persists, consult the sensor's datasheet for recommended operating conditions and verify that the sensor is being used within those parameters.
Issue: When compiling code that interfaces with the SHT25 sensor using the LibHumidity library, errors such as 'class TwoWire' has no member named 'send' and 'class TwoWire' has no member named 'receive' are encountered.
Possible causes include the use of outdated functions in the library that are incompatible with the current Wire library, which now uses write() and read() methods instead of send() and receive().
Solution: Update the LibHumidity library by replacing instances of send() with write() and receive() with read(). Alternatively, consider using a more recent library that supports the SHT25 sensor and is compatible with the current Wire library implementation.
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
SHT25 Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <Wire.h>
#include "SHT2x.h"
SHT2x sht;
void setup() {
Wire.begin();
Serial.begin(9600);
}
void loop() {
float temperature = sht.GetTemperature();
float humidity = sht.GetHumidity();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
delay(2000);
}uint16_t raw_humidity = (data[0] << 8) | data[1];
uint8_t cmd_temp = 0xF3; // Command for temperature measurement
i2c_master_write_to_device(I2C_MASTER_NUM, SHT25_SENSOR_ADDR, &cmd_temp, 1, pdMS_TO_TICKS(1000));
vTaskDelay(pdMS_TO_TICKS(50));
i2c_master_read_from_device(I2C_MASTER_NUM, SHT25_SENSOR_ADDR, data, 3, pdMS_TO_TICKS(1000));
uint16_t raw_temperature = (data[0] << 8) | data[1];
float humidity = -6.0 + 125.0 * ((float)raw_humidity / 65536.0);
float temperature = -46.85 + 175.72 * ((float)raw_temperature / 65536.0);
printf("Temperature: %.2f °C, Humidity: %.2f %%\n", temperature, humidity);
}
void app_main() {
ESP_ERROR_CHECK(i2c_master_init());
while (1) {
read_sht25_sensor();
vTaskDelay(pdMS_TO_TICKS(2000));
}
}sensor:
- platform: sht3x
address: 0x40
temperature:
name: "Indoor Temperature"
humidity:
name: "Indoor Humidity"
update_interval: 60splatformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
"Sensirion/SHT2x"
monitor_speed = 115200main.cpp
#include <Wire.h>
#include "SHT2x.h"
SHT2x sht;
void setup() {
Wire.begin();
Serial.begin(115200);
}
void loop() {
float temperature = sht.GetTemperature();
float humidity = sht.GetHumidity();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
delay(2000);
}from machine import I2C, Pin
from time import sleep
import sht21
# Initialize I2C
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
# Initialize the SHT25 sensor
sensor = sht21.SHT21(i2c)
while True:
try:
temperature = sensor.read_temperature()
humidity = sensor.read_humidity()
print(f"Temperature: {temperature:.2f} °C")
print(f"Humidity: {humidity:.2f} %")
except Exception as e:
print(f"Error reading sensor: {e}")
sleep(2)Wrapping Up SHT25
The ESP32 SHT25 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 SHT25 into your ESP32 project and bring your ideas to life!








