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 PWM (Pulse Width Modulation) controller designed for applications requiring precise control of multiple outputs. It is commonly used for controlling servos, LEDs, and other devices that require PWM signals. The PCA9685 communicates via the I2C protocol, making it easy to interface with microcontrollers such as Arduino, Raspberry Pi, and others. Its ability to control up to 16 channels simultaneously makes it ideal for robotics, lighting systems, and other multi-output applications.

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

  • Servo motor control in robotics
  • LED dimming and lighting effects
  • Motor speed control
  • Signal generation for various devices
  • Animatronics and hobby projects

Technical Specifications

The PCA9685 offers robust features for PWM signal generation. Below are its key technical specifications:

Parameter Value
Operating Voltage 2.3V to 5.5V
Logic Voltage 3.3V or 5V (I2C logic level compatible)
PWM Resolution 12-bit (4096 steps)
Number of Channels 16
Maximum Output Current 25mA per channel
Maximum Frequency 1.6 kHz
Communication Protocol I2C
Default I2C Address 0x40 (configurable via address pins)
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 Type Description
VCC Power Power supply input (2.3V to 5.5V)
GND Ground Ground connection
SDA Input/Output I2C data line
SCL Input I2C clock line
OE Input Output enable (active low)
A0–A5 Input I2C address selection pins
LED0–LED15 Output PWM output channels
EXTCLK Input External clock input (optional)
V+ Power External power for driving LEDs or servos

Usage Instructions

The PCA9685 is straightforward to use in a circuit. Below are the steps and considerations for using it effectively:

Connecting the PCA9685

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V power source, and GND to ground.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller. Use pull-up resistors (typically 4.7kΩ) if not already present on your board.
  3. Output Devices: Connect servos, LEDs, or other devices to the LED0–LED15 pins. If driving high-power devices, connect an external power source to the V+ pin.
  4. Address Configuration: Use the A0–A5 pins to set the I2C address if multiple PCA9685 modules are used in the same system.

Example: Using PCA9685 with Arduino UNO

Below is an example of how to control a servo motor using the PCA9685 and Arduino UNO:

Circuit Diagram

  • Connect VCC and GND of the PCA9685 to 5V and GND of the Arduino.
  • Connect SDA and SCL of the PCA9685 to A4 and A5 of the Arduino (for older boards) or to the dedicated SDA and SCL pins (for newer boards).
  • Connect the servo motor to one of the PWM output pins (e.g., LED0).

Code Example

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

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

void setup() {
  // Initialize I2C communication
  pwm.begin();
  
  // Set the PWM frequency to 50 Hz (common for servos)
  pwm.setPWMFreq(50);
}

void loop() {
  // Set servo on channel 0 to a specific position
  // 0 corresponds to 0 degrees, 4095 corresponds to 180 degrees
  int servoMin = 150; // Minimum pulse length for 0 degrees
  int servoMax = 600; // Maximum pulse length for 180 degrees
  
  // Move servo to 90 degrees
  int pulseLength = (servoMin + servoMax) / 2;
  pwm.setPWM(0, 0, pulseLength);
  
  delay(1000); // Wait for 1 second
}

Best Practices

  • Use decoupling capacitors near the VCC pin to reduce noise.
  • Avoid exceeding the maximum current rating of 25mA per channel.
  • If driving high-power devices, ensure the external power supply connected to V+ can handle the load.
  • Use proper heat dissipation methods if the module operates at high currents for extended periods.

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. Check for pull-up resistors.
  2. PWM Outputs Not Working

    • Cause: Incorrect frequency or pulse width settings.
    • Solution: Ensure the PWM frequency is set correctly (e.g., 50 Hz for servos). Verify pulse width values.
  3. Overheating

    • Cause: Exceeding current limits or insufficient cooling.
    • Solution: Reduce the load on each channel or improve heat dissipation.
  4. Flickering LEDs

    • Cause: Insufficient power supply or incorrect PWM settings.
    • Solution: Use a stable power source and verify PWM frequency and duty cycle.

FAQs

  1. Can I use multiple PCA9685 modules in one system?

    • Yes, you can connect up to 62 modules by configuring the A0–A5 address pins.
  2. What is the maximum number of servos I can control?

    • Each PCA9685 can control up to 16 servos. With multiple modules, you can control hundreds of servos.
  3. Can I use the PCA9685 with a 3.3V microcontroller?

    • Yes, the PCA9685 is compatible with both 3.3V and 5V logic levels.
  4. What is the default I2C address of the PCA9685?

    • The default address is 0x40, but it can be changed using the A0–A5 pins.

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