

The PCA9685, manufactured by Adafruit, is a 16-channel, 12-bit PWM (Pulse Width Modulation) controller designed for precise control of servos and LEDs. It communicates via the I2C protocol, making it easy to integrate with microcontrollers like Arduino and Raspberry Pi. The PCA9685 can drive up to 16 independent PWM channels with a frequency range of 24 Hz to 1526 Hz, making it ideal for applications such as robotics, lighting systems, and animatronics.








The PCA9685 breakout board has the following pin layout:
| Pin Name | Description |
|---|---|
| VCC | Logic voltage input (2.3V to 5.5V). Powers the PCA9685 chip. |
| GND | Ground connection. |
| SDA | I2C data line. Connect to the SDA pin of the microcontroller. |
| SCL | I2C clock line. Connect to the SCL pin of the microcontroller. |
| OE | Output enable pin (active low). Pull low to enable PWM outputs. |
| V+ | External power supply for servos/LEDs (up to 6V). |
| PWM0–PWM15 | 16 PWM output pins for controlling servos or LEDs. |
| A0–A5 | Address selection pins for configuring the I2C address (default: 0x40). |
Below is an example of how to control a servo motor using the PCA9685 and the Adafruit PCA9685 library:
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// Create an instance of the PCA9685 driver
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
void setup() {
// Initialize the I2C communication and PCA9685
pwm.begin();
// Set the PWM frequency to 50 Hz (suitable for servos)
pwm.setPWMFreq(50);
}
void loop() {
// Define the servo's minimum and maximum pulse lengths
int servoMin = 150; // Minimum pulse length (0 degrees)
int servoMax = 600; // Maximum pulse length (180 degrees)
// Sweep the servo from 0 to 180 degrees
for (int pulse = servoMin; pulse <= servoMax; pulse++) {
pwm.setPWM(0, 0, pulse); // Channel 0, start at 0, pulse width
delay(10); // Delay for smooth movement
}
// Sweep the servo back from 180 to 0 degrees
for (int pulse = servoMax; pulse >= servoMin; pulse--) {
pwm.setPWM(0, 0, pulse); // Channel 0, start at 0, pulse width
delay(10); // Delay for smooth movement
}
}
No Response from the PCA9685
Servos or LEDs Not Working
Flickering LEDs
Overheating PCA9685
Q: Can I use multiple PCA9685 boards on the same I2C bus?
A: Yes, you can connect up to 62 boards by configuring unique I2C addresses using the A0–A5 pins.
Q: What is the maximum current the PCA9685 can handle?
A: Each output pin can source or sink up to 25 mA directly. For higher currents, use external drivers.
Q: Can the PCA9685 control DC motors?
A: Yes, but you will need an H-bridge or motor driver circuit to control the motor's direction and speed.
Q: Is the PCA9685 compatible with 3.3V microcontrollers?
A: Yes, the PCA9685 supports logic levels from 2.3V to 5.5V, making it compatible with both 3.3V and 5V systems.