

The PCA9685, manufactured by Adafruit, is a 16-channel, 12-bit PWM (Pulse Width Modulation) controller designed for precise control of servos, LEDs, and other devices. It communicates via the I2C protocol, allowing it to interface with microcontrollers like Arduino, Raspberry Pi, and others using only two pins (SCL and SDA). This makes it an ideal choice for robotics, automation, and lighting projects where multiple outputs need to be controlled efficiently.








The PCA9685 is a versatile and powerful component. Below are its key technical details:
| Parameter | Value |
|---|---|
| Channels | 16 PWM outputs |
| Resolution | 12-bit (4096 steps) |
| Communication Protocol | I2C |
| Operating Voltage Range | 2.3V to 5.5V |
| Logic Voltage | 3.3V or 5V compatible |
| PWM Frequency Range | 24 Hz to 1526 Hz |
| Maximum Output Current | 25 mA per channel |
| Address Configurations | 6-bit configurable (up to 62 devices on I2C) |
| Operating Temperature | -40°C to +85°C |
The PCA9685 module typically comes with the following pin layout:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (2.3V to 5.5V). Powers the logic circuitry. |
| GND | Ground connection. |
| SDA | I2C data line. Used for communication with the microcontroller. |
| SCL | I2C clock line. Used for communication with the microcontroller. |
| OE | Output enable pin. Active low; can be used to disable all outputs. |
| PWM Outputs | 16 output pins (labeled 0 to 15) for driving servos, LEDs, or other devices. |
0x40. You can change this by configuring the address pins (A0 to A5) to allow up to 62 unique addresses.Below is an example of how to control a servo using the PCA9685 and an Arduino UNO:
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// Create an instance of the PCA9685 driver
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
pwm.begin(); // Initialize the PCA9685
pwm.setPWMFreq(50); // Set PWM frequency to 50 Hz (suitable for servos)
}
void loop() {
// Move servo on channel 0 to 0 degrees
pwm.setPWM(0, 0, 150); // 150 corresponds to 0 degrees
delay(1000); // Wait for 1 second
// Move servo on channel 0 to 90 degrees
pwm.setPWM(0, 0, 375); // 375 corresponds to 90 degrees
delay(1000); // Wait for 1 second
// Move servo on channel 0 to 180 degrees
pwm.setPWM(0, 0, 600); // 600 corresponds to 180 degrees
delay(1000); // Wait for 1 second
}
Adafruit_PWMServoDriver library simplifies communication with the PCA9685.setPWMFreq() function sets the PWM frequency (50 Hz for servos).setPWM(channel, on, off) function controls the PWM signal for a specific channel. The on parameter is typically 0, and the off parameter determines the duty cycle.No Response from the PCA9685
Servos or LEDs Not Responding
Flickering LEDs
I2C Communication Errors
Q: Can I use the PCA9685 with a 3.3V microcontroller?
Q: How many PCA9685 modules can I connect to a single I2C bus?
Q: What is the maximum current the PCA9685 can handle?
Q: Can I control DC motors with the PCA9685?
This documentation provides a comprehensive guide to using the PCA9685. For further assistance, refer to Adafruit's official resources or community forums.