Overview

The PCA9685 is an I2C-bus controlled 16-channel 12-bit PWM controller manufactured by NXP Semiconductors. Originally designed as an RGBA LED driver, its 12-bit resolution (40964096 steps) and internal 25 MHz oscillator make it the industry-standard driver for driving up to 16 RC servo motors using a single I2C bus connection.

Breakout boards incorporate power regulation, a reverse-polarity protection MOSFET for motor power (V+), 220 Ω220\text{ }\Omega series resistors on output lines, and 3-pin headers (Signal, V+, GND) for direct servo plug-in.

Quick reference

Logic supply (VCC)2.3 V to 5.5 V DC
Servo / Load supply (V+)Up to 6.0 V DC (dependent on connected servos)
PWM channels16 independent outputs (PWM0 to PWM15)
PWM resolution12-bit (4096 duty-cycle steps per period)
PWM frequency rangeProgrammable from 24 Hz to 1526 Hz (typically set to 50 Hz for servos)
I2C slave addressBase 0x40 (selectable 0x40 to 0x47 via jumpers A0–A5)
All-Call / Software ResetResponds to I2C All-Call address 0x70

Pinout

Standard PCA9685 Servo Breakout Board Pinout

Pin / HeaderNameTypeDescription
Power TerminalV+ / GNDPower InputExternal high-current power supply input for servos (e.g. 5V–6V DC, 2A–10A)
Bus Header Pin 1VCCPowerLogic supply (+3.3 V to +5.0 V DC)
Bus Header Pin 2V+Power OutputPass-through external motor voltage
Bus Header Pin 3SDADigital I/OI2C Serial Data line
Bus Header Pin 4SCLDigital InputI2C Serial Clock line
Bus Header Pin 5OEDigital InputActive-LOW Output Enable pin (Must be LOW to enable outputs)
Bus Header Pin 6GNDPowerLogic Ground (0 V)
Servo Ports 0–15PWM / V+ / GNDServo Connector3-pin 0.1" headers for standard servo connectors

Specifications

ParameterSymbolMinTypMaxUnitConditions
Logic Supply VoltageVCCV_{CC}2.33.3 / 5.05.5VDC
Motor Supply VoltageV+V_+5.06.0VVia Terminal Block
Output Sink CurrentIsinkI_{sink}25mAPer pin at VOL=0.4 VV_{OL} = 0.4\text{ V}
Output Source CurrentIsourceI_{source}10mAPer pin at VOH=VCC0.4 VV_{OH} = V_{CC} - 0.4\text{ V}
Internal Clock Frequencyfoscf_{osc}232527MHzInternal oscillator
PWM FrequencyfPWMf_{PWM}24501526HzPRE_SCALE=3 to 255PRE\_SCALE = 3 \text{ to } 255

Prescaler & 50 Hz Servo Timing

The PWM frequency is set by configuring the PRE_SCALE register (0xFE):

PRE_SCALE=round(fosc4096×fPWM)1PRE\_SCALE = \text{round}\left(\frac{f_{osc}}{4096 \times f_{PWM}}\right) - 1

For a 50 Hz servo control signal with fosc=25 MHzf_{osc} = 25\text{ MHz}: PRE_SCALE=round(250000004096×50)1=round(122.07)1=121(Hex: 0x79)PRE\_SCALE = \text{round}\left(\frac{25000000}{4096 \times 50}\right) - 1 = \text{round}(122.07) - 1 = 121 \quad (\text{Hex: } 0x79)

Servo Position Pulse Width (at 50 Hz, Period = 20 ms)

Each 20 ms period is divided into 4096 steps (4.88 μs/step4.88\text{ }\mu\text{s/step}):

  • 0° (0.5 ms pulse): 102\approx 102 counts
  • 90° (1.5 ms pulse): 307\approx 307 counts
  • 180° (2.5 ms pulse): 512\approx 512 counts

Wiring

PCA9685 BreakoutMicrocontroller / Power SupplyNotes
VCC5V (or 3.3V)Logic supply from MCU
GNDGNDCommon ground
SDASDA (A4 on Uno, GPIO21 on ESP32)I2C Data line
SCLSCL (A5 on Uno, GPIO22 on ESP32)I2C Clock line
Terminal V+ / GNDExternal 5V/6V Power SupplyDedicated high-current supply for servos
Warning

Do NOT power servos from the microcontroller 5V rail: Connecting multiple servos to the PCA9685 without a dedicated external power supply on the screw terminal will overload the MCU power regulator and cause constant brownouts.

Common mistakes

  • Forgetting to set PRE_SCALE while in SLEEP mode: The PRE_SCALE register (0xFE) can ONLY be written when the SLEEP bit (bit 4 of MODE1 register 0x00) is set to 1.
  • Leaving Output Enable (OE) floating or HIGH: OE is active-LOW. If OE is pulled HIGH, all 16 PWM outputs are disabled (high-impedance).
  • Inaccurate internal clock frequency: The internal 25 MHz oscillator can drift ±5%\pm 5\%. For ultra-precise positioning, measure actual output pulse width with an oscilloscope or feed an external clock into EXTCLK.

Notes

  • Up to 62 PCA9685 boards can be cascaded on a single I2C bus to control up to 992 servos.

Assets & downloads