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

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

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

Introduction

The PCF8575 is a versatile I/O expander chip that allows you to extend the number of input/output pins available on a microcontroller or microprocessor. It operates via the I2C interface, which makes it compatible with most microcontroller families, including popular boards like the Arduino UNO. The PCF8575 features 16 quasi-bidirectional I/O ports, which can be used for input or output without the need for configuration. This makes it ideal for applications where additional I/Os are needed, such as keypad interfaces, display controls, and other situations where the number of I/O pins on the main controller is limited.

Common applications include:

  • Expanding the number of I/O pins on microcontrollers
  • Interfacing with LCD displays, keypads, and other peripherals
  • Home automation systems
  • Industrial control systems

Explore Projects Built with PCF8575 IO 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 IO 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 IO 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
ESP32-Based Industrial Control System with RS485 Communication and I2C Interface
Image of DRIVER TESTER : A project utilizing PCF8575 IO Expander in a practical application
This circuit integrates a microcontroller with a display, digital potentiometer, IO expander, and opto-isolator board for signal interfacing and isolation. It includes a UART to RS485 converter for serial communication and a power converter to step down voltage for the system. The circuit is designed for control and communication in an isolated and protected environment.
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 IO 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

Explore Projects Built with PCF8575 IO 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 IO 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 IO 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 DRIVER TESTER : A project utilizing PCF8575 IO Expander in a practical application
ESP32-Based Industrial Control System with RS485 Communication and I2C Interface
This circuit integrates a microcontroller with a display, digital potentiometer, IO expander, and opto-isolator board for signal interfacing and isolation. It includes a UART to RS485 converter for serial communication and a power converter to step down voltage for the system. The circuit is designed for control and communication in an isolated and protected environment.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of door and window sensors: A project utilizing PCF8575 IO 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

Technical Specifications

Key Technical Details

  • Operating Voltage: 2.5V to 5.5V
  • I2C Interface
  • 16 quasi-bidirectional I/Os
  • Interrupt output
  • 400 kHz I2C bus clock frequency
  • Low standby current

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 A0 Address input 0
2 A1 Address input 1
3 A2 Address input 2
4 P00 Quasi-bidirectional I/O port 0
5 P01 Quasi-bidirectional I/O port 1
... ... ...
19 P17 Quasi-bidirectional I/O port 17
20 VSS Ground
21 SDA Serial Data Line
22 SCL Serial Clock Line
23 INT Interrupt Output
24 VDD Positive Power Supply

Usage Instructions

Interfacing with a Microcontroller

To use the PCF8575 with a microcontroller like the Arduino UNO, follow these steps:

  1. Connect VDD to the microcontroller's 5V power output.
  2. Connect VSS to the microcontroller's ground.
  3. Connect SDA and SCL to the microcontroller's I2C data and clock lines, respectively.
  4. Set the A0, A1, and A2 pins to either high or low to set the I2C address.
  5. Connect the I/O pins (P00 to P17) to the peripherals as needed.

Best Practices

  • Use pull-up resistors on the SDA and SCL lines.
  • Ensure that the power supply is stable and within the specified voltage range.
  • Avoid running I2C lines near high-frequency signals to minimize interference.

Example Code for Arduino UNO

#include <Wire.h>

// PCF8575 I2C address is 0x20(32) if A0, A1, and A2 are connected to GND
#define PCF8575_ADDRESS 0x20

void setup() {
  Wire.begin(); // Initialize I2C
  Serial.begin(9600); // Initialize serial communication
}

void loop() {
  // Write to the PCF8575
  Wire.beginTransmission(PCF8575_ADDRESS);
  Wire.write(0xFF); // Set all pins to high
  Wire.endTransmission();

  delay(1000); // Wait for a second

  // Read from the PCF8575
  Wire.requestFrom(PCF8575_ADDRESS, 2); // Request 2 bytes from the PCF8575
  if(Wire.available()) {
    byte data0 = Wire.read(); // Read first byte (pins P00 to P07)
    byte data1 = Wire.read(); // Read second byte (pins P10 to P17)
    Serial.print("P00-P07: ");
    Serial.println(data0, BIN);
    Serial.print("P10-P17: ");
    Serial.println(data1, BIN);
  }

  delay(1000); // Wait for a second
}

Troubleshooting and FAQs

Common Issues

  • I2C Communication Failure: Ensure that the SDA and SCL lines are connected properly and that pull-up resistors are in place.
  • Incorrect Addressing: Verify that the A0, A1, and A2 pins are set to the correct logic levels for the desired I2C address.
  • No Response from I/O Pins: Check that the PCF8575 is powered correctly and that the I/O pins are not overloaded.

Solutions and Tips

  • Use a logic analyzer or oscilloscope to check the integrity of the I2C signals.
  • Make sure that the I2C address used in the code matches the hardware address set by the A0, A1, and A2 pins.
  • If using the interrupt feature, ensure that the INT pin is connected to an interrupt-capable pin on the microcontroller.

FAQs

Q: Can the PCF8575 pins sink/source high current? A: No, the PCF8575 is designed for low-power applications. Check the datasheet for exact current limits.

Q: How do I change the I2C address of the PCF8575? A: The I2C address can be changed by connecting the A0, A1, and A2 pins to either VDD or VSS. Each combination represents a different address.

Q: Can I use multiple PCF8575 expanders on the same I2C bus? A: Yes, you can use up to 8 PCF8575 expanders on the same I2C bus by setting different addresses using the A0, A1, and A2 pins.