Source: https://mokxi.com/parts/pcf8574
Updated: 2026-11-10

Part

# I/O expander, PCF8574

Eight more pins on two wires. No registers: a byte out is the pins, a byte in is what they read.

See every part

- 13 pins
- 1 setting
- In 2 projects
- In 1 lesson

Drawn live by the editor's own code, at the size you see it.

At a glance

## The I/O expander, PCF8574 in brief

What it is, and every setting the properties panel gives it.

The PCF8574 adds eight pins to a board over two I2C wires, and it is the same chip that sits on the back of every I2C LCD backpack. It is about as simple as a chip can be: there are no registers. Each byte written after the address appears on its eight pins, P0 in bit 0; each byte read is their levels. A pin written 0 pulls hard to ground and can sink an LED’s current; a pin written 1 is only held up weakly, so anything outside can pull it down, which is how a pin becomes an input. The board’s jumpers set the address from 0x20 to 0x27, or 0x38 to 0x3F on the PCF8574A. Mokxi models the port in both directions, power-up with every pin high, and the INT pin falling when an input changes and releasing on the next read or write.

Family

Logic

Pins

13

address

32

Pins

## 13 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

GND

Ground.

VCC

Supply, 2.5 to 6 V.

SDA

I2C. The module carries the pull-ups.

SCL

I2C. The module carries the pull-ups.

INT

Open drain, low when an input has changed. Needs a pull-up.

P0

P1

P2

P3

P4

P5

P6

P7

How to use it

## How to add eight pins to an Arduino with a PCF8574

VCC to 5 V, GND to ground, SDA to A4 and SCL to A5. The More pins project leaves the address at 0x20 and puts an MCP23017 on the same bus, so you can compare the two expanders side by side.

No library is needed. Wire.beginTransmission(0x20), Wire.write() one byte, Wire.endTransmission(), and the eight pins take its bits. The project writes a byte with one 0 in it and moves that 0 along P0 to P3 every 250 ms; the other pins stay at 1. To see it, add LEDs that run from 5 V through a resistor into P0 to P3, since a PCF8574 lights an LED by pulling its pin low. To read buttons, write 1 to their pins first, wire each button from the pin to ground, and Wire.requestFrom(0x20, 1) returns a byte where a pressed button is a 0.

Part pin

Board pin

VCC

5 V

GND

GND

SDA

A4

SCL

A5

INT

Not wired

P0 to P3

The walking bit (add LEDs from 5 V to see it)

The chip runs from 2.5 to 6 V, so on a 3.3 V board power it from 3.3 V and use the board’s own SDA and SCL; the bytes are the same.

Hold the button

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

One dark bit walking, from the More pins sketch

Common errors

## Common I/O expander, PCF8574 errors and fixes

What goes wrong

The fix

LEDs wired from the pins to ground stay dark.

A pin at 1 only offers a weak pull-up, about 100 µA. Wire each LED from VCC through a resistor into the pin, and write 0 to light it.

A button always reads as pressed.

The pin was last written 0, and a pin written 0 reads 0 whatever is on it. Write 1 to every input pin before reading.

Nothing answers at the address you expected.

The PCF8574 lives at 0x20 to 0x27 and the PCF8574A at 0x38 to 0x3F. Run an I2C scanner, or check the chip’s marking and the three jumpers.

INT never changes.

It is open drain and only pulls low. Give it a pull-up to VCC, and read the port after it falls so it can release.

Questions

## Questions and answers

### Does the PCF8574 need a library?

No. Wire is the whole driver: one byte out sets all eight pins and one byte in reads them. Libraries such as Rob Tillaart’s PCF8574 add per-pin calls on top.

### How many PCF8574 boards can I put on one bus?

Eight of the PCF8574 and eight of the PCF8574A, since their address ranges do not overlap: up to 128 extra pins on two wires.

### Is the PCF8574 the chip on an I2C LCD backpack?

Yes. The backpack wires its eight pins to the display’s data and control lines, which is why those displays usually show up at 0x27 or 0x3F.

### Can a PCF8574 pin drive an LED from the pin to ground?

Not usefully. A high pin only supplies about 100 µA, so the LED barely glows. Sink the current instead: LED from VCC into the pin.

How it is modeled

## What is true about the I/O expander, PCF8574, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

The port, both ways, as above; power-up with every pin high. INT goes low when a
pin's level stops matching what it was at the last read or write, and a read or write
lets it go, which is the datasheet's rule. A write's own pins settling do not raise
it.

### Not modeled

The brief strong pull-up a real chip gives a pin as it is written from 0 to 1. The
weak pull-up is a 50 kΩ resistor here rather than a current source. The 25 mA sink
limit: a pin pulled low sinks whatever the circuit asks.

From PCF8574 I/O expander, in full.

Projects

## See the I/O expander, PCF8574 in a project

2 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

One lesson places it in its own circuit.

### Learn articles

1 lesson

- Arduino PCF8574 and MCP23017 I/O Expanders

Boards

## The boards it is shown on

This board has a built-in project with the I/O expander, PCF8574 in it.

- Arduino Uno R3

Libraries

## Arduino libraries for the I/O expander, PCF8574

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- PCF8574 (Rob Tillaart) and PCF8574 library (Renzo Mischianti)

Keep going

## Keep going

- I2C Scanner for Arduino and ESP32, and Fixes
- Arduino I2C LCD Not Working: Blank, Blocks, No Text
- I/O expander, MCP23017
- Character LCD with I2C backpack
- Keypad, 4x4

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the I/O expander, PCF8574

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
