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

How to Use TCA9535: Examples, Pinouts, and Specs

Image of TCA9535
Cirkit Designer LogoDesign with TCA9535 in Cirkit Designer

Introduction

The TCA9535 is a 16-bit I2C I/O port expander manufactured by MEOW. It is designed to expand the number of GPIO pins available in microcontroller-based applications. The device communicates via the I2C protocol, making it easy to integrate into systems with limited GPIO resources. The TCA9535 features two 8-bit ports, interrupt capabilities, and supports multiple devices on the same I2C bus through configurable I2C addresses.

Explore Projects Built with TCA9535

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
Image of Copy of CanSet v1: A project utilizing TCA9535 in a practical application
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
Bluetooth Audio Receiver with Battery-Powered Amplifier and Loudspeakers
Image of speaker bluetooh portable: A project utilizing TCA9535 in a practical application
This circuit is a Bluetooth-enabled audio system powered by a rechargeable 18650 Li-ion battery. It includes a TP4056 module for battery charging and protection, a PAM8403 amplifier with volume control to drive two loudspeakers, and a Bluetooth audio receiver to wirelessly receive audio signals.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO GSM Communication Hub with QR Code Reader and LCD Interface
Image of park system: A project utilizing TCA9535 in a practical application
This circuit is designed to function as a communication and control system with cellular capabilities, QR code scanning, and display output. It is built around an Arduino UNO microcontroller, interfaced with a SIM900A module, a QR code reader, and an I2C LCD screen, powered by a series of 18650 batteries through a boost converter. Tactile switches provide user interaction, and the Arduino's embedded code controls the operation of the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Powered Wi-Fi Controlled Robotic Car with OLED Display and Ultrasonic Sensor
Image of playbot: A project utilizing TCA9535 in a practical application
This circuit is a battery-powered system featuring an ESP32 microcontroller that controls an OLED display, a motor driver for two hobby motors, an ultrasonic sensor for distance measurement, and a DFPlayer Mini for audio output through a loudspeaker. The TP4056 module manages battery charging, and a step-up boost converter provides a stable 5V supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with TCA9535

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 Copy of CanSet v1: A project utilizing TCA9535 in a practical application
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of speaker bluetooh portable: A project utilizing TCA9535 in a practical application
Bluetooth Audio Receiver with Battery-Powered Amplifier and Loudspeakers
This circuit is a Bluetooth-enabled audio system powered by a rechargeable 18650 Li-ion battery. It includes a TP4056 module for battery charging and protection, a PAM8403 amplifier with volume control to drive two loudspeakers, and a Bluetooth audio receiver to wirelessly receive audio signals.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of park system: A project utilizing TCA9535 in a practical application
Arduino UNO GSM Communication Hub with QR Code Reader and LCD Interface
This circuit is designed to function as a communication and control system with cellular capabilities, QR code scanning, and display output. It is built around an Arduino UNO microcontroller, interfaced with a SIM900A module, a QR code reader, and an I2C LCD screen, powered by a series of 18650 batteries through a boost converter. Tactile switches provide user interaction, and the Arduino's embedded code controls the operation of the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of playbot: A project utilizing TCA9535 in a practical application
ESP32-Powered Wi-Fi Controlled Robotic Car with OLED Display and Ultrasonic Sensor
This circuit is a battery-powered system featuring an ESP32 microcontroller that controls an OLED display, a motor driver for two hobby motors, an ultrasonic sensor for distance measurement, and a DFPlayer Mini for audio output through a loudspeaker. The TP4056 module manages battery charging, and a step-up boost converter provides a stable 5V supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Expanding GPIO pins in microcontroller projects
  • Driving LEDs, relays, or other digital outputs
  • Reading multiple digital inputs such as switches or sensors
  • Applications requiring interrupt-driven GPIO monitoring
  • I2C-based systems with limited GPIO availability

Technical Specifications

The following table outlines the key technical details of the TCA9535:

Parameter Value
Supply Voltage (Vcc) 1.65V to 5.5V
I2C Bus Voltage 1.65V to 5.5V
Maximum I2C Clock Frequency 400 kHz (Fast Mode)
GPIO Voltage Levels 0V to Vcc
GPIO Current Sink Capability 25 mA per pin (max)
Operating Temperature Range -40°C to +85°C
Interrupt Output Open-drain, active low
Package Options TSSOP, QFN

Pin Configuration and Descriptions

The TCA9535 is available in a 24-pin package. Below is the pin configuration and description:

Pin Number 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 RESET Active-low Reset Input
5-12 P0_0 to P0_7 GPIO Port 0 Pins
13 GND Ground
14-21 P1_0 to P1_7 GPIO Port 1 Pins
22 INT Interrupt Output (active low, open-drain)
23 SCL I2C Clock Input
24 SDA I2C Data Input/Output

Usage Instructions

How to Use the TCA9535 in a Circuit

  1. Power Supply: Connect the Vcc pin to a voltage source between 1.65V and 5.5V. Connect the GND pin to the ground of the circuit.
  2. I2C Address Configuration: Use the A0, A1, and A2 pins to set the I2C address. These pins can be tied to Vcc or GND to configure the address.
  3. I2C Communication: Connect the SDA and SCL pins to the corresponding I2C lines of the microcontroller. Use pull-up resistors (typically 4.7kΩ) on both lines.
  4. GPIO Usage: Use the P0_x and P1_x pins as general-purpose input or output pins. Configure their direction and state via I2C commands.
  5. Interrupt Handling: If using interrupts, connect the INT pin to a microcontroller GPIO pin configured as an interrupt input.

Important Considerations and Best Practices

  • Ensure proper pull-up resistors are used on the I2C lines (SDA and SCL).
  • Avoid exceeding the maximum current sink capability (25 mA per pin).
  • Use decoupling capacitors (e.g., 0.1 µF) near the Vcc pin to stabilize the power supply.
  • If unused, tie the RESET pin to Vcc to prevent accidental resets.
  • Handle the INT pin carefully as it is open-drain and requires a pull-up resistor.

Example Code for Arduino UNO

Below is an example of how to use the TCA9535 with an Arduino UNO to toggle GPIO pins:

#include <Wire.h> // Include the Wire library for I2C communication

#define TCA9535_ADDR 0x20 // Default I2C address (adjust based on A0, A1, A2)

// TCA9535 Register Addresses
#define INPUT_PORT_0  0x00
#define INPUT_PORT_1  0x01
#define OUTPUT_PORT_0 0x02
#define OUTPUT_PORT_1 0x03
#define CONFIG_PORT_0 0x06
#define CONFIG_PORT_1 0x07

void setup() {
  Wire.begin(); // Initialize I2C communication
  Serial.begin(9600); // Initialize serial communication for debugging

  // Configure all pins on Port 0 as outputs
  Wire.beginTransmission(TCA9535_ADDR);
  Wire.write(CONFIG_PORT_0); // Point to configuration register for Port 0
  Wire.write(0x00); // Set all pins as outputs (0 = output, 1 = input)
  Wire.endTransmission();

  // Set all pins on Port 0 to LOW
  Wire.beginTransmission(TCA9535_ADDR);
  Wire.write(OUTPUT_PORT_0); // Point to output register for Port 0
  Wire.write(0x00); // Set all pins to LOW
  Wire.endTransmission();
}

void loop() {
  // Toggle all pins on Port 0
  Wire.beginTransmission(TCA9535_ADDR);
  Wire.write(OUTPUT_PORT_0); // Point to output register for Port 0
  Wire.write(0xFF); // Set all pins to HIGH
  Wire.endTransmission();
  delay(1000); // Wait for 1 second

  Wire.beginTransmission(TCA9535_ADDR);
  Wire.write(OUTPUT_PORT_0); // Point to output register for Port 0
  Wire.write(0x00); // Set all pins to LOW
  Wire.endTransmission();
  delay(1000); // Wait for 1 second
}

Troubleshooting and FAQs

Common Issues

  1. I2C Communication Failure:

    • Cause: Incorrect I2C address or missing pull-up resistors.
    • Solution: Verify the I2C address configuration (A0, A1, A2 pins) and ensure pull-up resistors are connected to SDA and SCL lines.
  2. GPIO Pins Not Responding:

    • Cause: Incorrect configuration of GPIO direction.
    • Solution: Ensure the GPIO pins are configured as outputs or inputs as required using the configuration registers.
  3. Interrupt Pin Not Working:

    • Cause: Missing pull-up resistor on the INT pin.
    • Solution: Add a pull-up resistor (e.g., 10kΩ) to the INT pin.
  4. Overheating or Damage:

    • Cause: Exceeding the maximum current sink capability of GPIO pins.
    • Solution: Limit the current through each GPIO pin to 25 mA or less.

FAQs

Q: Can the TCA9535 operate at 3.3V?
A: Yes, the TCA9535 supports a supply voltage range of 1.65V to 5.5V, making it compatible with 3.3V systems.

Q: How many TCA9535 devices can be connected to the same I2C bus?
A: Up to 8 devices can be connected by configuring the A0, A1, and A2 address pins.

Q: Is the TCA9535 compatible with 5V logic?
A: Yes, the TCA9535 can operate with 5V logic as long as the supply voltage (Vcc) is within the 1.65V to 5.5V range.

Q: What happens if the RESET pin is left floating?
A: The RESET pin should not be left floating. Tie it to Vcc if not used to prevent accidental resets.