PCA9685
Use an Adafruit PCA9685 PWM driver board to control up to 16 servos from a single ESP32 via I2C.
Hardware
- ESP32 development board
- Adafruit PCA9685 16-channel PWM driver
- Up to 16 servos
- External 5–6V power supply for the PCA9685 servo terminals
Wiring
| Connection | ESP32 Pin | PCA9685 |
|---|---|---|
| SDA | SDA (configurable) | SDA |
| SCL | SCL (configurable) | SCL |
| GND | GND | GND |
Connect servos to the PCA9685 output channels (0–15). Power the PCA9685 servo rail with an external 5–6V supply.
Libraries
Install via Arduino Library Manager:
- Adafruit PWM Servo Driver Library — I2C communication with the PCA9685
Configuration
- Servo channels: 16 (IDs 1–16)
- PWM frequency: 50 Hz
- Pulse range: 500–2400 microseconds
- I2C pins are configurable in the sketch
