

The PCF8574, manufactured by Texas Instruments, is an I2C I/O expander that provides 8 additional digital input/output pins to a microcontroller. This component is particularly useful in applications where the number of GPIO pins on a microcontroller is insufficient. By utilizing the I2C communication protocol, the PCF8574 allows for efficient control of multiple devices with minimal pin usage.








The following are the key technical details of the PCF8574:
| Parameter | Value |
|---|---|
| Operating Voltage (Vcc) | 2.5V to 6V |
| I2C Bus Speed | Up to 100 kHz (Standard Mode) |
| Number of I/O Pins | 8 (configurable as input or output) |
| Maximum Sink Current (per pin) | 25 mA |
| Maximum Source Current (per pin) | -300 µA |
| I2C Address Range | 0x20 to 0x27 (configurable via address pins) |
| Operating Temperature Range | -40°C to 85°C |
| Package Types | SOIC, PDIP, TSSOP |
The PCF8574 has 16 pins, with the following configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | A0 | I2C Address Selection Bit 0 |
| 2 | A1 | I2C Address Selection Bit 1 |
| 3 | A2 | I2C Address Selection Bit 2 |
| 4 | P0 | General Purpose I/O Pin 0 |
| 5 | P1 | General Purpose I/O Pin 1 |
| 6 | P2 | General Purpose I/O Pin 2 |
| 7 | P3 | General Purpose I/O Pin 3 |
| 8 | GND | Ground |
| 9 | P4 | General Purpose I/O Pin 4 |
| 10 | P5 | General Purpose I/O Pin 5 |
| 11 | P6 | General Purpose I/O Pin 6 |
| 12 | P7 | General Purpose I/O Pin 7 |
| 13 | INT | Interrupt Output (active LOW) |
| 14 | SCL | I2C Clock Line |
| 15 | SDA | I2C Data Line |
| 16 | VCC | Power Supply (2.5V to 6V) |
0x20, and the address range is 0x20 to 0x27.Below is an example of how to use the PCF8574 with an Arduino UNO to control LEDs:
#include <Wire.h> // Include the Wire library for I2C communication
#define PCF8574_ADDRESS 0x20 // I2C address of the PCF8574 (default: 0x20)
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Set all pins (P0–P7) as outputs by writing HIGH to all pins
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // All pins HIGH (default state for outputs)
Wire.endTransmission();
}
void loop() {
// Example: Blink an LED connected to P0
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFE); // Set P0 LOW, others HIGH
Wire.endTransmission();
delay(500); // Wait for 500ms
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // Set all pins HIGH
Wire.endTransmission();
delay(500); // Wait for 500ms
}
I2C Communication Failure
GPIO Pins Not Responding
Interrupt Pin Not Working
LEDs Not Lighting Up
Can the PCF8574 handle analog signals?
What is the maximum number of PCF8574 devices that can be connected to a single I2C bus?
Can the PCF8574 be used with 3.3V microcontrollers?
How do I configure a pin as an input?
By following this documentation, users can effectively integrate the PCF8574 into their projects and expand the GPIO capabilities of their microcontrollers.