PCA9685 driver and simultaneous servo motors issues

Hello all,

I am trying to use a PCA9685 driver to drive mutliple SG-90 servo motors. I am at a complete loss. When I run my code (attached below) the servos run smoothly when they are moving one at a time. But when I have two or more of them running at the same time they stop all together. All I want is simple 180 degree rotation in my servos, sometimes alone, most times together in unison. Here is my code, borrowed in tutorial by robojax on youtube.

/*************************************************** 
  This is an example for our Adafruit 16-channel PWM & Servo driver
  Servo test - this will drive 8 servos, one after the other on the
  first 8 pins of the PCA9685

  Pick one up today in the adafruit shop!
  ------> http://www.adafruit.com/products/815
  
  These drivers use I2C to communicate, 2 pins are required to  
  interface.

  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
// you can also call it with a different address and I2C interface
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40, Wire);

// Depending on your servo make, the pulse width min and max may vary, you 
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have!
#define SERVOMIN  120 // This is the 'minimum' pulse length count (out of 4096)(use135)
#define SERVOMAX  630 // This is the 'maximum' pulse length count (out of 4096)(use615)


// our servo # counter
uint8_t servonum = 0;

void setup() {
  Serial.begin(9600);
  Serial.println("16 channel Servo test!");

  pwm.begin();

  pwm.setPWMFreq(60);  // Analog servos run at ~60 Hz updates
}

void loop() {

  pwm.setPWM(0, 0, 135);
  delay(500);
  pwm.setPWM(1, 0, 135);
  delay(500);
  pwm.setPWM(2, 0, 135);
  delay(500);
  pwm.setPWM(3, 0, 135);
  delay(500);
  
  pwm.setPWM(0, 0, 615);
  delay(500);
  pwm.setPWM(1, 0, 615);
  delay(500);
  pwm.setPWM(2, 0, 615);
  delay(500);
  pwm.setPWM(3, 0, 615);
  delay(500);

  pwm.setPWM(0, 0, 135);
  pwm.setPWM(1, 0, 135);
  pwm.setPWM(2, 0, 135);
  pwm.setPWM(3, 0, 135);
  delay(1500);
  
  pwm.setPWM(0, 0, 615);
  pwm.setPWM(1, 0, 615);
  pwm.setPWM(2, 0, 615);
  pwm.setPWM(3, 0, 615);
  delay(1500);
  
}

A diagram of my connections is attached. I didn't make it I borrowed it from brainybits on youtube but its the same thing.

The motors are 5 volt and approx. 270 millamp motors.

I am using a 5 volt, 4 amp power supply. Though my voltmeter reads 4.5 volts from the power supply, and for some reason the power the motors are pulling are around 3 volts and when the problem happens and they all stop the motors are pulling about .5 volts.

Does this issue sound familiar to anyone?

The attachment accidentally diapered. here it is.

From what you posted It appears the Arduino is supplying all the power, and what you describe is what I would expect to get. I would suggest either getting a book on basic electronics or look at some on line videos to get a feel of what the terms are and how to use them, from your description you are mixing current with volts. The power supply must be connected directly to the module that actually drives the motors. I would bet if you touch the regulator on the Arduino you will get a tiny brand on that finger. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

SG90s can take up to 650mA when stalled or just starting up. But if "multiple" means only 4 as the code suggests then you should be o.k.

However you don't say exactly where you are measuring your 4.5V, 3V and 0.5V but those numbers sound like either your power supply is no good or you have some really poor high resistance connections somewhere. Can you post a clear picture of your actual setup showing all the components and wiring. Someone else's Fritzy of what you think you might have constructed doesn't really help.

Steve

Hey y'all,

So it turns out what was happening is either the breadboard I was using was throttling my amperage or the power supply I bought was wrong. Either way, when changing to 9volt betteries I recieved different results and concluded that my power was just being throttled somehow. The big project i am leading up to will have a better power supply and not run through a breadboard.