HDC1080 / GY-213V-HDC1080 Temperature and Humidity Sensor

View on Amazon
Overview
About HDC1080 / GY-213V-HDC1080 Temperature and Humidity Sensor
The HDC1080, developed by Texas Instruments, is a high-accuracy digital humidity and temperature sensor designed for low-power applications. With factory-calibrated sensors and a wide supply voltage range, it offers a cost-effective and energy-efficient solution for various environmental monitoring applications.
⚡ Key Features
- Low Power Consumption – Ideal for battery-powered IoT and embedded systems.
- Factory-Calibrated Sensors – Ensures high accuracy without additional calibration.
- Wide Operating Voltage – Compatible with various power sources.
- I²C Communication – Simple integration with ESP32, Arduino, and other microcontrollers.
With its efficient power usage and reliable performance, the HDC1080 is a great choice for climate control, smart home devices, and portable monitoring applications. 🚀
Get Your HDC1080 / GY-213V-HDC1080
💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
HDC1080 / GY-213V-HDC1080 Specifications
Complete technical specification details for HDC1080 / GY-213V-HDC1080 Temperature and Humidity Sensor
📊 Technical Parameters
HDC1080 / GY-213V-HDC1080 Pinout
The HDC1080 has 4 pins for I²C communication with minimal external components required.
Visual Pinout Diagram

Pin Types
Quick Tips
Object],[object Object]
Object],[object Object]
calibrated - no user calibration required,14-bit resolution for both temp and humidity
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 Pin 1 (GND) | Power | Ground connection. Connect to system ground. | |
2 Pin 2 (VDD) | Power | Power supply voltage (2.7V to 5.5V). Wide voltage range. | Use 3.3V or 5V depending on system. |
3 Pin 3 (SDA) | I2C | I²C Serial Data Line. Bidirectional data communication. | Connect to ESP32 GPIO 21. Requires pull-up resistor. |
4 Pin 4 (SCL) | I2C | I²C Serial Clock Line. Clock signal for I²C communication. | Connect to ESP32 GPIO 22. Requires pull-up resistor. |
Wiring HDC1080 / GY-213V-HDC1080 to ESP32
To interface the HDC1080 with an ESP32 via I²C, connect VDD to 3.3V, GND to ground, SDA to GPIO 21, and SCL to GPIO 22. Add 10kΩ pull-up resistors on SDA and SCL.
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| HDC1080 / GY-213V-HDC1080 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 Pin 2 (VDD) Required | 3.3V | Power supply. Use 3.3V for low-power applications. | |
2 Pin 1 (GND) Required | GND | Ground connection. | |
3 Pin 3 (SDA) Required | GPIO 21 | I²C data line. Add 10kΩ pull-up to VDD. | |
4 Pin 4 (SCL) Required | GPIO 22 | I²C clock line. Add 10kΩ pull-up to VDD. |
Object]
10kΩ pull-up resistors on both SDA and SCL lines
Adafruit_HDC1000 or ClosedCube_HDC1080 library
Object]
calibrated - no user calibration needed
Object]
measure temp and humidity simultaneously or separately
0.1µF bypass capacitor between VDD and GND (close to sensor)
condensing humidity - sensor may require recovery time
HDC1080 / GY-213V-HDC1080 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The HDC1080 sensor reports a constant humidity value of 100%, regardless of the actual environmental conditions.
Possible causes include sensor saturation due to prolonged exposure to high humidity environments or contamination on the sensor's surface.
Solution: Allow the sensor to operate in a controlled, lower humidity environment to facilitate recovery. If the issue persists, consider activating the sensor's internal heater to help eliminate moisture or contaminants. Ensure that the sensor is not exposed to condensing environments, and verify that no physical obstructions or residues are present on the sensor's surface. ([e2e.ti.com](https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/635445/hdc1080-humidity-value-stuck-with-100-no-change))
Issue: Attempts to read temperature and humidity values from the HDC1080 sensor consistently return 0xFFFF, indicating a communication error.
Possible causes include incorrect I2C communication sequences, improper sensor initialization, or issues with the microcontroller's I2C implementation.
Solution: Review the I2C communication sequence to ensure it aligns with the HDC1080 datasheet specifications. Confirm that the sensor's configuration register is correctly set before initiating measurements. Additionally, verify the integrity of the I2C connections and consider testing with a different microcontroller or I2C library to rule out implementation-specific issues. ([e2e.ti.com](https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/677597/hdc1080-temp-and-humidity-always-read-at-0xffff))
Issue: The HDC1080 sensor exhibits humidity measurement errors, with readings deviating by up to +6% from the actual humidity levels.
Possible causes include sensor drift over time, exposure to contaminants, or calibration issues.
Solution: Implement a regular calibration schedule to maintain measurement accuracy. Ensure that the sensor is protected from environmental contaminants and consider using conformal coatings if appropriate. If the sensor has been exposed to harsh conditions, utilize the internal heater to attempt recovery. For critical applications, consider cross-referencing readings with a calibrated reference device. ([e2e.ti.com](https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/621732/hdc1080-humidity-measurement-error-going-up-to-6))
Issue: Multiple HDC1080 sensors in identical conditions report significantly different humidity values, indicating inconsistency among sensors.
Possible causes include manufacturing variances, sensor contamination, or differences in sensor placement leading to micro-environmental discrepancies.
Solution: Perform a controlled comparison by placing all sensors in a stable environment and recording their outputs. Identify and replace any outliers that consistently deviate from the mean. Ensure that all sensors are handled and soldered according to the manufacturer's guidelines to prevent contamination. For applications requiring high precision, consider individual sensor calibration. ([e2e.ti.com](https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/611140/hdc1080-accuracy-issue-with-humidity-sensor))
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
HDC1080 / GY-213V-HDC1080 Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <Wire.h>
#include "ClosedCube_HDC1080.h"
ClosedCube_HDC1080 hdc1080;
void setup() {
Wire.begin();
Serial.begin(9600);
hdc1080.begin(0x40);
}
void loop() {
float temperature = hdc1080.readTemperature();
float humidity = hdc1080.readHumidity();
Serial.print("Temperature: ");
Serial.print(temperature, 2);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity, 2);
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 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 HDC1080_SENSOR_ADDR 0x40 /*!< HDC1080 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_hdc1080_sensor() {
uint8_t data[4];
// Send command to measure temperature and humidity
uint8_t cmd = 0x00; // Temperature measurement command
i2c_master_write_to_device(I2C_MASTER_NUM, HDC1080_SENSOR_ADDR, &cmd, 1, pdMS_TO_TICKS(1000));
vTaskDelay(pdMS_TO_TICKS(15)); // Delay for measurement to complete
// Read 4 bytes of data: temperature (2 bytes) + humidity (2 bytes)
i2c_master_read_from_device(I2C_MASTER_NUM, HDC1080_SENSOR_ADDR, data, 4, pdMS_TO_TICKS(1000));
// Convert temperature and humidity values
uint16_t raw_temp = (data[0] << 8) | data[1];
uint16_t raw_humidity = (data[2] << 8) | data[3];
float temperature = (raw_temp / 65536.0) * 165.0 - 40.0;
float humidity = (raw_humidity / 65536.0) * 100.0;
printf("Temperature: %.2f °C, Humidity: %.2f %%\n", temperature, humidity);
}
void app_main() {
ESP_ERROR_CHECK(i2c_master_init());
while (1) {
read_hdc1080_sensor();
vTaskDelay(pdMS_TO_TICKS(2000));
}
}sensor:
- platform: hdc1080
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
update_interval: 60splatformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
closedcube/ClosedCube HDC1080 @ ^1.1.0
monitor_speed = 115200main.cpp
#include <Wire.h>
#include "ClosedCube_HDC1080.h"
ClosedCube_HDC1080 hdc1080;
void setup() {
Wire.begin();
Serial.begin(115200);
hdc1080.begin(0x40);
Serial.println("HDC1080 initialized.");
}
void loop() {
float temperature = hdc1080.readTemperature();
float humidity = hdc1080.readHumidity();
Serial.print("Temperature: ");
Serial.print(temperature, 2);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity, 2);
Serial.println(" %");
delay(2000);
}from machine import I2C, Pin
from time import sleep
# Initialize I2C
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
# HDC1080 I2C address
HDC1080_ADDR = 0x40
# Function to read temperature and humidity
def read_hdc1080():
i2c.writeto(HDC1080_ADDR, b'\x00') # Command to start measurement
sleep(0.015) # Wait for measurement to complete
data = i2c.readfrom(HDC1080_ADDR, 4) # Read 4 bytes of data
# Convert temperature and humidity data
raw_temp = (data[0] << 8) | data[1]
raw_humidity = (data[2] << 8) | data[3]
temperature = (raw_temp / 65536.0) * 165.0 - 40.0
humidity = (raw_humidity / 65536.0) * 100.0
return temperature, humidity
while True:
temp, hum = read_hdc1080()
print("Temperature: {:.2f} °C".format(temp))
print("Humidity: {:.2f} %".format(hum))
sleep(2)Wrapping Up HDC1080 / GY-213V-HDC1080
The ESP32 HDC1080 / GY-213V-HDC1080 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 HDC1080 / GY-213V-HDC1080 into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the HDC1080 / GY-213V-HDC1080? Check out these similar sensors that might fit your project needs.

HTE501 Temperature and Humidity Sensor
The E+E HTE501 is a digital humidity and temperature sensor designed for high accuracy in demanding environments. Compactly housed in a DFN...

DHT22 / AM2302 Temperature and Humidity Sensor
The DHT22 is a versatile and affordable sensor for measuring temperature and humidity. It provides calibrated digital output and is easy to...

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...





