Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Motors & Motion
  4. ›PCA9685 16-Channel Servo Driver

How-to · Intermediate · 3 min read

PCA9685 16-Channel Servo Driver

Wiring, Power and Code

By Geekobot Learning Team · Updated 24 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWiringSizing the servo power supplyArduino code with the Adafruit libraryCalibrating pulses and the oscillatorMore boards, LEDs and alternativesTry itCommon mistakesFAQsParts and next steps
Short answer

The PCA9685 board makes 16 independent PWM signals and takes commands over I2C, so two pins on an Arduino, ESP32 or Pico can drive 16 servos without jitter. Power the chip from 3.3 or 5 V on VCC and the servos from a separate 5 to 6 V supply on V+, sized for all servos together. Set 50 Hz and send pulses of about 0.5 to 2.5 ms.

Key specs at a glance

Channels
16 PWM outputs, 12-bit (4096 steps)
Interface
I2C, default address 0x40; 6 address jumpers (up to 62 boards)
PWM frequency
About 24 to 1526 Hz (50 Hz for servos)
Logic supply (VCC)
3.3 to 5 V
Servo supply (V+)
Separate 5 to 6 V supply through the screw terminal
Resolution at 50 Hz
About 4.9 µs per step
01

Wiring

PCA9685 pinArduino UnoESP32Notes
VCC5V3V3Logic only
GNDGNDGNDCommon with servo supply
SDAA4GPIO 21
SCLA5GPIO 22
OELeave unconnected or GNDLOW enables outputs
V+ terminal5 to 6 V servo supply5 to 6 V servo supplyNot from the Arduino
Channel 0 to 15Servo plugsBrown/black to GND, red to V+, orange/yellow to signal
VCC
Arduino Uno:
5V
ESP32:
3V3
Notes:
Logic only
GND
Arduino Uno:
GND
ESP32:
GND
Notes:
Common with servo supply
SDA
Arduino Uno:
A4
ESP32:
GPIO 21
SCL
Arduino Uno:
A5
ESP32:
GPIO 22
OE
Arduino Uno:
Leave unconnected or GND
Notes:
LOW enables outputs
V+ terminal
Arduino Uno:
5 to 6 V servo supply
ESP32:
5 to 6 V servo supply
Notes:
Not from the Arduino
Channel 0 to 15
Arduino Uno:
Servo plugs
Notes:
Brown/black to GND, red to V+, orange/yellow to signal
02

Sizing the servo power supply

Servos draw far more current than most people expect, especially when they start or stall. Rough figures:

SG90 / MG90S

100 to 250 mA moving, up to about 650 to 750 mA stalled.

MG996R / MG995

500 mA to 1 A moving, up to about 2.5 A stalled.

Add up the moving current for servos that move together and allow for stalls: six SG90s need a 5 V 3 A supply; a hexapod with 18 MG996R servos needs a 6 V supply of 15 A or more (often split over two boards). Use a regulated supply such as a 5 V SMPS or a high-current buck converter, add a 470 to 1000 µF capacitor across the V+ terminal, and keep the servo wiring thick and short. An underpowered supply causes jitter, resets and twitching servos.

03

Arduino code with the Adafruit library

Install Adafruit PWM Servo Driver Library.

Sweep servo 0 with a PCA9685 · Arduino C++Verify & upload in Electrolark
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40);

const int SERVO_MIN = 500;    // microseconds, about 0 degrees
const int SERVO_MAX = 2400;   // microseconds, about 180 degrees: tune per servo

void setAngle(uint8_t ch, int deg) {
  int us = map(deg, 0, 180, SERVO_MIN, SERVO_MAX);
  pwm.writeMicroseconds(ch, us);
}

void setup() {
  pwm.begin();
  pwm.setOscillatorFrequency(27000000);  // calibrate if timing is off
  pwm.setPWMFreq(50);                    // standard servos
  delay(10);
}

void loop() {
  for (int a = 0; a <= 180; a += 5) { setAngle(0, a); delay(20); }
  for (int a = 180; a >= 0; a -= 5) { setAngle(0, a); delay(20); }
}
04

Calibrating pulses and the oscillator

Servos differ: many reach their end stops at about 0.5 and 2.4 ms, others at 1 and 2 ms. Start with a narrow range and widen it slowly; if a servo buzzes at an end, you have pushed it past its mechanical stop. The PCA9685's internal oscillator is nominally 25 MHz but varies between chips; if measured pulse widths are off, adjust setOscillatorFrequency() (values around 25 to 27 MHz are typical) until a 1500 µs pulse measures 1.5 ms on an oscilloscope or logic analyser.

05

More boards, LEDs and alternatives

Bridge the A0 to A5 address pads to give each board a different address (0x40 to 0x7F), then create one driver object per board. The same chip can dim LEDs at higher PWM frequencies (around 1 kHz). For robot arms with feedback, serial bus servos (such as the ST3215 with a Waveshare driver) report position and load, which a PCA9685 cannot do. See servo motors and I2C.

06

Try it: PWM duty cycle calculator

Change the values and the diagram and results update as you type.

07

Common mistakes to avoid

  • !Powering servos from the VCC pin or the Arduino 5V pin.
  • !Using a supply too small for all servos together.
  • !Leaving the frequency at the default instead of 50 Hz.
  • !Driving servos past their end stops so they buzz and overheat.
  • !Two boards with the same I2C address.
08

Frequently asked questions

How many servos can a PCA9685 control?

16 per board. With different address jumpers, up to 62 boards can share one I2C bus.

Why are my servos jittering on the PCA9685?

Almost always the servo power supply: too little current, long thin wires, or no capacitor on V+. Use a separate 5 to 6 V supply sized for all servos.

Can the PCA9685 work with ESP32 and Raspberry Pi?

Yes. Power VCC from 3.3 V and use the I2C pins. On a Raspberry Pi, use the Adafruit CircuitPython ServoKit library.

What frequency should I use for servos?

50 Hz, which gives a 20 ms period. Some digital servos accept higher rates, but 50 Hz works with all standard servos.

Does the PCA9685 need a separate power supply?

The logic runs from the microcontroller's 3.3 or 5 V. The servos need their own 5 to 6 V supply on the V+ terminal.

Parts for this guide

  • TowerPro SG90 9g Micro Servo (180°)
    ₹442View
  • TowerPro MG996R Metal Gear Servo (180°)
    ₹329View
  • 4-DOF Robotic Arm Kit (for SG90 / MG90S)
    ₹562View
  • Enclosed SMPS Power Supply
    ₹257View
Shop Servo Drivers & ControllersShop Servo Motors

Calculators

PWM duty cycle calculatorPower supply sizing calculator

Terms in this guide

PWMPulse-width modulation: switching a signal on and off quickly so its average sets brightness, speed or position.I2CInter-Integrated Circuit: a two-wire bus (SDA and SCL) that connects many devices by address.ServoA motor with built-in position feedback that moves to an angle set by a pulse signal.Duty cycleThe percentage of time a PWM signal is high. 50% duty is on half the time.Stall currentThe current a motor draws when its shaft is blocked; the maximum it will draw.Decoupling capacitorA small capacitor, usually 100 nF, placed next to an IC's power pins to supply short current bursts and block noise.

Projects that use it

Put this into practice: 52 step-by-step builds in our project library use parts from this guide.

Beginner · 1–2 hoursAutomatic dustbin lidView projectIntermediate · 3–4 hoursObstacle-avoiding robotView projectIntermediate · 2–3 hoursRFID card door lockView project
Browse all 52 projects

Keep learning

Component guideBeginnerServo Motors GuideA hobby servo is a small motor with a gearbox, position sensor and control circuit that moves to an angle you set with a pulse signal.3 min read · Motors & MotionConcept explainerIntermediateI2C ExplainedI2C is a two-wire bus that lets one microcontroller talk to many sensors and displays using a data line (SDA) and a clock line (SCL).4 min read · Electronics FundamentalsConcept explainerBeginnerPWM ExplainedPWM (pulse-width modulation) switches a pin fully on and off very quickly; the share of time it is on, the duty cycle, sets the average power.3 min read · Electronics FundamentalsHow-toBeginnerHow to Power an Arduino or ESP32 from BatteriesFor an Arduino Uno or Nano, feed 7 to 12 V into VIN or the barrel jack (6 x AA works well), or regulated 5 V into the 5V pin or USB.4 min read · Power & Batteries

Sources

  • NXP PCA9685 datasheet
  • Adafruit PWM Servo Driver library documentation
  • TowerPro SG90 and MG996R specifications

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWiringSizing the servo power supplyArduino code with the Adafruit libraryCalibrating pulses and the oscillatorMore boards, LEDs and alternativesTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide4 items · ₹1,590

TowerPro SG90 9g Micro Servo (180°) · TowerPro MG996R Metal Gear Servo (180°) · 4-DOF Robotic Arm Kit (for SG90 / MG90S) · Enclosed SMPS Power Supply

Run itChange the inputs and watch the output
Channel 0 0°
500 µswriteMicroseconds

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question