

The PCF8574T is an I2C I/O expander that allows for the addition of 8 digital input/output (GPIO) pins to a microcontroller via the I2C bus. This component is particularly useful in embedded systems where the number of available GPIO pins is limited. By utilizing the I2C protocol, the PCF8574T enables efficient communication with minimal pin usage, requiring only two lines: SDA (data) and SCL (clock).








The following table outlines the key technical details of the PCF8574T:
| Parameter | Value |
|---|---|
| Operating Voltage | 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) |
| Communication Protocol | I2C (up to 100 kHz) |
| Number of I/O Pins | 8 |
| Package Type | SOIC-16, DIP-16 |
| Operating Temperature | -40°C to +85°C |
The PCF8574T has 16 pins, as described in the table below:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | P0 | GPIO Pin 0 (bidirectional) |
| 2 | P1 | GPIO Pin 1 (bidirectional) |
| 3 | P2 | GPIO Pin 2 (bidirectional) |
| 4 | P3 | GPIO Pin 3 (bidirectional) |
| 5 | P4 | GPIO Pin 4 (bidirectional) |
| 6 | P5 | GPIO Pin 5 (bidirectional) |
| 7 | P6 | GPIO Pin 6 (bidirectional) |
| 8 | P7 | GPIO Pin 7 (bidirectional) |
| 9 | GND | Ground |
| 10 | INT | Interrupt Output (active low) |
| 11 | SCL | I2C Clock Line |
| 12 | SDA | I2C Data Line |
| 13 | A0 | Address Selection Bit 0 |
| 14 | A1 | Address Selection Bit 1 |
| 15 | A2 | Address Selection Bit 2 |
| 16 | VCC | Power Supply (2.5V to 6V) |
Below is an example of how to use the PCF8574T with an Arduino UNO to toggle an LED connected to pin P0:
#include <Wire.h> // Include the Wire library for I2C communication
#define PCF8574_ADDRESS 0x20 // Default I2C address of the PCF8574T
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Set all pins of PCF8574T to HIGH (default state)
Wire.beginTransmission(PCF8574_ADDRESS);
Wire.write(0xFF); // All pins HIGH
Wire.endTransmission();
Serial.println("PCF8574T initialized.");
}
void loop() {
// Toggle P0 (connected to an LED)
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 P0 HIGH, others HIGH
Wire.endTransmission();
delay(500); // Wait for 500ms
}
No Response from the PCF8574T
I2C Communication Errors
GPIO Pins Not Responding
Interrupt Pin Not Working
Q: Can the PCF8574T be used with 3.3V systems?
Q: How many PCF8574T devices can be connected to the same I2C bus?
Q: Can the PCF8574T drive high-current devices like motors?