I2C Issues - CrowPanel x" -HMI ESP32 Display
I need to use one or more PCF8575s with my HMI displays (7, 5, and 2.8 inches) but I cannot get my PCF8575 IO Expander Module I2C to 16IO to work for the life of me. I read all 8575 related posts here but none of the methods has worked for me. First, what library do you recommend, second, is there sample code I can look at for that library? I am using Arduino IDE. Thanks!
Tagged:
Comments
Hi Bernhard,
Our technical support team is currently looking into your issue in your email. Please be patient, and we will get back to you as soon as possible.
Best regards,
Hi Bernhard,
About the issue, please refer to the following information:
_To use the PCF8575 I2C 16-bit IO expander module on your ESP32-S3 development board, the following libraries are recommended:
📚 Recommended Libraries
This library provides simple control over the 16 pins of the PCF8575 chip, allowing you to expand up to 128 IO ports via the I2C bus.
👉 GitHub: PCF8575 by Rob Tillaart
Although named for the PCF8574, this library also supports the PCF8575 and includes example code for easy integration with Arduino-compatible microcontrollers.
👉 GitHub: Adafruit-PCF8574
This one supports both Arduino and ESP8266. It enables digital reads and writes using only two I2C wires, ideal for devices like ESP-01.
👉 GitHub: PCF8575 by xreef
✅ Example Code (Using Rob Tillaart’s Library)
⚠ Important Notes
I2C Address:
The default I2C address of the PCF8575 is
0x20
, but it can be changed by setting A0, A1, and A2 pins high or low. Make sure the address in your code matches your device.Pull-up Resistors:
The I2C bus requires pull-up resistors (typically 4.7kΩ). If they’re not built into your board or module, you’ll need to add them manually.
Input Mode:
If you configure the PCF8575 pins as inputs, it's recommended to use
INPUT_PULLUP
to keep the state stable and avoid floating inputs._