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

How to Use PCA9685: Examples, Pinouts, and Specs

Image of PCA9685
Cirkit Designer LogoDesign with PCA9685 in Cirkit Designer

Introduction

The PCA9685 is a 16-channel, 12-bit Pulse Width Modulation (PWM) controller that communicates via the I2C protocol. It is widely used in robotics, automation, and lighting projects due to its ability to control multiple servos or LEDs with high precision. The PCA9685 offloads the PWM generation task from the microcontroller, freeing up resources for other operations.

Explore Projects Built with PCA9685

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO and PCA9685 Controlled Robotic Arm with Bluetooth and Audio Feedback
Image of spiderbot: A project utilizing PCA9685 in a practical application
This circuit is a multi-functional robotic control system powered by an Arduino UNO, which interfaces with a PCA9685 PWM driver to control multiple servos, an L298N motor driver to control two DC motors, and a DFPlayer Mini for audio playback. The system is designed to be controlled via Bluetooth using an HC-05 module, allowing for remote operation of servos, motors, and audio playback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled Servo System with ESP32 and Arduino
Image of robosort vison system 2: A project utilizing PCA9685 in a practical application
This circuit controls multiple servos using an Adafruit PCA9685 PWM Servo Breakout, which is powered by a 5V adapter and managed by an Arduino UNO. An ESP32-CAM and an IR sensor are also integrated, likely for remote control and obstacle detection functionalities.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Servo Motor with PCA9685 PWM Interface
Image of pca9685 with esp32: A project utilizing PCA9685 in a practical application
This circuit features an ESP32 microcontroller connected to an Adafruit PCA9685 PWM Servo Breakout board for controlling servos with pulse-width modulation (PWM). The ESP32 communicates with the PCA9685 via I2C (using pins D21 and D22 for SDA and SCL, respectively). Power is supplied by a 12V battery, which is stepped down to 5V by a converter to power the ESP32, the PCA9685, and a connected servo motor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
Image of Copy of CanSet v1: A project utilizing PCA9685 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

Explore Projects Built with PCA9685

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 spiderbot: A project utilizing PCA9685 in a practical application
Arduino UNO and PCA9685 Controlled Robotic Arm with Bluetooth and Audio Feedback
This circuit is a multi-functional robotic control system powered by an Arduino UNO, which interfaces with a PCA9685 PWM driver to control multiple servos, an L298N motor driver to control two DC motors, and a DFPlayer Mini for audio playback. The system is designed to be controlled via Bluetooth using an HC-05 module, allowing for remote operation of servos, motors, and audio playback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of robosort vison system 2: A project utilizing PCA9685 in a practical application
Wi-Fi Controlled Servo System with ESP32 and Arduino
This circuit controls multiple servos using an Adafruit PCA9685 PWM Servo Breakout, which is powered by a 5V adapter and managed by an Arduino UNO. An ESP32-CAM and an IR sensor are also integrated, likely for remote control and obstacle detection functionalities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of pca9685 with esp32: A project utilizing PCA9685 in a practical application
ESP32-Controlled Servo Motor with PCA9685 PWM Interface
This circuit features an ESP32 microcontroller connected to an Adafruit PCA9685 PWM Servo Breakout board for controlling servos with pulse-width modulation (PWM). The ESP32 communicates with the PCA9685 via I2C (using pins D21 and D22 for SDA and SCL, respectively). Power is supplied by a 12V battery, which is stepped down to 5V by a converter to power the ESP32, the PCA9685, and a connected servo motor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of CanSet v1: A project utilizing PCA9685 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

Common Applications

  • Controlling servo motors in robotic arms, drones, and RC vehicles
  • Driving LED arrays for lighting or display purposes
  • Automation systems requiring precise PWM control
  • Projects requiring multiple PWM outputs with minimal microcontroller overhead

Technical Specifications

  • Operating Voltage: 2.3V to 5.5V
  • Logic Voltage: Compatible with 3.3V and 5V logic levels
  • PWM Resolution: 12-bit (4096 steps)
  • Number of Channels: 16 independent PWM outputs
  • Communication Protocol: I2C (up to 1 MHz)
  • Default I2C Address: 0x40 (modifiable via address pins)
  • Output Frequency: Adjustable from 24 Hz to 1526 Hz
  • Maximum Output Current: 25 mA per channel (sink), 10 mA per channel (source)
  • Operating Temperature: -40°C to +85°C

Pin Configuration

The PCA9685 is typically available in a 28-pin package. Below is the pin configuration:

Pin Name Description
1-16 PWM0-PWM15 16 PWM output channels for controlling servos or LEDs
17 VCC Power supply input (2.3V to 5.5V)
18 GND Ground
19 SDA I2C data line
20 SCL I2C clock line
21-26 A0-A5 Address pins for setting the I2C address (allows up to 62 devices on one bus)
27 OE Output enable (active low, can disable all outputs when pulled high)
28 V+ External power supply for driving servos or LEDs (up to 6V)

Usage Instructions

Connecting the PCA9685

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V power source, and the GND pin to ground. If driving servos or LEDs, connect an external power supply to the V+ pin.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller. Use pull-up resistors (typically 4.7kΩ) on the SDA and SCL lines if not already present.
  3. Address Configuration: Set the I2C address using the A0-A5 pins. Leave them floating or connect them to GND/VCC to configure the address.

Example: Using PCA9685 with Arduino UNO

Below is an example of how to control 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();

#define SERVO_MIN 150 // Minimum pulse length for the servo (in 12-bit units)
#define SERVO_MAX 600 // Maximum pulse length for the servo (in 12-bit units)

void setup() {
  Serial.begin(9600); // Initialize serial communication for debugging
  pwm.begin();        // Initialize the PCA9685
  pwm.setPWMFreq(50); // Set PWM frequency to 50 Hz (standard for servos)
}

void loop() {
  // Sweep the servo from 0° to 180°
  for (int pulse = SERVO_MIN; pulse <= SERVO_MAX; pulse++) {
    pwm.setPWM(0, 0, pulse); // Set PWM on channel 0
    delay(10);               // Small delay for smooth movement
  }

  // Sweep the servo back from 180° to 0°
  for (int pulse = SERVO_MAX; pulse >= SERVO_MIN; pulse--) {
    pwm.setPWM(0, 0, pulse); // Set PWM on channel 0
    delay(10);               // Small delay for smooth movement
  }
}

Best Practices

  • Use a decoupling capacitor (e.g., 100 µF) across the V+ and GND pins to stabilize the power supply.
  • Avoid exceeding the maximum current ratings for each channel to prevent damage.
  • If using multiple PCA9685 modules, ensure each has a unique I2C address.

Troubleshooting and FAQs

Common Issues

  1. No Response from PCA9685

    • Cause: Incorrect I2C address or wiring.
    • Solution: Verify the I2C address and ensure SDA/SCL connections are correct.
  2. Servos or LEDs Not Functioning

    • Cause: Insufficient power supply or incorrect PWM settings.
    • Solution: Check the external power supply connected to the V+ pin. Ensure the PWM frequency and pulse width are configured correctly.
  3. Flickering LEDs

    • Cause: Unstable power supply or incorrect frequency.
    • Solution: Add a decoupling capacitor and verify the PWM frequency.

FAQs

  1. Can I use the PCA9685 with a 3.3V microcontroller?

    • Yes, the PCA9685 is compatible with both 3.3V and 5V logic levels.
  2. How many PCA9685 modules can I connect to a single I2C bus?

    • Up to 62 modules can be connected by configuring the A0-A5 address pins.
  3. What is the maximum current the PCA9685 can handle?

    • Each channel can sink up to 25 mA or source up to 10 mA. For higher currents, use external transistors or MOSFETs.

By following this documentation, you can effectively integrate the PCA9685 into your projects for precise PWM control.