PCA 9685 doesn't seem to work

I'm trying to control 4 servo motors with a PCA 9685 driver board, as shown in this video.

However, the motors I have connected don't move.

I'm using the same circuit and code as given there.
Circuit -

Code -

// Include Wire Library for I2C Communications
#include <Wire.h>

// Include Adafruit PWM Library
#include <Adafruit_PWMServoDriver.h>

#define MIN_PULSE_WIDTH       650
#define MAX_PULSE_WIDTH       2350
#define FREQUENCY             50

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

// Define Potentiometer Inputs

int controlA = A0;
int controlB = A1;
int controlC = A2;
int controlD = A3;

// Define Motor Outputs on PCA9685 board

int motorA = 0;
int motorB = 4;
int motorC = 8;
int motorD = 12;

void setup() 
{
  pwm.begin();
  pwm.setPWMFreq(FREQUENCY);
}


void moveMotor(int controlIn, int motorOut)
{
  int pulse_wide, pulse_width, potVal;
  
  // Read values from potentiometer
  potVal = analogRead(controlIn);
  
  // Convert to pulse width
  pulse_wide = map(potVal, 0, 1023, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH);
  pulse_width = int(float(pulse_wide) / 1000000 * FREQUENCY * 4096);
  
  //Control Motor
  pwm.setPWM(motorOut, 0, pulse_width);

}

void loop() {
  moveMotor(controlA, motorA);
  moveMotor(controlB, motorB);
  moveMotor(controlC, motorC);
  moveMotor(controlD, motorD);
}

The power supply I am using is a Li-Po battery giving me 7V that I have connected to the PCA 9685. The power supply is probably adequate since I have used it to drive all 4 motors without the PCA 9685 driver. I have also tried connecting the SCL and SDA pins of the PCA 9685 to the SCL and SDA pins on my Uno as well as the A5 and A4 pins on my Uno but no luck.

I have observed that, even though the power LED on the driver board lights up when I connect everything up, I get 0V between the V+ and GND pins of all 16 channels of the PCA 9685. Is my driver board itself faulty? What else could I be doing wrong?

are you sure you wired exactly as this is represented here?
I assume the UNO gets 5V from USB ?

Yes, I've checked the circuit multiple times. I'm powering the Uno by connecting it to my laptop via USB.

usually Servos would require 5V. Not sure what happens with 7V

The screw terminal connects directly to the 16 power/GND pin strips of that servo board. That circuit is completely independent, and has nothing to do with the PCA9685 chip or Arduino, apart from a shared ground.

Leave the Arduino off, and measure between power and ground of the pin strips.
If you're not getting the same voltage as on the screw terminal, then the board is faulty.
Some boars have a polarity protection mosfet in that servo power circuit, which could be blown. They changed that mosfet at some stage from a big one to a tiny smd package (bad). Also look for evaporated traces. A LiPo battery is good at removing them :slight_smile:
Leo..

1 Like

Hi,
I have a PCA9685 too and had a similar issue.
no matter what i did i couldnt get the servo's to move then i checked the PWM signals with my scope and saw that though the signals looked good (lengthwise) but the amplitude was low , it was only pushing .5v when "up" opposed to the expected 6v I had in the external supply feeding the servos. I ordered new PC9685.

The servo supply (screw terminal or V+) has nothing to do with logic voltage.

PCA9685 pins, without load, should output (almost) the same as PCA9685 supply (VCC).
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.