First servo on the PCA9685 driver

An SG90 on channel 8 of the PCA9685 servo driver sweeps all the way (600 → 2400 → 1500 µs) when the ESP32 tells it to.

#servo#pca9685#power#esp32
TABLE OF CONTENTS

Result. An SG90 on channel 8 of the PCA9685 servo driver sweeps all the way (600 → 2400 → 1500 µs) when the ESP32 tells it to. Getting there meant finding a dead power path on the driver, and learning where servo power must and must not come from.

The setup now.

Part Goes to
ESP32 GPIO 33 / 32 driver SDA / SCL (I2C)
ESP32 GPIO 25 (driven HIGH, 3.3 V) breadboard + rail → driver VCC (the chip's logic)
ESP32 GND breadboard − rail → driver GND
Variable adapter, 5.36 V MB102 power module on a separate 400 breadboard → rails at 4.84 V
Servo board + rail driver's header V+ pin (feeds every servo's red pin)
Servo board − rail ESP32 board − rail (the only wire between the two boards)
SG90 channel 8: brown → brown (GND), red → red (V+), orange → yellow (PWM)

The driver's header rows are colour-coded like a servo plug: yellow = PWM, red = V+, brown = GND.

What happened, in order

1. The driver answered, but no servo moved. The startup log said the PCA9685 was found, and a sweep command stepped channel 8 from 1500 to 2400 µs and back. So the ESP32 and I2C were fine: the problem was on the servo side.

2. No power reached the servo pins. With the adapter wired into the driver's green screw terminal:

  • screw heads: 5.36 V (red on V+, so the polarity was right)
  • red row of the servo headers: 0 V
  • V+ screw → brown row: 5.36 V (ground fine); red row → GND screw: 0 V (+ broken)

So the + path from the terminal to the headers is open. These boards put a reverse-polarity protection part right behind the terminal; on mine, that part (or a joint) doesn't conduct. A different wire wouldn't help, because the voltage already reached the screw metal.

3. My mistake: I fed the red row from the ESP32's breadboard rail. It read 3 V, which wasn't servo power at all: that rail is driven by GPIO 25. A GPIO can only give 20–40 mA, and a servo wants hundreds; worse, if the adapter's 5.4 V had ever reached that rail, it would have pushed into the pin. Soon after, the Mac lost the board's USB connection and the display showed garbled text (its own start page, because the sketch wasn't running). Unplugging and replugging brought it back, and the ESP32 survived: it still found the driver, which is powered from GPIO 25.

4. The fix: servo power on its own board. The MB102 on a second breadboard, the driver's header V+ pin to its + rail, and the two boards joined by ground only. Then the sweep worked, with no resets.

What I learned

  • A servo driver has two power inputs: VCC for the chip's logic (3.3 V from the ESP32 side) and V+ for the servos (5–6 V from a separate supply). They meet only at ground.
  • Never power servos from the ESP32 or anything on its rails. Shared ground is required; shared + is never OK.
  • Splitting a break in two: measure + against the far end's ground, then the far end's + against ground. The one that reads 0 shows which side is open.
  • A "voltage" on a dead rail can be leakage: with servos plugged in, the 3.3 V PWM signals leak back through them and show up on an unpowered V+ row.
  • The header's V+ pin is a second way into the servo rail, without polarity protection.
  • The MB102 gave 4.84 V from 5.36 V in. Fine for the SG90, but the module only handles about 0.8 A, and wants 6–7 V in for a steady 5 V. The MG996R and DS3218MG need the adapter wired straight to V+ with thick wire.

Comments (0)

Leave a comment

Loading comments