DIAGRAMS / Arduino Mega

Starter setup with PCA9685

Connect your first servo and LED. Check the controller pins and the separate servo power supply.

  1. 01Choose a system
  2. 02Choose a diagram
  3. 03Connect the devices
Selected systemArduino Mega 2560
Change system
SELECTED VARIANT

Arduino Mega 2560 + PCA9685

The Arduino powers the module's logic, while a separate 5 V power supply feeds the servo. The LED connects directly to CH15. The resistor is built into the module.

WIRING DIAGRAM
Arduino Mega 2560 connected to PCA9685: SDA pin 20 and SCL pin 21, 5 V to VCC and common ground. Separate 5 V power supply to V+. Servo on CH0, LED directly on CH15. The module has built-in resistors on the PWM outputs.
The drawing shows electrical connections. Connector positions may vary by board manufacturer. Enlarge to read the pin labels.
  • GND Common ground
  • VCC 5 V logic
  • V+ 5 V servos
  • SDA I2C data
  • SCL I2C clock
  • PWM Output signal
PIN BY PIN

Wiring table

Colour helps you trace a wire. Pin labels determine the connection.

Connections for the Arduino Mega 2560 variant
SignalFromTo
GNDArduino Mega 2560 · GNDPCA1 · GND (left connector)Common ground for logic and servo power.
VCCArduino Mega 2560 · 5VPCA1 · VCC (left connector)
SDAArduino Mega 2560 · 20 / SDAPCA1 · SDA (left connector)
SCLArduino Mega 2560 · 21 / SCLPCA1 · SCL (left connector)
GNDPower supply · − (GND)PCA1 · GND terminal
V+Power supply · +5 VPCA1 · V+ terminalV+ powers the servos, not the PCA9685 logic.
PWMPCA1 · CH0 PWMServo · signal
V+PCA1 · CH0 V+Servo · +5 V
GNDPCA1 · CH0 GNDServo · GND
PWMPCA1 · CH15 PWMLED · anode (+)No additional resistor. The diagram assumes a module with a series resistor on the PWM output.
GNDLED · cathode (−)PCA1 · CH15 GND
HOW TO WIRE THE CIRCUIT

Things to remember

01

I2C signals

On the Mega 2560, use pins 20 (SDA) and 21 (SCL). The connectors labelled SDA and SCL on the R3 header carry the same signals.

02

Two power circuits

VCC supplies the PCA9685 logic from the Arduino 5 V pin. V+ is a separate 5 V rail for the servo. Connect the grounds, but do not connect V+ to Arduino 5 V or Vin. The Arduino is powered via USB in this setup.

03

LED and servo on one module

The diagram covers a board with built-in series resistors on the PWM outputs. The LED connects to CH15 and GND without an additional resistor. Choose an LED suited to the module's output specifications. All PCA9685 channels use the same PWM frequency. Set the frequency required by the servo, usually around 50-60 Hz. The LED may flicker when dimmed at this frequency. Use a separate PCA9685 for a higher LED frequency.

04

Before connecting

Disconnect power during assembly. Check the pin labels on your specific module and the LED polarity. Servo wire colours vary by manufacturer. The drawing shows a module with OE pulled to ground by default; on another module, connect OE to GND according to its documentation.

Diagram documentation

Pinouts and connection rules have been checked against manufacturer documentation.

Enlarged view. On a small screen, scroll the diagram horizontally.

FREE · NEWSLETTER AND LAUNCH

We will let you know when
the app is ready

Sign up for the newsletter. After launch, we will email you a link to an account where you can download the app.

LET'S TALK ABOUT PRO

Your idea
PRO possibilities

Tell us about your model. We will help you choose the right application features and work out where to start.

  • Scenes and device control
  • Automation and integrations
  • A conversation about your project
maqsterLight. Motion. Sound.

We will reply to the email address you provide. Privacy policy.

Contact

Discuss control for your model

Tell us what you would like to do with your model layout. After a consultation, we will prepare a complete system tailored to your project.

  • Device and scene plan
  • Local control and configuration backups
  • Controllers, protocols and integrations