← All parts
Adafruit PCA9685 16-Ch PWM/Servo
Adafruit
A 16-channel PWM/Servo driver that uses I2C communication and can be chained with up to 62 boards, each with its own unique address.
In stock
Specifications
3- Operating Voltage
- 3 - 5V for VCC; up to 6V for V+
- Logic Level
- 3 - 5V
- Gpio Count
- 16
Pinout
6| Pin | Name | Functions | Notes |
|---|---|---|---|
| VCC | Logic Power | POWER | Connect this to the logic level you want to use for the PCA9685 output, should be 3 - 5V max! It's also used for the 10K pullups on SCL/SDA so unless you have your own pullups, have it match the microcontroller's logic level too! |
| GND | Ground | GND | This is the power and signal ground pin, must be connected |
| SCL | I2C Clock | I2C | Connect to your microcontroller's I2C clock line. Can use 3V or 5V logic, and has a weak pullup to VCC |
| SDA | I2C Data | I2C | Connect to your microcontroller's I2C data line. Can use 3V or 5V logic, and has a weak pullup to VCC |
| OE | Output Enable | — | Can be used to quickly disable all outputs. When this pin is low all pins are enabled. When the pin is high the outputs are disabled. Pulled low by default so it's an optional pin! |
| PWM0-15 | PWM Output 0-15 | PWM | Each port has a PWM output, max current per pin is 25mA. |
Interactive pinout
Highlight:
BOARD
Click a pin to copy its name · tap a tag above to spotlight a bus.
Starter code
Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.
Arduino (C++)
Arduino library: Adafruit PWM Servo Driver Library
arduino
// PCA9685 16-channel PWM / servo driver (I2C) — community starter example
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm;
void setup() {
Serial.begin(115200);
pwm.begin();
pwm.setPWMFreq(50); // 50 Hz for hobby servos
}
void loop() {
pwm.setPWM(0, 0, 150); // channel 0, ~1 ms pulse
delay(500);
pwm.setPWM(0, 0, 500); // ~2 ms pulse
delay(500);
}MicroPython
MicroPython library: pca9685 (kevinmcaleer/pca9685 or port)
python
# PCA9685 (ESP32) — community starter example
# lib: a PCA9685 MicroPython driver (servo/pwm)
from machine import Pin, I2C
from pca9685 import PCA9685
import time
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
pca = PCA9685(i2c)
pca.freq(50)
while True:
pca.duty(0, 1500) # channel 0, ~1.5 ms
time.sleep(1)Wiring
| Pin | Arduino Uno R3 | ESP32 DevKitC (WROOM-32) | Notes |
|---|---|---|---|
| VCC | +5V | 3V3 | Logic 3-5 V |
| GND | GND | GND | |
| SCL | A5/SCL | GPIO22 | I2C clock |
| SDA | A4/SDA | GPIO21 | I2C data |
| V+ | - | - | Separate servo power (4-6 V), commoned ground |
Typical uses
- Driving up to 16 servos / LEDs
- Robot arms, pan-tilt, lighting