You may have found yourself in a situation where you wanted to expand the number of inputs and outputs on your Arduino board because you were working on a project that required more devices than expected. In these cases, you only had one option: to buy a higher-end board with more connections. But now, with the PCF8574, you can easily and affordably expand your Arduino's I/O .
Here we will show you what the PCF8574 is in case you didn't know it, in addition to showing how it can be connected to your Arduino board explained step by step and how it works...
What is the PCF8574?

The PCF8574 is a digital input/output (I/O) expander for the I2C bus. This device, manufactured by Philips, allows you to connect a processor like Arduino to control more devices using fewer pins. The PCF8574 incorporates eight quasi-directional pins based on open-drain CMOS outputs.
Furthermore, the PCF8574 is a low-power device that supports VCC operations from 2.5V to 6V . It features an 8-bit quasi-bidirectional I/O port, latched outputs, an open-drain interrupt output, and high-current LED driving capability. Moreover, its standby current consumption is very low, at less than 10µA.
It's very useful for expanding the capabilities of your Arduino board beyond its limits , which can be a great help to makers who need more than what Arduino offers. The maximum current that each pin can supply will depend on the configuration.
- When it acts as an output, it is 25mA when it acts as a sink, that is, when the electrical current flows to the PCF8574. This is the default configuration.
- When it acts as a source it is 300µA, that is, when the current flows from the PCF8574. Likewise, you must know that all outputs have Latches, that is, they maintain the state by themselves in a register. We only have to act when we want to modify the state of one of the outputs.
Communication takes place via the I2C bus , making it easy to obtain data from connected devices. It's also worth noting that it has three address pins, allowing for eight possible connections to the same I2C bus. This means it's possible to control 64 devices using only two pins.
Address settings
Some models of this PCF8574 module include configuration pins and jumpers like the ones you see in the image above. Other models, however, include a switch that simplifies things with three microswitches… Either way, they are used to configure the I/O pin addresses.
| A0 | A1 | A2 | Address |
| 0 | 0 | 0 | 0 x 20 |
| 0 | 0 | 1 | 0 x 21 |
| 0 | 1 | 0 | 0 x 22 |
| 0 | 1 | 1 | 0 x 23 |
| 1 | 0 | 0 | 0 x 24 |
| 1 | 0 | 1 | 0 x 25 |
| 1 | 1 | 0 | 0 x 26 |
| 1 | 1 | 1 | 0 x 27 |
Price and where to buy
It can be found for just a few euros. It's a fairly inexpensive device considering how practical it can be for some Arduino models with fewer I/O pins. So, if you're looking for a PCF8574, you can find it in specialized stores or on large online platforms like Amazon, AliExpress, or eBay. For example, here's one we recommend:
Connecting the PCF8574 to Arduinno
To connect the PCF8574 expander to your Arduino board, the connection diagram is quite simple. You will only need to connect:
- The SCL pin marked on the PCF8574 board to the SCL pin of Arduino. This pin can change depending on the model, but is usually on the A5 on the more popular models like the UNO.
- The SDA pin of the expander has to connect with the SDA pin of the Arduino. The same thing I mentioned above, it can change depending on the model, but generally it is the A4. If in doubt, check the pinout of your model.
- The GND pin of the PCF8574 will of course be connected to the one marked GND on the Arduino, that is, it is the ground connection.
- The Vcc pin of the expander is connected to 5V of the Arduino, in this way, with GND and Vcc we have already powered the expander board so that it can start working.
Operation
Once the PCF8574 is connected to the Arduino board, it's time to understand how it works . Keep in mind that you'll have 8 extra pins available, in exchange for using two Arduino pins, in addition to the power pins. Also, remember that each of those 8 PCF8574 pins contains a MOSFET transistor along with a very low-resistance pull-up resistor. This results in a current of 100 microA when the transistor is active.
And this leaves us with the following panorama:
- Configuration as output- When the pin is used as an output, it acts as a current sink, as I have discussed above, i.e. current flows in.
- LOW: When at low voltage, it does not conduct current, load = Vdd.
- HIGH: when at high voltage, up to 25mA current can pass, the load will be connected to GND.
- Configuration as input: it must always be set to HIGH, and in this case it will act as a source, that is, the current flows out.
- Closed: When the external load is not given, the voltage on the pin goes to GND.
- Open: When an external load occurs, the pin voltage becomes Vdd.
Arduino IDE Code

If what you want is some examples of how to create code to use this PCF8574 on Arduino, it is as simple as using these code examples that you can modify according to your needs:
- Configuration as output:
#include <Wire.h>
const int pcfAddress = 0x38;
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
for (short channel = 0; channel < 8; channel++)
{
// Escribir dato en canal 'channel'
Wire.beginTransmission(pcfAddress);
Wire.write(~(1 << channel));
Wire.endTransmission();
// Leer dato de canal
delay(500);
}
}
- Configuration as input:
#include <Wire.h>
const int pcfAddress = 0x38;
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
short channel = 1;
byte value = 0;
// Leer dato de canal 'channel'
Wire.requestFrom(pcfAddress, 1 << channel);
if (Wire.available())
{
value = Wire.read();
}
Wire.endTransmission();
// Mostrar el valor por puerto serie
Serial.println(value);
}
Remember that you can also use the library created specifically for the PCF8574 , which also includes practical examples…
Table of Contents