

The Adafruit PCF8574 I2C GPIO Expander Breakout (Part ID: 5545) is a versatile module designed to expand the number of digital input/output (GPIO) pins available to your microcontroller. It communicates via the I2C protocol, allowing you to control up to 8 additional GPIO pins with minimal wiring. This breakout is ideal for projects requiring more GPIOs than your microcontroller natively provides, such as controlling LEDs, reading button states, or interfacing with other digital devices.








The Adafruit PCF8574 I2C GPIO Expander Breakout is based on the PCF8574 chip, which provides 8 configurable GPIO pins. Below are the key technical details:
The breakout board has the following pin layout:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (2.5V to 6V). Connect to the microcontroller's 3.3V or 5V pin. |
| GND | Ground connection. Connect to the microcontroller's ground. |
| SDA | I2C data line. Connect to the microcontroller's SDA pin. |
| SCL | I2C clock line. Connect to the microcontroller's SCL pin. |
| P0-P7 | GPIO pins. Configurable as input or output. |
| A0, A1, A2 | Address selection jumpers. Used to set the I2C address (0x20 to 0x27). |
Connect Power and Ground:
VCC pin to the 3.3V or 5V power supply of your microcontroller.GND pin to the ground of your microcontroller.Connect I2C Lines:
SDA pin to the microcontroller's SDA pin.SCL pin to the microcontroller's SCL pin.Set the I2C Address:
A0, A1, and A2 jumpers to configure the I2C address. For example:Connect GPIO Devices:
P0 to P7 pins to connect LEDs, buttons, or other digital devices.Below is an example of how to use the Adafruit PCF8574 I2C GPIO Expander Breakout with an Arduino UNO to toggle an LED connected to pin P0:
#include <Wire.h>
// Define the I2C address of the PCF8574 (default is 0x20)
#define PCF8574_ADDRESS 0x20
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Set all GPIO pins to HIGH (default state for outputs)
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // All pins HIGH
Wire.endTransmission();
Serial.println("PCF8574 initialized.");
}
void loop() {
// Toggle the state of P0 (connected to an LED)
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFE); // Set P0 LOW, others HIGH
Wire.endTransmission();
delay(500); // Wait 500ms
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // Set all pins HIGH
Wire.endTransmission();
delay(500); // Wait 500ms
}
I2C Communication Not Working:
GPIO Pins Not Responding:
Address Conflict with Other I2C Devices:
A0, A1, and A2 jumpers.LEDs Not Lighting Up:
Can I use multiple PCF8574 modules on the same I2C bus?
Yes, up to 8 modules can be used by configuring unique I2C addresses using the A0, A1, and A2 jumpers.
What is the maximum cable length for I2C communication? The maximum length depends on the pull-up resistor values and the I2C speed, but typically it is limited to a few meters.
Can the GPIO pins handle analog signals? No, the GPIO pins are digital-only and cannot process analog signals.
Is the PCF8574 compatible with 3.3V microcontrollers? Yes, the PCF8574 operates at 2.5V to 6V, making it compatible with both 3.3V and 5V systems.