Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use PCA9685 Breakout Board: Examples, Pinouts, and Specs

Image of PCA9685 Breakout BoardDesign with PCA9685 Breakout Board in Cirkit Designer

Introduction

The PCA9685 Breakout Board, manufactured by NXP Semiconductors (Part ID: PCA9685), is a versatile 16-channel, 12-bit PWM (Pulse Width Modulation) controller. It communicates via the I2C protocol, making it an ideal choice for applications requiring precise control of multiple servos or LEDs. This component is widely used in robotics, automation, and lighting projects due to its ability to offload PWM generation from the microcontroller, freeing up valuable processing power.

Explore Projects Built with PCA9685 Breakout Board

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 Raspberry Pi 5-Controlled Multi-Servo System with Environmental Sensing: A project utilizing PCA9685 Breakout Board in a practical application
Raspberry Pi 5-Controlled Multi-Servo System with Environmental Sensing

This circuit is designed to control multiple servos using two Adafruit PCA9685 PWM Servo Breakout boards, which are interfaced with a Raspberry Pi 5. The Raspberry Pi provides power and control signals to the PCA9685 boards, which in turn generate PWM signals to control the position of each servo. Additional sensors, including a DHT11 temperature and humidity sensor and an MKE-S01 ultrasonic distance sensor, are connected to the Raspberry Pi for environmental data acquisition.

Open Project in Cirkit Designer
Image of 16-Channel Servo Controller with Adafruit PCA9685: A project utilizing PCA9685 Breakout Board in a practical application
16-Channel Servo Controller with Adafruit PCA9685

This circuit consists of an Adafruit PCA9685 PWM Servo Breakout board connected to multiple MG995 servomotors. The PCA9685 board is used to provide PWM (Pulse Width Modulation) signals to control the position of each servomotor. Power (5V and GND) is distributed from the PCA9685 to all servomotors, and individual PWM outputs from the PCA9685 are connected to the signal inputs of the servomotors, allowing for independent control of each servomotor's angle or speed.

Open Project in Cirkit Designer
Image of 8-Channel Servo Controller with Arduino and PCA9685: A project utilizing PCA9685 Breakout Board in a practical application
8-Channel Servo Controller with Arduino and PCA9685

This circuit is designed to control multiple servos using an Adafruit PCA9685 PWM Servo Breakout board, which is interfaced with an Arduino UNO microcontroller. The PCA9685 board receives power from a 9V battery and communicates with the Arduino via I2C (SDA/SCL lines). The Arduino is programmed to generate PWM signals through the PCA9685 to independently control the position of each connected servo.

Open Project in Cirkit Designer
Image of Raspberry Pi-Controlled Dual Servo Driver with PCA9685 Interface: A project utilizing PCA9685 Breakout Board in a practical application
Raspberry Pi-Controlled Dual Servo Driver with PCA9685 Interface

This circuit controls two servomotors (MG996R and MG995) using a Raspberry Pi 5 and an Adafruit PCA9685 PWM Servo Breakout board. The Raspberry Pi communicates with the PCA9685 via I2C (using GPIO 2 and GPIO 3 for SDA and SCL, respectively) to send PWM signals to the servos. Power distribution is managed through an Adafruit Perma Proto Small Mint board, which connects the 5V and GND from the Raspberry Pi to the PCA9685 and the servos.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The PCA9685 Breakout Board is designed to simplify PWM control in complex systems. Below are its key technical details:

Key Features

Pin Configuration

The PCA9685 Breakout Board has the following pin layout:

Pin Name Description
VCC Power supply for the logic circuit (2.3V to 5.5V).
GND Ground connection.
SDA I2C data line.
SCL I2C clock line.
OE Output enable pin (active low, optional).
PWM 0-15 16 PWM output pins for controlling servos or LEDs.
V+ External power supply for driving servos or LEDs (up to 6V).
A0-A5 Address selection pins for configuring the I2C address.

I2C Addressing

The PCA9685 supports up to 62 unique I2C addresses. The base address is 0x40, and the address can be modified using the A0-A5 pins. Each pin can be tied to GND (logic 0) or VCC (logic 1) to set the desired address.

Usage Instructions

Connecting the PCA9685 to a Microcontroller

  1. Power the Board: Connect the VCC pin to the microcontroller's logic voltage (e.g., 3.3V or 5V) and the GND pin to the ground.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding I2C pins on the microcontroller.
  3. External Power Supply: If driving servos or LEDs, connect an external power supply (up to 6V) to the V+ pin. Ensure the GND of the external power supply is connected to the GND of the microcontroller.
  4. Address Configuration: Set the I2C address using the A0-A5 pins if multiple PCA9685 boards are used on the same I2C bus.

Example: Using PCA9685 with Arduino UNO

Below is an example of controlling a servo motor using the PCA9685 and Arduino UNO:

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// Create an instance of the PCA9685 driver
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize the PCA9685 board
  pwm.begin();
  
  // Set the PWM frequency to 50 Hz (common for servos)
  pwm.setPWMFreq(50);
  
  Serial.println("PCA9685 initialized and ready.");
}

void loop() {
  // Define the servo channel and pulse width range
  uint8_t servoChannel = 0; // Channel 0
  uint16_t pulseMin = 150;  // Minimum pulse width (0 degrees)
  uint16_t pulseMax = 600;  // Maximum pulse width (180 degrees)
  
  // Sweep the servo from 0 to 180 degrees
  for (uint16_t pulse = pulseMin; pulse <= pulseMax; pulse++) {
    pwm.setPWM(servoChannel, 0, pulse);
    delay(10); // Small delay for smooth movement
  }
  
  // Sweep the servo back from 180 to 0 degrees
  for (uint16_t pulse = pulseMax; pulse >= pulseMin; pulse--) {
    pwm.setPWM(servoChannel, 0, pulse);
    delay(10); // Small delay for smooth movement
  }
}

Best Practices

Troubleshooting and FAQs

Common Issues

  1. No Response from the PCA9685

    • Solution: Verify the I2C connections (SDA, SCL) and ensure the correct I2C address is being used in the code.
    • Tip: Use an I2C scanner sketch to detect the PCA9685's address.
  2. Servos or LEDs Not Functioning

    • Solution: Check the external power supply connected to the V+ pin. Ensure it matches the voltage requirements of the connected devices.
    • Tip: Confirm that the PWM frequency is set correctly for the application (e.g., 50 Hz for servos).
  3. Erratic Behavior or Noise

    • Solution: Add decoupling capacitors near the power pins and ensure proper grounding.
    • Tip: Use shielded cables for long I2C connections to reduce interference.
  4. Overheating

    • Solution: Ensure the current per channel does not exceed 25 mA. For higher currents, use external transistors or MOSFETs.

FAQs

This documentation provides a comprehensive guide to using the PCA9685 Breakout Board effectively in your projects.