← All parts
PCF8574 I/O Expander
PCF8574
Texas Instrumentsinterface io display
The PCF8574 is an 8-bit I/O expander that communicates via the I2C bus. It allows microcontrollers to increase their number of general-purpose input/output pins, with features like latched outputs for driving LEDs and an interrupt output.
In stock
Specifications
11- Operating Voltage
- 2.5 V
- Operating Voltage
- 6 V
- Logic Level
- 0.7 x VCC V
- Logic Level
- 0.3 x VCC V
- Interface
- I2C
- Standby Current Consumption
- 10 μA
- Operating Current
- 40 μA
- I2c Clock Frequency
- 100 kHz
- Temperature Range
- -40 °C
- Temperature Range
- 85 °C
- Package
- TVSOP, SOIC, PDIP, TSSOP, VQFN
Pinout
16| Pin | Name | Functions | Notes |
|---|---|---|---|
| 1 | VCC | POWER | |
| 2 | A0 | GPIO | Address input 0 |
| 3 | A1 | GPIO | Address input 1 |
| 4 | A2 | GPIO | Address input 2 |
| 5 | P3 | GPIO | I/O port 3 |
| 6 | P2 | GPIO | I/O port 2 |
| 7 | P1 | GPIO | I/O port 1 |
| 8 | P0 | GPIO | I/O port 0 |
| 9 | P7 | GPIO | I/O port 7 |
| 10 | P6 | GPIO | I/O port 6 |
| 11 | P5 | GPIO | I/O port 5 |
| 12 | P4 | GPIO | I/O port 4 |
| 13 | INT | GPIO | Interrupt output |
| 14 | SCL | I2C | Serial clock line |
| 15 | SDA | I2C | Serial data line |
| 16 | GND | GND |
Interactive pinout
Highlight:
PCF8574
Click a pin to copy its name · tap a tag above to spotlight a bus.
Logic level & voltage
Operates from 2.5-6 V (per the datasheet specs) on I2C, with logic thresholds referenced to VCC, so it suits both 3.3 V and 5 V buses.
Typical uses
- Adding 8 I/O pins over I2C (the common LCD 'backpack')
- Reading buttons / driving LEDs from few pins
- Bus expansion with up to 8 chips per bus
Wiring notes & gotchas
- Outputs are quasi-bidirectional (weak high) — fine for LEDs/inputs, not strong sourcing.
- Set the A0-A2 address pins; up to 8 devices per bus.
- The INT pin flags input changes — wire it to a GPIO to avoid polling.
Commonly used with
3Starter code
Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.
Arduino (C++)
arduino
// PCF8574 8-bit I2C I/O expander — community starter example
// No library needed: write one byte = the 8 output pins (P0..P7).
#include <Wire.h>
const byte ADDR = 0x20; // A2..A0 = 000; PCF8574A base is 0x38
void writePort(byte value) {
Wire.beginTransmission(ADDR);
Wire.write(value);
Wire.endTransmission();
}
void setup() {
Wire.begin();
}
void loop() {
writePort(0xFF); // all P0..P7 HIGH
delay(500);
writePort(0x00); // all LOW
delay(500);
}MicroPython
python
# PCF8574 I2C I/O expander (ESP32) — community starter example
# No driver needed: one byte = the 8 pins
from machine import Pin, I2C
import time
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
ADDR = 0x20
while True:
i2c.writeto(ADDR, b"\xFF") # all HIGH
time.sleep(0.5)
i2c.writeto(ADDR, b"\x00") # all LOW
time.sleep(0.5)Wiring
| Pin | Arduino Uno R3 | ESP32 DevKitC (WROOM-32) | Notes |
|---|---|---|---|
| VCC | +5V | 3V3 | 2.5-6 V |
| GND | GND | GND | |
| SDA | A4/SDA | GPIO21 | |
| SCL | A5/SCL | GPIO22 | |
| A0/A1/A2 | - | - | Address select (GND/VCC) -> 0x20-0x27 |
| P0..P7 | - | - | 8 quasi-bidirectional I/O pins to your LEDs/buttons |