The HDC2080 is a low-power digital humidity and temperature sensor from Texas Instruments. On a CJMCU2080 breakout board, it is one of the easiest ways to add accurate environmental readings to an ESP32 project — greenhouse monitoring, room comfort checks, or a simple data logger.
In this guide we wire the module to an ESP32, install the HDC2080-Arduino library by lime-labs, and stream live readings to the Serial Monitor at 1 Hz, with optional high/low temperature and humidity alerts.
Communication is I2C only — just 4 wires (VCC, GND, SDA, SCL). Default I2C address is
textcode
10x40
.
The CJMCU2080 module is a small purple/blue PCB with the HDC2080 chip, pull-up resistors, and pin headers. It works well with ESP32, Arduino Uno, and other 3.3 V / 5 V boards (the module is usually 3.3 V logic friendly).
HDC2080 vs DHT11/DHT22: I2C sensors like the HDC2080 are often more stable and faster than one-wire DHT sensors, and they share the bus with other I2C devices (OLED, RTC, etc.) on the same two data pins.
What You Will Need
Item
Notes
ESP32 development board
Any 30/36-pin DEVKIT
CJMCU2080 (HDC2080) module
I2C humidity + temperature sensor
Breadboard + jumper wires
Male-to-male or male-to-female
USB data cable
For upload and Serial Monitor
Wiring — CJMCU2080 to ESP32
The HDC2080 uses I2C. On most ESP32 DEVKIT boards, the default I2C pins are:
CJMCU2080 Pin
ESP32 Pin
VCC
3.3V
GND
GND
SDA
GPIO 21
SCL
GPIO 22
Power: Use 3.3V on the ESP32. Do not connect VCC to 5V unless your specific module datasheet says it is 5 V tolerant — most CJMCU2080 boards expect 3.3 V.
Keep wires short and tidy. If readings are noisy, add a 100 nF capacitor between VCC and GND near the sensor module.
CJMCU2080 wired to ESP32 over I2C
Install the Arduino Library
This project uses the community library from lime-labs (fork of the original TI/tinkeringtech HDC2080 code, with fixes for newer ESP32 Arduino cores):
GitHub:github.com/lime-labs/HDC2080-Arduino
Option A — Install from ZIP (easiest)
Open the repo → Code → Download ZIP
In Arduino IDE: Sketch → Include Library → Add .ZIP Library…
Select the downloaded ZIP file
Restart Arduino IDE if prompted
Option B — Manual install
Extract the ZIP folder and rename it to
textcode
1HDC2080
if needed
Copy it into your Arduino libraries folder:
Windows:
textcode
1Documents\Arduino\libraries\
Mac:
textcode
1~/Documents/Arduino/libraries/
Restart Arduino IDE
You should see File → Examples → Custom Libraries → HDC2080 (or similar) after a successful install.
Install esp32 by Espressif Systems in Boards Manager
Select DOIT ESP32 DEVKIT V1 (or your board)
Set Serial Monitor to 115200 baud
The Sketch
Create a new sketch and paste the code below. It:
Initializes the sensor at I2C address
textcode
10x40
Resets and configures a comfort zone (temp 22–36 °C, humidity 40–55 %)
Sets 14-bit resolution and 1 Hz measurement rate
Prints temperature and humidity every second
Checks interrupt status flags for threshold breaches
cppcode
1#include<HDC2080.h>2#defineADDR0x403HDC2080 sensor(ADDR);4voidsetup(){5 Serial.begin(115200);6while(!Serial);// Remove this line if upload hangs on ESP32 without USB serial7// Initialize I2C communication8 sensor.begin();9// Begin with a device reset10 sensor.reset();11// Set up the comfort zone12 sensor.setHighTemp(36);// High temperature of 36°C13 sensor.setLowTemp(22);// Low temperature of 22°C14 sensor.setHighHumidity(55);// High humidity of 55%15 sensor.setLowHumidity(40);// Low humidity of 40%16// Configure measurements17 sensor.setMeasurementMode(TEMP_AND_HUMID);18 sensor.setRate(ONE_HZ);19 sensor.setTempRes(FOURTEEN_BIT);20 sensor.setHumidRes(FOURTEEN_BIT);21// Begin measuring22 sensor.triggerMeasurement();23}24voidloop(){25 Serial.print("Temperature (C): ");26 Serial.print(sensor.readTemp());27 Serial.print("\t\tHumidity (%): ");28 Serial.println(sensor.readHumidity());29uint8_t status = sensor.readInterruptStatus();30if(status &0x40){31 Serial.println("High Temperature threshold breached!");32}33if(status &0x20){34 Serial.println("Low Temperature threshold breached!");35}36if(status &0x10){37 Serial.println("High Humidity threshold breached!");38}39if(status &0x08){40 Serial.println("Low Humidity threshold breached!");41}42delay(1000);43}