

The PCF8574 is an I2C I/O expander manufactured by NXP Semiconductors. It is designed to expand the number of input/output (I/O) pins available to a microcontroller. The device features 8 General Purpose Input/Output (GPIO) pins that can be configured as either inputs or outputs. This makes it ideal for applications where the microcontroller has limited I/O pins but needs to interface with multiple devices.








| Parameter | Value |
|---|---|
| Manufacturer | NXP Semiconductors |
| Part Number | PCF8574AP |
| Communication Protocol | I2C (Inter-Integrated Circuit) |
| Operating Voltage Range | 2.5V to 6V |
| Maximum Sink Current | 25 mA per pin |
| Maximum Source Current | -300 µA per pin |
| I2C Address Range | 0x20 to 0x27 (configurable via A0, A1, A2) |
| GPIO Pins | 8 (P0 to P7) |
| Operating Temperature | -40°C to +85°C |
| Package Type | DIP-16, SO-16, or TSSOP-16 |
The PCF8574 comes in a 16-pin package. Below is the pinout and description:
| Pin No. | 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 | GPIO pin 0 (input/output) |
| 5 | P1 | GPIO pin 1 (input/output) |
| 6 | P2 | GPIO pin 2 (input/output) |
| 7 | P3 | GPIO pin 3 (input/output) |
| 8 | VSS | Ground (0V) |
| 9 | P4 | GPIO pin 4 (input/output) |
| 10 | P5 | GPIO pin 5 (input/output) |
| 11 | P6 | GPIO pin 6 (input/output) |
| 12 | P7 | GPIO pin 7 (input/output) |
| 13 | INT | Interrupt output (active LOW) |
| 14 | SCL | I2C clock line |
| 15 | SDA | I2C data line |
| 16 | VDD | Power supply (2.5V to 6V) |
0x20.Below is an example of how to use the PCF8574 to control LEDs with an Arduino UNO:
#include <Wire.h> // Include the Wire library for I2C communication
#define PCF8574_ADDRESS 0x20 // I2C address of the PCF8574 (A0, A1, A2 = LOW)
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Set all GPIO pins to HIGH (turn off LEDs if connected to active LOW)
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // All pins HIGH
Wire.endTransmission();
}
void loop() {
// Example: Toggle GPIO pin P0 every second
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFE); // Set P0 LOW, others HIGH
Wire.endTransmission();
delay(1000); // Wait for 1 second
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // Set all pins HIGH
Wire.endTransmission();
delay(1000); // Wait for 1 second
}
I2C Communication Not Working
GPIO Pins Not Responding
Interrupt Pin Not Triggering
Multiple Devices on I2C Bus Not Working
Q1: Can the PCF8574 handle analog signals?
A1: No, the PCF8574 is designed for digital I/O only. It cannot process analog signals.
Q2: How many PCF8574 devices can be connected to the same I2C bus?
A2: Up to 8 devices can be connected, as the I2C address range is from 0x20 to 0x27.
Q3: What happens if the power supply exceeds 6V?
A3: Exceeding 6V can damage the device. Always ensure the supply voltage is within the specified range.
Q4: Can the PCF8574 be used with 3.3V microcontrollers?
A4: Yes, the PCF8574 is compatible with 3.3V systems as long as the supply voltage is within the operating range.
This concludes the documentation for the PCF8574 I2C I/O expander.