ESP32 PCA9685 16-Channel 12-bit PWM/Servo Driver

PCA9685 16-Channel 12-bit PWM/Servo Driver image

PCA9685

Protocol: I2C

Overview

The PCA9685 is a 16-channel, 12-bit PWM controller designed for LED and servo motor control applications. It operates over an I²C interface, allowing for easy integration with microcontrollers like the ESP32. Each of its 16 output channels can deliver PWM signals with 12-bit resolution, enabling precise control over connected devices.

About PCA9685 16-Channel 12-bit PWM/Servo Driver

The PCA9685 is a powerful 16-channel PWM driver, ideal for controlling servos, LEDs, and other PWM-based devices. It communicates via I²C, making it easy to integrate with ESP32, Arduino, and Raspberry Pi.

Key Features

  • 16 Independent PWM Channels – Control multiple servos or LEDs simultaneously.
  • High-Resolution PWM12-bit resolution (4096 steps) for precise control.
  • Adjustable PWM Frequency – Ranges from 24 Hz to 1526 Hz.
  • Wide Voltage CompatibilityLogic voltage: 2.3V – 5.5V; separate V+ pin for 5V–6V external power.
  • Expandable I²C Addressing – Connect up to 62 PCA9685 modules on the same I²C bus.

Thanks to its scalability and precision, the PCA9685 is perfect for robotics, automation, and advanced lighting systems requiring synchronized motion or lighting effects. 🚀

Where to Buy

PCA9685 16-Channel 12-bit PWM/Servo Driver

Starting from

$7 per unit

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specifications

Interface I2C
PWM Channels 16
PWM Resolution 12-bit (4096 steps)
PWM Frequency 24 Hz to 1526 Hz
Voltage (Logic Circuit) 2.3V to 5.5V
Voltage (External Power) Up to 6V (typically 5V for servos)
Output Current Sink: 25 mA, Source: 10 mA per channel
Addressable Modules Up to 62 on a single I2C bus
External Clock Supports external clock input for synchronization
Operating Temperature -40°C to 85°C

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

The PCA9685 module has the following pins, each with specific functions: VCC: Supplies power to the PCA9685 module. It can be connected to 3.3V or 5V, making it compatible with most microcontrollers, including the ESP32. GND: Ground pin for the module. Connect this to the ground of your microcontroller and power source to ensure proper operation. SDA: Serial Data pin for I2C communication. Connect this to the SDA pin of your microcontroller (e.g., GPIO21 on ESP32). SCL: Serial Clock pin for I2C communication. Connect this to the SCL pin of your microcontroller (e.g., GPIO22 on ESP32). V+: External power pin for the servo motors or LEDs connected to the PCA9685. Typically, a 5V–6V external power supply is connected here for high-current devices. Outputs 0-15: These are the 16 PWM output pins used to control servo motors, LEDs, or other PWM devices. Each pin can generate independent PWM signals. OE: Output Enable pin. This is an optional pin that can be used to disable all PWM outputs when pulled low. It is usually left unconnected in most setups. ADR: Address selection pins (A0–A5). These are used to set the I2C address of the module, allowing multiple PCA9685 modules to be used on the same I2C bus.

Wiring with ESP32

To wire the PCA9685 module with the ESP32, follow these steps: VCC: Connect the VCC pin of the PCA9685 to the 3.3V pin on the ESP32. This powers the logic circuitry of the PCA9685. GND: Connect the GND pin of the PCA9685 to the GND pin on the ESP32. This establishes a common ground for proper communication. SDA: Connect the SDA pin of the PCA9685 to GPIO21 on the ESP32, which is the default I2C data pin. SCL: Connect the SCL pin of the PCA9685 to GPIO22 on the ESP32, which is the default I2C clock pin. V+: Connect the V+ pin of the PCA9685 to an external 5V–6V power supply to provide power for the connected servos or LEDs. Ensure the power supply can handle the current requirements of all devices. Outputs 0-15: Connect the signal wire of each servo or LED to one of the PWM output pins (0-15) on the PCA9685. GND for Servos: Ensure the ground of the external power supply is connected to the GND of both the PCA9685 and the ESP32 to maintain a common reference. This wiring ensures proper communication and power distribution for the PCA9685 and connected devices.

Troubleshooting Guide

Common Issues

🛑 Servos Not Responding or Moving Erratically

🔍 PCA9685 Not Detected on I2C Bus

💡 LEDs Connected to PCA9685 Not Responding

🌡️ PCA9685 Module Overheating

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🔧

ESP-IDF Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 PCA9685 16-Channel 12-bit PWM/Servo Driver is a powerful servo sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.