Skip to content

About

ESP32 I2C I/O expander example with sequential output control and FreeRTOS state monitoring.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

ESP32 I/O Expander Integration

An ESP-IDF firmware example for controlling and monitoring external digital I/O through two I2C expanders. The application combines a six-output activation sequence with periodic input/output state logging using FreeRTOS tasks.

This repository is a focused board-integration exercise, with the configuration and sequence implemented in main/main.c.

What the firmware does

  1. Initializes an I2C master bus and separate input and output expanders.
  2. Configures eight input bits and six output bits.
  3. Drives output bits 0–5 low, one at a time, with a one-second delay between writes.
  4. Starts a monitoring task after the output sequence. It reads the expander states and logs the lower six bits with inverted logic, using a 100 ms task delay between iterations.

Current sequence: the statements that return outputs high are commented out, so the sequence leaves the six output bits low. The final serial message saying that all outputs are off does not reflect the implemented sequence. Review this behavior before connecting loads.

Configuration in this repository

Item Value
Target ESP32
Recorded ESP-IDF version 5.4.0 in dependencies.lock and sdkconfig
Language / runtime C / FreeRTOS
I2C controller I2C_NUM_0
SDA / SCL GPIO 4 / GPIO 15
Input expander address 0x22
Output expander address 0x24
Output sequence Bits 0–5, active-low logic

The application uses Espressif's esp_io_expander_ht8574 component. The local header main/esp_io_expander_ht8574.h defines the board-specific addresses above and documents a PCF8574-style address adaptation. Confirm the actual board, address straps, supply levels, and wiring before using this configuration on hardware.

Build

With an ESP-IDF 5.4 development environment activated:

git clone https://github.com/olivarescroc/VCU_NET_HT8574_TEST.git
cd VCU_NET_HT8574_TEST
idf.py build

The checked-in configuration targets esp32. Dependencies are declared in main/idf_component.yml, with the recorded versions in dependencies.lock.

Repository guide

This is a bench integration example. A hardware validation report and production-readiness evidence are not included.

Credits and licensing

The project uses the Espressif ESP-IDF project structure and Espressif I/O expander components. Existing source files retain Espressif copyright notices and Apache-2.0 SPDX identifiers. See the included component licenses for their terms:

About

ESP32 I2C I/O expander example with sequential output control and FreeRTOS state monitoring.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages