

The PCA9685 is a 16-channel I2C bus LED driver with an integrated PWM (Pulse Width Modulation) controller. Manufactured by NXP Semiconductors, this component is designed to provide precise control of LED brightness and color mixing. It is widely used in applications such as LED displays, RGB lighting systems, robotics (e.g., servo motor control), and other projects requiring multiple PWM outputs.
The PCA9685 simplifies the process of controlling multiple LEDs or servos by offloading the PWM generation from the microcontroller, freeing up resources for other tasks. It supports a wide range of operating voltages and is compatible with popular microcontrollers like Arduino, Raspberry Pi, and others.








The PCA9685 has the following key technical specifications:
The PCA9685 comes in a 28-pin TSSOP package. Below is the pin configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | LED0 | PWM output for channel 0 |
| 2 | LED1 | PWM output for channel 1 |
| 3-16 | LED2-LED15 | PWM outputs for channels 2 to 15 |
| 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 | I2C address selection pins (used to set the device's I2C address) |
| 27 | OE | Output enable (active low, disables all outputs when high) |
| 28 | EXTCLK | External clock input (optional, for custom PWM frequency) |
Power Supply:
I2C Communication:
Address Configuration:
PWM Outputs:
External Clock (Optional):
Below is an example of how to control the PCA9685 using an Arduino UNO to dim an LED connected to channel 0.
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// Create an instance of the PCA9685 driver
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
void setup() {
// Initialize I2C communication
Wire.begin();
// Initialize the PCA9685 with the default I2C address (0x40)
pwm.begin();
// Set the PWM frequency to 1000 Hz
pwm.setPWMFreq(1000);
}
void loop() {
// Gradually increase brightness on channel 0
for (int i = 0; i < 4096; i++) {
pwm.setPWM(0, 0, i); // Set PWM value for channel 0
delay(1); // Small delay for smooth dimming
}
// Gradually decrease brightness on channel 0
for (int i = 4095; i >= 0; i--) {
pwm.setPWM(0, 0, i); // Set PWM value for channel 0
delay(1); // Small delay for smooth dimming
}
}
No Response from PCA9685:
LEDs Not Lighting Up:
PWM Output is Erratic:
Q: Can the PCA9685 control servos?
A: Yes, the PCA9685 is commonly used to control servos. Set the PWM frequency to 50 Hz and adjust the duty cycle to control the servo position.
Q: How many PCA9685 modules can I connect to a single I2C bus?
A: Up to 62 PCA9685 modules can be connected to a single I2C bus by configuring the A0-A5 address pins.
Q: Can I use an external clock with the PCA9685?
A: Yes, you can connect an external clock signal to the EXTCLK pin to set a custom PWM frequency.
Q: Is the PCA9685 compatible with 3.3V microcontrollers?
A: Yes, the PCA9685 is compatible with both 3.3V and 5V logic levels.