Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use PCF8575 I2C Expander: Examples, Pinouts, and Specs

Image of PCF8575 I2C Expander
Cirkit Designer LogoDesign with PCF8575 I2C Expander in Cirkit Designer

Introduction

The PCF8575 is a 16-bit I2C I/O port expander designed to extend the number of GPIO pins available to a microcontroller. It communicates via the I2C bus, requiring only two wires (SCL and SDA) for data transmission. This makes it an efficient solution for applications where GPIO pin availability is limited.

Common applications of the PCF8575 include:

  • Expanding GPIO pins for microcontrollers in embedded systems.
  • Controlling LEDs, relays, or other digital devices.
  • Reading inputs from buttons, switches, or sensors.
  • Building home automation systems or industrial control panels.

Explore Projects Built with PCF8575 I2C Expander

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based I2C Communication Hub with Multiplexer and Expander
Image of Lights: A project utilizing PCF8575 I2C Expander in a practical application
This circuit features an Olimex ESP32-EVB microcontroller unit (MCU) for processing and connectivity, interfaced with an MCP23017 I/O expander and an Adafruit TCA9548A I2C multiplexer to expand the number of I/O lines and allow multiple I2C devices to communicate with the MCU over the same bus. Pull-up resistors are connected to the I2C lines for proper bus operation, and both the MCP23017 and TCA9548A have their reset lines pulled high, likely for normal operation without external reset control.
Cirkit Designer LogoOpen Project in Cirkit Designer
I2C-Controlled Relay Switching with ESP32 and MCP23017 for Home Automation
Image of Vloerverwarming: A project utilizing PCF8575 I2C Expander in a practical application
This circuit appears to be a control system utilizing two MCP23017 I/O expanders interfaced with an Olimex ESP32-EVB microcontroller via I2C communication, as indicated by the SDA and SCL connections with pull-up resistors. The MCP23017 expanders control an 8-channel relay module, allowing the microcontroller to switch various loads, potentially for home automation or industrial control. Additionally, there is an Adafruit ADS1115 16-bit ADC for analog signal measurement, and several heating actuators and a thermostat are connected, suggesting temperature control functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer
MCP23017-Expanded I/O Interface with ADS1115 ADC and ESP32 Control
Image of door and window sensors: A project utilizing PCF8575 I2C Expander in a practical application
This circuit features two MCP23017 I/O expanders interfaced with multiple switches, allowing for the expansion of input capabilities. The MCP23017s are connected via I2C to an Olimex ESP32-EVB microcontroller, which likely manages the input states from the switches. Additionally, an Adafruit ADS1115 16-bit ADC is included, suggesting that some analog inputs are being monitored, with the ADC also interfaced with the ESP32 via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
Image of Indoor Lounge: A project utilizing PCF8575 I2C Expander in a practical application
This circuit is a control system that uses an ESP32 microcontroller to manage multiple relays and read data from DHT22 temperature and humidity sensors. The DFRobot Gravity MCP23017 I2C module expands the GPIO capabilities of the ESP32, allowing it to control additional relays for switching high-power devices.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with PCF8575 I2C Expander

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Lights: A project utilizing PCF8575 I2C Expander in a practical application
ESP32-Based I2C Communication Hub with Multiplexer and Expander
This circuit features an Olimex ESP32-EVB microcontroller unit (MCU) for processing and connectivity, interfaced with an MCP23017 I/O expander and an Adafruit TCA9548A I2C multiplexer to expand the number of I/O lines and allow multiple I2C devices to communicate with the MCU over the same bus. Pull-up resistors are connected to the I2C lines for proper bus operation, and both the MCP23017 and TCA9548A have their reset lines pulled high, likely for normal operation without external reset control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Vloerverwarming: A project utilizing PCF8575 I2C Expander in a practical application
I2C-Controlled Relay Switching with ESP32 and MCP23017 for Home Automation
This circuit appears to be a control system utilizing two MCP23017 I/O expanders interfaced with an Olimex ESP32-EVB microcontroller via I2C communication, as indicated by the SDA and SCL connections with pull-up resistors. The MCP23017 expanders control an 8-channel relay module, allowing the microcontroller to switch various loads, potentially for home automation or industrial control. Additionally, there is an Adafruit ADS1115 16-bit ADC for analog signal measurement, and several heating actuators and a thermostat are connected, suggesting temperature control functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of door and window sensors: A project utilizing PCF8575 I2C Expander in a practical application
MCP23017-Expanded I/O Interface with ADS1115 ADC and ESP32 Control
This circuit features two MCP23017 I/O expanders interfaced with multiple switches, allowing for the expansion of input capabilities. The MCP23017s are connected via I2C to an Olimex ESP32-EVB microcontroller, which likely manages the input states from the switches. Additionally, an Adafruit ADS1115 16-bit ADC is included, suggesting that some analog inputs are being monitored, with the ADC also interfaced with the ESP32 via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Indoor Lounge: A project utilizing PCF8575 I2C Expander in a practical application
ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
This circuit is a control system that uses an ESP32 microcontroller to manage multiple relays and read data from DHT22 temperature and humidity sensors. The DFRobot Gravity MCP23017 I2C module expands the GPIO capabilities of the ESP32, allowing it to control additional relays for switching high-power devices.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

The PCF8575 has the following key technical details:

Parameter Value
Operating Voltage 2.5V to 5.5V
Maximum Sink Current 25 mA per pin
Maximum Source Current -300 µA per pin
I2C Clock Frequency Up to 400 kHz (Fast Mode)
Number of I/O Pins 16 (P0.0 to P0.7, P1.0 to P1.7)
I2C Address Range 0x20 to 0x27 (configurable)
Operating Temperature -40°C to +85°C

Pin Configuration and Descriptions

The PCF8575 is typically available in a 24-pin package. Below is the pinout description:

Pin Name Description
1-8 P0.0-P0.7 GPIO pins for Port 0 (bidirectional)
9 GND Ground
10-17 P1.0-P1.7 GPIO pins for Port 1 (bidirectional)
18 INT Interrupt output (active LOW)
19 A0 I2C address selection bit 0
20 A1 I2C address selection bit 1
21 A2 I2C address selection bit 2
22 RESET Active LOW reset input
23 SDA I2C data line
24 SCL I2C clock line

Usage Instructions

How to Use the PCF8575 in a Circuit

  1. Power Supply: Connect the VCC pin to a 2.5V-5.5V power source and the GND pin to ground.
  2. I2C Connections: Connect the SDA and SCL pins to the corresponding I2C pins on the microcontroller. Use pull-up resistors (typically 4.7kΩ) on both lines.
  3. Address Configuration: Set the I2C address by connecting A0, A1, and A2 to either VCC (logic HIGH) or GND (logic LOW). This allows up to 8 PCF8575 devices on the same I2C bus.
  4. GPIO Pins: Use the P0.x and P1.x pins as inputs or outputs. Note that the pins are open-drain, so external pull-up resistors may be required for output operation.
  5. Interrupt Pin: The INT pin can be used to detect changes on input pins. It is active LOW and requires an external pull-up resistor.

Best Practices

  • Use decoupling capacitors (e.g., 0.1 µF) near the VCC pin to stabilize the power supply.
  • Avoid exceeding the maximum current ratings to prevent damage to the device.
  • When using the GPIO pins as inputs, ensure proper pull-up or pull-down resistors are used to avoid floating states.

Example Code for Arduino UNO

Below is an example of how to use the PCF8575 with an Arduino UNO to toggle an LED connected to one of the GPIO pins:

#include <Wire.h>
#include <PCF8575.h> // Include the PCF8575 library

PCF8575 expander(0x20); // Initialize PCF8575 with I2C address 0x20

void setup() {
  Wire.begin(); // Start the I2C bus
  expander.begin(); // Initialize the PCF8575
  expander.pinMode(0, OUTPUT); // Set P0.0 as an output pin
}

void loop() {
  expander.digitalWrite(0, HIGH); // Turn on the LED connected to P0.0
  delay(1000); // Wait for 1 second
  expander.digitalWrite(0, LOW); // Turn off the LED
  delay(1000); // Wait for 1 second
}

Notes:

  • The PCF8575.h library can be installed via the Arduino Library Manager.
  • Replace 0x20 with the actual I2C address of your PCF8575 if it differs.

Troubleshooting and FAQs

Common Issues

  1. Device Not Responding on I2C Bus:

    • Ensure the correct I2C address is used.
    • Verify that pull-up resistors are connected to the SDA and SCL lines.
    • Check the wiring for loose or incorrect connections.
  2. GPIO Pins Not Functioning as Expected:

    • Confirm the pin mode (input/output) is correctly configured in the code.
    • Check for proper pull-up or pull-down resistors on the pins.
  3. Interrupt Pin Not Triggering:

    • Ensure the INT pin is connected to a pull-up resistor.
    • Verify that the input pins are configured correctly and are changing state.

Tips for Troubleshooting

  • Use an I2C scanner sketch to detect the PCF8575 on the I2C bus.
  • Measure the voltage levels on the SDA and SCL lines to ensure they are within the expected range.
  • Test the GPIO pins individually to isolate any faulty connections or components.

By following this documentation, you should be able to successfully integrate the PCF8575 I2C expander into your projects and troubleshoot any issues that arise.