Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use PCF8574: Examples, Pinouts, and Specs

Image of PCF8574
Cirkit Designer LogoDesign with PCF8574 in Cirkit Designer

Introduction

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.

Explore Projects Built with PCF8574

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Biometric and RFID Security System with Dual Adafruit Feather nRF52840 Controllers
Image of Rfid access control: A project utilizing PCF8574 in a practical application
This circuit features two Adafruit Feather nRF52840 microcontrollers, each interfaced with an RFID-RC522 module for RFID communication and an AT24C256 external EEPROM for additional memory storage. One of the microcontrollers is also connected to an R307 Fingerprint Sensor for biometric input, and both microcontrollers are powered by a shared power supply and a coin cell breakout for backup or RTC power. The circuit is likely designed for secure access control or identification purposes, utilizing both RFID and fingerprint authentication, with data storage capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Cellular-Enabled IoT Device with Real-Time Clock and Power Management
Image of LRCM PHASE 2 BASIC: A project utilizing PCF8574 in a practical application
This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Real-Time Clock with I2C LCD Display and IO Expansion
Image of teste: A project utilizing PCF8574 in a practical application
This circuit is an Arduino-based real-time clock and display system. It uses an Arduino UNO to interface with a DS1307 RTC module for timekeeping and a 20x4 I2C LCD to display the current time and date. Additionally, a PCF8574 IO Expansion Board is used to extend the I2C bus for additional I/O operations.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Access Control System with Fingerprint and RFID Authentication
Image of SmartDoor: A project utilizing PCF8574 in a practical application
This circuit features an ESP32 microcontroller interfaced with a fingerprint scanner, RFID-RC522 module, a 12V solenoid lock, a buzzer, and an MKE-M07 LCD1602 I2C display. The ESP32 controls access through the solenoid lock based on authentication from the fingerprint scanner or RFID reader, provides feedback through the buzzer, and displays information on the LCD. A 5V relay is used to drive the solenoid lock, and the ESP32 manages the overall logic and communication between components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with PCF8574

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Rfid access control: A project utilizing PCF8574 in a practical application
Biometric and RFID Security System with Dual Adafruit Feather nRF52840 Controllers
This circuit features two Adafruit Feather nRF52840 microcontrollers, each interfaced with an RFID-RC522 module for RFID communication and an AT24C256 external EEPROM for additional memory storage. One of the microcontrollers is also connected to an R307 Fingerprint Sensor for biometric input, and both microcontrollers are powered by a shared power supply and a coin cell breakout for backup or RTC power. The circuit is likely designed for secure access control or identification purposes, utilizing both RFID and fingerprint authentication, with data storage capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LRCM PHASE 2 BASIC: A project utilizing PCF8574 in a practical application
Cellular-Enabled IoT Device with Real-Time Clock and Power Management
This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of teste: A project utilizing PCF8574 in a practical application
Arduino UNO-Based Real-Time Clock with I2C LCD Display and IO Expansion
This circuit is an Arduino-based real-time clock and display system. It uses an Arduino UNO to interface with a DS1307 RTC module for timekeeping and a 20x4 I2C LCD to display the current time and date. Additionally, a PCF8574 IO Expansion Board is used to extend the I2C bus for additional I/O operations.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SmartDoor: A project utilizing PCF8574 in a practical application
ESP32-Based Access Control System with Fingerprint and RFID Authentication
This circuit features an ESP32 microcontroller interfaced with a fingerprint scanner, RFID-RC522 module, a 12V solenoid lock, a buzzer, and an MKE-M07 LCD1602 I2C display. The ESP32 controls access through the solenoid lock based on authentication from the fingerprint scanner or RFID reader, provides feedback through the buzzer, and displays information on the LCD. A 5V relay is used to drive the solenoid lock, and the ESP32 manages the overall logic and communication between components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Expanding GPIO pins for microcontrollers like Arduino, Raspberry Pi, or ESP32.
  • Driving LEDs, relays, or other output devices.
  • Reading input from switches, sensors, or keypads.
  • Interfacing with LCD displays or other peripherals.
  • Applications requiring minimal pin usage for communication (via I2C).

Technical Specifications

Key Technical Details

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

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the PCF8574 in a Circuit

  1. Power Supply: Connect the VDD pin to a power source (2.5V to 6V) and the VSS pin to ground.
  2. I2C Address Configuration: Use the A0, A1, and A2 pins to set the I2C address. These pins can be connected to either VDD (logic HIGH) or VSS (logic LOW) to configure the address.
    • Example: If A0, A1, and A2 are all connected to VSS, the I2C address is 0x20.
  3. I2C Communication: Connect the SCL and SDA pins to the corresponding I2C pins on the microcontroller.
  4. GPIO Pins: Use the P0 to P7 pins as inputs or outputs, depending on your application. Pull-up resistors may be required for input configurations.
  5. Interrupt Pin (Optional): The INT pin can be used to detect changes on input pins. It is active LOW and requires external pull-up.

Important Considerations and Best Practices

  • Pull-Up Resistors: The I2C bus requires pull-up resistors on the SCL and SDA lines. Typical values range from 4.7 kΩ to 10 kΩ.
  • Current Limitations: Ensure that the sink and source currents of the GPIO pins do not exceed the specified limits.
  • Address Conflicts: Avoid I2C address conflicts when using multiple devices on the same bus.
  • Interrupt Handling: If using the INT pin, ensure your microcontroller is configured to handle external interrupts.

Example: Using PCF8574 with Arduino UNO

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
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. I2C Communication Not Working

    • Cause: Incorrect I2C address or wiring.
    • Solution: Verify the I2C address configuration (A0, A1, A2) and check the connections for SCL and SDA.
  2. GPIO Pins Not Responding

    • Cause: Incorrect pin configuration or insufficient current.
    • Solution: Ensure the pins are configured correctly as inputs or outputs. Check the current requirements of connected devices.
  3. Interrupt Pin Not Triggering

    • Cause: No pull-up resistor on the INT pin.
    • Solution: Add an external pull-up resistor to the INT pin.
  4. Multiple Devices on I2C Bus Not Working

    • Cause: Address conflict or insufficient pull-up resistance.
    • Solution: Ensure each device has a unique I2C address. Use appropriate pull-up resistor values.

FAQs

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.