

The PCA9685 Breakout Board, manufactured by NXP Semiconductors (Part ID: PCA9685), is a versatile 16-channel, 12-bit PWM controller. It communicates via the I2C protocol, enabling precise control of devices such as servos, LEDs, and other components requiring PWM signals. This breakout board is widely used in robotics, lighting systems, and other applications where multiple PWM outputs are needed.








The PCA9685 Breakout Board has the following key pins:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (2.3V to 5.5V). |
| GND | Ground connection. |
| SDA | I2C data line for communication. |
| SCL | I2C clock line for communication. |
| OE | Output enable pin (active low). Disables all outputs when pulled high. |
| PWM0-PWM15 | 16 PWM output pins for controlling servos, LEDs, or other devices. |
| A0-A5 | Address selection pins for configuring the I2C address. |
| V+ | External power supply for driving high-current devices (e.g., servos or LEDs). |
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 50Hz (suitable for servos)
pwm.setPWMFreq(50);
}
void loop() {
// Define the servo pulse width range (in microseconds)
int servoMin = 150; // Minimum pulse width (0 degrees)
int servoMax = 600; // Maximum pulse width (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, set pulse width
delay(10); // Small 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, set pulse width
delay(10); // Small delay for smooth movement
}
}
setPWMFreq() function sets the PWM frequency. For servos, 50Hz is standard.setPWM() function controls the pulse width for a specific channel. Adjust the pulse width to control the servo angle.No Response from the PCA9685
Servos or LEDs Not Functioning
PWM Outputs Are Erratic
Overheating or Damage
Can I use the PCA9685 with a 3.3V microcontroller?
Yes, the PCA9685 is compatible with both 3.3V and 5V logic levels.
What is the maximum number of PCA9685 boards I can use on a single I2C bus?
Up to 62 boards can be used by configuring unique I2C addresses via the A0-A5 pins.
How do I calculate the pulse width for a specific servo angle?
Use the formula: pulseWidth = map(angle, 0, 180, servoMin, servoMax); where servoMin and servoMax are the pulse width limits for your servo.
This documentation provides a comprehensive guide to using the PCA9685 Breakout Board effectively. For further details, refer to the official datasheet from NXP Semiconductors.