SHTC3 Temperature and Humidity Sensor

View on Amazon
Overview
About SHTC3 Temperature and Humidity Sensor
The SHTC3, developed by Sensirion, is a high-accuracy digital temperature and humidity sensor optimized for battery-powered applications. With its low power consumption and compact design, it is ideal for IoT devices, consumer electronics, and portable applications.
⚡ Key Features
- Energy-Efficient – Designed for low-power operation, perfect for battery-driven devices.
- High Accuracy & Stability – Delivers precise temperature and humidity readings.
- I²C Communication – Seamless integration with ESP32, Arduino, and embedded systems.
- Compact & Lightweight – Ideal for wearables, smart home devices, and portable monitoring systems.
With its low power consumption and high precision, the SHTC3 is an excellent choice for energy-efficient climate sensing applications. 🚀
Get Your SHTC3
💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
SHTC3 Specifications
Complete technical specification details for SHTC3 Temperature and Humidity Sensor
📊 Technical Parameters
SHTC3 Pinout
The **SHTC3** has a simple 4-pin I²C interface for ultra-compact temperature and humidity sensing:
Visual Pinout Diagram

Pin Types
Quick Tips
**Interface**: I²C (Two-Wire Interface) for simple connectivity,📡 **I²C Address**: 0x70 (fixed, not configurable)
**Pull-up Resistors**: 10kΩ recommended on SDA and SCL lines,⚡ **Power**: Ultra-low voltage operation (1.62V–3.6V)
**Energy Efficient**: Designed for battery-powered IoT applications
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 VDD | Power | Power supply voltage | 1.62V to 3.6V (ultra-low power) |
2 GND | Power | Ground reference | |
3 SDA | Communication | I²C Serial Data Line | Bidirectional data |
4 SCL | Communication | I²C Serial Clock Line | Master clock signal |
Wiring SHTC3 to ESP32
To interface the **SHTC3** sensor with an **ESP32** using I²C:
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| SHTC3 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 VDD Required | 3.3V | Power supply | |
2 GND Required | GND | Ground | |
3 SDA Required | GPIO21 | I²C data line (default) | |
4 SCL Required | GPIO22 | I²C clock line (default) |
**Pull-up Resistors**: Use 10kΩ resistors between SDA/SCL and VDD for reliable communication
**I²C Pins**: GPIO21 (SDA) and GPIO22 (SCL) are default but can be changed in ESPHome config
**Low Power**: Ideal for battery-powered devices with minimal current draw
**Single Address**: Fixed I²C address 0x70 (no address conflicts with most other sensors)
SHTC3 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: When using the SHTC3 sensor with ESPHome, the following error message appears in the logs: [E][shtcx:059]: Communication with SHTCx failed!. This issue leads to the sensor failing to provide temperature and humidity data on the dashboard.
Possible causes include the sensor not handling restarts properly, resulting in communication failures.
Solution: The SHTC3 sensor may require a power cycle to re-establish communication. Disconnecting and reconnecting the sensor's power supply can help. Additionally, ensure that the sensor's connections are secure and that the I2C bus is properly configured.
Issue: The SHTC3 sensor is incorrectly detected as an SHTC1, leading to improper initialization and data retrieval.
Possible causes include the sensor's identification register returning a value that is not correctly interpreted by the ESPHome integration.
Solution: Update ESPHome to the latest version, as recent updates may have addressed this identification issue. If the problem persists, consider manually specifying the sensor type in the configuration or reaching out to the ESPHome community for further assistance.
s
Issue: When the SHTC3 sensor shares the I2C bus with other devices, communication may hang, causing the microcontroller to become unresponsive.
Possible causes include bus contention or insufficient handling of I2C communication timeouts.
Solution: Implement a timeout mechanism in the I2C read operations to prevent indefinite blocking. Additionally, ensure that each device on the I2C bus has a unique address and that proper pull-up resistors are in place.
Issue: Following a microcontroller reset, the SHTC3 sensor fails to initialize, resulting in errors during sensor setup.
Possible causes include the sensor remaining in sleep mode and not responding to initialization commands.
Solution: Modify the initialization sequence to include a wake-up command before any further communication with the sensor. This adjustment ensures that the sensor is active and ready to receive commands after a reset.
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
SHTC3 Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <Wire.h>
#include "Adafruit_SHTC3.h"
Adafruit_SHTC3 shtc3;
void setup() {
Serial.begin(115200);
if (!shtc3.begin()) {
Serial.println("Couldn't find SHTC3 sensor!");
while (1) delay(10);
}
Serial.println("SHTC3 initialized");
}
void loop() {
sensors_event_t humidity, temp;
if (!shtc3.getEvent(&humidity, &temp)) {
Serial.println("Failed to read sensor data");
return;
}
Serial.print("Temperature: "); Serial.print(temp.temperature); Serial.println(" °C");
Serial.print("Humidity: "); Serial.print(humidity.relative_humidity); Serial.println(" %");
delay(2000);
}#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/i2c.h"
#define I2C_MASTER_SCL_IO 22 /*!< GPIO number for I2C master clock */
#define I2C_MASTER_SDA_IO 21 /*!< GPIO number for I2C master data */
#define I2C_MASTER_NUM I2C_NUM_0 /*!< I2C master port */
#define I2C_MASTER_FREQ_HZ 100000 /*!< I2C master clock frequency */
#define SHTC3_SENSOR_ADDR 0x70 /*!< SHTC3 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_ERROR_CHECK(i2c_param_config(I2C_MASTER_NUM, &conf));
return i2c_driver_install(I2C_MASTER_NUM, conf.mode, 0, 0, 0);
}
void read_shtc3_sensor() {
uint8_t data[6];
uint8_t cmd[] = {0x7C, 0xA2}; // Measurement command
i2c_master_write_to_device(I2C_MASTER_NUM, SHTC3_SENSOR_ADDR, cmd, 2, pdMS_TO_TICKS(1000));
vTaskDelay(pdMS_TO_TICKS(20));
i2c_master_read_from_device(I2C_MASTER_NUM, SHTC3_SENSOR_ADDR, data, 6, 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_shtc3_sensor();
vTaskDelay(pdMS_TO_TICKS(2000));
}
}sensor:
- platform: shtc3
temperature:
name: "Room Temperature"
humidity:
name: "Room Humidity"
update_interval: 60splatformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
adafruit/Adafruit SHTC3 Library @ ^1.0.0
monitor_speed = 115200main.cpp
#include <Wire.h>
#include "Adafruit_SHTC3.h"
Adafruit_SHTC3 shtc3;
void setup() {
Serial.begin(115200);
if (!shtc3.begin()) {
Serial.println("Couldn't find SHTC3 sensor!");
while (1) delay(10);
}
Serial.println("SHTC3 initialized.");
}
void loop() {
sensors_event_t temp, humidity;
if (!shtc3.getEvent(&humidity, &temp)) {
Serial.println("Failed to read sensor data");
return;
}
Serial.print("Temperature: ");
Serial.print(temp.temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity.relative_humidity);
Serial.println(" %");
delay(2000);
}from machine import I2C, Pin
from time import sleep
# Initialize I2C interface
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
# SHTC3 I2C address
SHTC3_ADDR = 0x70
# Command for measurement
MEASURE_CMD = b'\x7C\xA2'
while True:
try:
i2c.writeto(SHTC3_ADDR, MEASURE_CMD)
sleep(0.02) # Wait for measurement to complete
data = i2c.readfrom(SHTC3_ADDR, 6)
raw_temp = (data[0] << 8) | data[1]
raw_hum = (data[3] << 8) | data[4]
temperature = -45 + 175 * (raw_temp / 65535.0)
humidity = 100 * (raw_hum / 65535.0)
print("Temperature: {:.2f} °C".format(temperature))
print("Humidity: {:.2f} %".format(humidity))
except Exception as e:
print("Error reading SHTC3: ", e)
sleep(2)Wrapping Up SHTC3
The ESP32 SHTC3 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 SHTC3 into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the SHTC3? Check out these similar sensors that might fit your project needs.

DHT21 / AM2301A Temperature and Humidity Sensor
The DHT21 is a reliable sensor for measuring temperature and humidity, offering calibrated digital output and ease of integration with...

SHT45 Temperature and Humidity Sensor
The SHT45 is a high-accuracy digital temperature and humidity sensor with a compact design and low power consumption. Its I²C interface and...

AHT10 Temperature and Humidity Sensor
The AHT10 is an advanced, fully calibrated, and highly integrated temperature and humidity sensor that provides reliable, precise...





