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 package (2.5x2.5 mm), it offers ±1.8% RH and ±0.2 °C accuracy, and features a constant current heater and proprietary coating for stability.

HTE501 Temperature and Humidity Sensor image
HTE501 · I2C
I2C
Interface
5pins
Connections
2.35 - 3.60 V
Supply
±0.2°C
Temp accuracy
±1.8%RH
Humidity accuracy
On this page

HTE501 pinout

5 pins · I2C

The HTE501 is an 8-pin DFN package sensor with I²C interface for temperature and humidity measurement.

View:
HTE501 Temperature and Humidity Sensor pinout
PinTypeDescriptionNotes
Pin 1 (SDA)I2CI²C Serial Data Line. Bidirectional data communication.Connect to ESP32 GPIO 21 (default SDA). Requires pull-up resistor.
Pin 2 (GND)PowerGround connection. Connect to system ground.
Pin 3 (VDD)PowerPower supply input (2.35V-3.60V). Typically use 3.3V.Low voltage sensor - use 3.3V power supply.
Pin 4 (SCL)I2CI²C Serial Clock Line. Clock signal for I²C communication.Connect to ESP32 GPIO 22 (default SCL). Requires pull-up resistor.
Pins 5-8NC/GroundNot connected or ground pads for thermal and mechanical stability.Connect to ground plane on PCB for best performance.
  • I²C address: 0x40 (default, may vary by manufacturer)

  • Operating voltage: 2.35V-3.60V (use 3.3V for ESP32)

  • Temperature accuracy: ±0.2°C

  • Humidity accuracy: ±1.8% RH

  • Operating range: -40°C to +135°C, 0-100% RH

  • 8-pin DFN package (2.5mm x 2.5mm)

  • Includes internal heater for condensation removal

Wiring the HTE501 to ESP32

4 connections · all required

To interface the HTE501 with an ESP32 via I²C, connect VDD to 3.3V, GND to ground, SDA to GPIO 21, and SCL to GPIO 22. Add 4.7kΩ pull-up resistors on SDA and SCL lines.

HTE501 Temperature and Humidity Sensor wiring with ESP32
HTE501 pinESP32 pinPurpose
Pin 3 (VDD)3.3VPower supply (3.3V). Do not exceed 3.6V.
Pin 2 (GND)GNDGround connection.
Pin 1 (SDA)GPIO 21I²C data line. Add 4.7kΩ pull-up to 3.3V.
Pin 4 (SCL)GPIO 22I²C clock line. Add 4.7kΩ pull-up to 3.3V.
  • I²C address: 0x40 (default), verify with I²C scanner

  • Add 4.7kΩ pull-up resistors on both SDA and SCL lines

  • CRITICAL: Use 3.3V power only - exceeding 3.6V will damage sensor

  • Use SHT3x-compatible libraries (similar I²C protocol)

  • Clock stretching: Add 20ms delay after measurement command

  • Add 0.1µF bypass capacitor between VDD and GND (close to sensor)

  • For single-shot measurements: wait 20ms before reading data

  • Heater function: can be activated to remove condensation

  • High accuracy requires stable power and good thermal coupling

HTE501 code examples

5 platforms
Platform:

HTE501 Arduino example

Copy
// The HTE501 is an E+E Elektronik sensor with its own I2C protocol - no external
// library is needed. I2C address 0x40; SDA=GPIO21, SCL=GPIO22 (ESP32 defaults).
#include <Wire.h>

#define HTE501_ADDR 0x40

void setup() {
  Serial.begin(115200);
  Wire.begin(); // SDA=GPIO21, SCL=GPIO22
}

void loop() {
  // Single-shot measurement command 0x2C1B (with I2C clock stretching)
  Wire.beginTransmission(HTE501_ADDR);
  Wire.write(0x2C);
  Wire.write(0x1B);
  if (Wire.endTransmission() == 0) {
    delay(20); // Wait for the measurement to finish

    // Response: T MSB, T LSB, CRC, RH MSB, RH LSB, CRC
    Wire.requestFrom(HTE501_ADDR, 6);
    if (Wire.available() == 6) {
      uint8_t b[6];
      for (int i = 0; i < 6; i++) b[i] = Wire.read();

      int16_t rawTemp = (b[0] << 8) | b[1];      // signed
      uint16_t rawHum = (b[3] << 8) | b[4];
      float temperature = rawTemp / 100.0;       // scaling per E+E datasheet
      float humidity = rawHum / 100.0;

      Serial.print("Temperature: ");
      Serial.print(temperature);
      Serial.println(" C");
      Serial.print("Humidity: ");
      Serial.print(humidity);
      Serial.println(" %");
    }
  } else {
    Serial.println("HTE501 not found - check wiring");
  }
  delay(2000);
}

The HTE501 is an E+E Elektronik sensor with its own I2C protocol - it is not compatible with SHT3x libraries. This sketch needs no library at all: it sends the single-shot measurement command 0x2C1B to address 0x40, reads back six bytes (temperature, humidity, each with a CRC), and applies the datasheet scaling - both raw values are simply divided by 100. E+E also publishes an official Arduino library on GitHub (epluse/HTE501_i2c_arduino) if you want CRC checking and the sensor's configuration options.

HTE501 ESP-IDF example

Copy
// The HTE501 is an E+E Elektronik sensor with its own I2C protocol (address 0x40) -
// it is NOT compatible with SHT3x commands.
#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 SCL
#define I2C_MASTER_SDA_IO    21       // GPIO number for I2C SDA
#define I2C_MASTER_NUM       I2C_NUM_0
#define I2C_MASTER_FREQ_HZ   100000
#define HTE501_SENSOR_ADDR   0x40     // HTE501 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_hte501_sensor(void) {
    // Single-shot measurement command 0x2C1B (clock stretching enabled)
    uint8_t cmd[] = {0x2C, 0x1B};
    uint8_t data[6]; // T MSB, T LSB, CRC, RH MSB, RH LSB, CRC

    if (i2c_master_write_to_device(I2C_MASTER_NUM, HTE501_SENSOR_ADDR, cmd, 2, pdMS_TO_TICKS(1000)) != ESP_OK) {
        printf("HTE501 not found - check wiring\n");
        return;
    }
    vTaskDelay(pdMS_TO_TICKS(20)); // Wait for the measurement

    if (i2c_master_read_from_device(I2C_MASTER_NUM, HTE501_SENSOR_ADDR, data, 6, pdMS_TO_TICKS(1000)) == ESP_OK) {
        int16_t raw_temp = (data[0] << 8) | data[1]; // signed
        uint16_t raw_hum = (data[3] << 8) | data[4];
        // Scaling per the E+E datasheet: both values are hundredths
        float temperature = raw_temp / 100.0;
        float humidity = raw_hum / 100.0;
        printf("Temperature: %.2f C, Humidity: %.2f %%\n", temperature, humidity);
    }
}

void app_main(void) {
    ESP_ERROR_CHECK(i2c_master_init());

    while (1) {
        read_hte501_sensor();
        vTaskDelay(pdMS_TO_TICKS(2000));
    }
}

The HTE501 is an E+E Elektronik sensor with its own I2C protocol at address 0x40 - it is not compatible with SHT3x commands. The example sends the single-shot measurement command 0x2C1B, reads six bytes back (temperature, humidity, each followed by a CRC byte) and applies the datasheet scaling: both raw values are divided by 100, with the temperature interpreted as a signed 16-bit value. E+E also publishes an official Arduino/C driver on GitHub (epluse/HTE501_i2c_arduino) with CRC checking and configuration options.

HTE501 ESPHome example

Copy
i2c:
  sda: GPIO21
  scl: GPIO22

sensor:
  - platform: hte501
    temperature:
      name: "Office Temperature"
    humidity:
      name: "Office Humidity"
    address: 0x40
    update_interval: 60s

This ESPHome configuration defines a sensor platform for the HTE501. The platform key specifies the sensor type, and the I2C address is provided under the address key (e.g., 0x40). The temperature and humidity keys define the outputs with user-friendly names like ‘Office Temperature’ and ‘Office Humidity.’ The update_interval key ensures sensor readings are updated every 60 seconds.

HTE501 PlatformIO example

Copy
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
src/main.cppCopy
#include <Arduino.h>
// The HTE501 is an E+E Elektronik sensor with its own I2C protocol - no external
// library is needed. I2C address 0x40; SDA=GPIO21, SCL=GPIO22 (ESP32 defaults).
#include <Wire.h>

#define HTE501_ADDR 0x40

void setup() {
  Serial.begin(115200);
  Wire.begin(); // SDA=GPIO21, SCL=GPIO22
}

void loop() {
  // Single-shot measurement command 0x2C1B (with I2C clock stretching)
  Wire.beginTransmission(HTE501_ADDR);
  Wire.write(0x2C);
  Wire.write(0x1B);
  if (Wire.endTransmission() == 0) {
    delay(20); // Wait for the measurement to finish

    // Response: T MSB, T LSB, CRC, RH MSB, RH LSB, CRC
    Wire.requestFrom(HTE501_ADDR, 6);
    if (Wire.available() == 6) {
      uint8_t b[6];
      for (int i = 0; i < 6; i++) b[i] = Wire.read();

      int16_t rawTemp = (b[0] << 8) | b[1];      // signed
      uint16_t rawHum = (b[3] << 8) | b[4];
      float temperature = rawTemp / 100.0;       // scaling per E+E datasheet
      float humidity = rawHum / 100.0;

      Serial.print("Temperature: ");
      Serial.print(temperature);
      Serial.println(" C");
      Serial.print("Humidity: ");
      Serial.print(humidity);
      Serial.println(" %");
    }
  } else {
    Serial.println("HTE501 not found - check wiring");
  }
  delay(2000);
}

This PlatformIO example (Arduino framework) talks to the HTE501 directly over I2C - no library is needed. The HTE501 is an E+E Elektronik sensor with its own protocol at address 0x40: the sketch sends the single-shot measurement command 0x2C1B, reads six bytes back and applies the datasheet scaling (both raw values divided by 100, temperature as a signed 16-bit value). It is not compatible with SHT3x libraries or commands.

HTE501 MicroPython example

Copy
from machine import I2C, Pin
from time import sleep, sleep_ms

# The HTE501 is an E+E Elektronik sensor with its own I2C protocol - no driver needed
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
HTE501_ADDR = 0x40

while True:
    i2c.writeto(HTE501_ADDR, b'\x2c\x1b')  # single-shot measurement command
    sleep_ms(20)  # wait for the measurement
    data = i2c.readfrom(HTE501_ADDR, 6)  # T MSB, T LSB, CRC, RH MSB, RH LSB, CRC
    raw_temp = (data[0] << 8) | data[1]
    if raw_temp > 55536:  # negative temperatures are offset by 65536
        raw_temp -= 65536
    raw_hum = (data[3] << 8) | data[4]
    # Scaling per the E+E datasheet: both values are hundredths
    print("Temperature: {:.2f} C".format(raw_temp / 100))
    print("Humidity: {:.2f} %".format(raw_hum / 100))
    sleep(2)

The HTE501 is an E+E Elektronik sensor with its own I2C protocol at address 0x40 - it is not compatible with SHT3x commands, and no driver is needed: the example sends the single-shot measurement command 0x2C1B, reads six bytes and applies the datasheet scaling (both raw values divided by 100, with negative temperatures offset by 65536).

HTE501 specifications

From the datasheet
Interface
I2C, 8-pin DFN
Accuracy
±1.8% RH, ±0.2 °C
Operating Range
-40 to +135 °C, 0-100% RH
Voltage
2.35 - 3.60V

About the HTE501

The HTE501 is E+E Elektronik’s high-accuracy digital humidity and temperature sensor, built into an unusually small 2.5 x 2.5 mm DFN package. Its headline numbers - ±1.8% RH (including hysteresis) and ±0.2 degC - are competitive with Sensirion’s best I2C parts, but its real distinguishing feature is range: E+E rates it from -40 to +135 degC, well beyond the 85-125 degC ceiling most commodity humidity sensors top out at, which points it at industrial and HVAC duty rather than a bedroom weather station.

It speaks I2C at address 0x40, but with its own command set rather than the SHT3x-style commands many similarly priced sensors share - code written for an SHT31 or SHT35 will not talk to it. ESPHome ships a native hte501 platform, so integration there is straightforward; Arduino and ESP-IDF need either E+E’s own driver from GitHub or a short custom I2C routine, since no community library exists. The sensor also includes a heater element for shedding condensation, and E+E specifies long-term drift under 0.5% RH per year - both aimed at the same demanding-environment use case as the extended temperature range.

For a typical room or greenhouse monitor, a SHT40 or BME280 is cheaper, easier to source, and has a bigger library ecosystem; save the HTE501 for projects that genuinely need its temperature ceiling or its tiny footprint.

HTE501 troubleshooting

4 common issues

Sensor Not Detected on I2C Bus

›

Issue: The HTE501 sensor is not recognized on the I2C bus, leading to communication failures.

Possible causes include incorrect wiring, improper I2C address configuration, or sensor malfunction.

Solution: Verify that the sensor's VCC and GND are properly connected to the power supply, and that SDA and SCL lines are correctly connected to the corresponding I2C pins on the microcontroller. Ensure that the I2C address matches the sensor's default or configured address. Use an I2C scanner to detect the sensor's presence on the bus. If the sensor remains undetected, consider testing with a different microcontroller or replacing the sensor.

Incorrect or Unstable Readings

›

Issue: The HTE501 sensor provides temperature or humidity readings that are inaccurate or fluctuate unexpectedly.

Possible causes include environmental interference, improper sensor placement, or lack of calibration.

Solution: Place the sensor away from direct heat sources, sunlight, or areas with rapid temperature changes. Ensure that the sensor is properly initialized and calibrated in the code. If inaccuracies persist, consider implementing software-based calibration adjustments based on known reference values.

I2C Communication Timeouts

›

Issue: Communication with the HTE501 sensor over I2C results in timeout errors, especially during single-shot measurements.

Possible causes include the sensor's clock stretching behavior during measurements, which may not be properly handled by the microcontroller's I2C implementation.

Solution: Implement a delay (e.g., 20ms) after initiating a measurement to allow the sensor to process the data before attempting to read the results. Alternatively, monitor the sensor's status register to determine when the measurement is complete before reading the data. This approach ensures synchronization between the sensor and the microcontroller, preventing timeout errors.

Compilation Errors When Using HTE501 Library

›

Issue: Compilation errors occur when attempting to use the HTE501 sensor with a development platform.

Errors such as 'undefined reference' or 'no matching function' may appear.

Solution: Ensure that the correct library for the HTE501 sensor is installed and properly included in the project. Verify that the library version is compatible with your development environment. Check for any missing dependencies and ensure that all necessary files are present. If errors persist, consider consulting the library's documentation or seeking support from the developer community.

Where to buy the HTE501

HTE501 Temperature and Humidity Sensor
HTE501 Temperature and Humidity Sensor
Amazon and AliExpress links are affiliate links - buying through them supports the site at no extra cost to you.

Resources