Servos not getting enough power

i am new at arduino. i have recently started a project in which i am trying to make an humanoid robot by using:
Arduino Uno
9 servos (SG90)
breadboard
8 x 1.5volts cells
i have connected all the 5v wires and gnd wires of the servos with the breadboard in series. i have connected the arduino 5v with 5v wires of the servos through the breadboard. i am supplying arduino with my usb cable and all the other servos separately with 8 x 1.5 volts cells.
now whenever i program any servos to move some degrees it just starts jittering and vibrating and then stops (continuously repeats this cycle). what should i do? please tell me, i am trying to find the solution from many days please help me in this.
my code is here:

#include <Servo.h>

Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;
Servo servo6;
Servo servo7;
Servo servo8;
Servo servo9;
unsigned long m = millis();
int servoPos = 0;
void setup() {
  // put your setup code here, to run once:
  servo1.attach(2);
  servo2.attach(3);
  servo3.attach(4);
  servo4.attach(5);
  servo5.attach(6);
  servo6.attach(7);
  servo7.attach(8);
  servo8.attach(9);
  servo9.attach(10);
  Serial.begin(9600);

  initial_position();
}

void loop() {
  // put your main code here, to run repeatedly:

  delay (1000);
  say_hi();
  delay (1000);
  for (servoPos = 90; servoPos > 0; servoPos--) {
    servo4.write(servoPos);
  }
  delay (1000);
say_hi_from_lefthand();
delay (1000);
for (servoPos = 90; servoPos > 0; servoPos--) {
  servo5.write(servoPos);
}
delay (1000);
}
void initial_position() {// i will locate the degrees of all the servos to the standing position of the robot/
  servo1.write(90);
  servo2.write(0);
  servo3.write(180);
  servo4.write(0);
  servo5.write(0);
  servo6.write(90);
  servo7.write(90);
  servo8.write(90);
  servo9.write(90);
}


void say_hi() {
  for (int i = 1; i <= 3; i++) {//in order to run it three times/
    for (servoPos = 90; servoPos < 180; servoPos++)
    {

      servo4.write(servoPos);

      delay(10);
    }
    for (servoPos = 180; servoPos > 90; servoPos--) {
      servo4.write(servoPos);
      delay(10);
    }
  }
}

void say_hi_from_lefthand(){
 for (int i = 1; i <= 3; i++) {//in order to run it three times/
    for (servoPos = 90; servoPos < 180; servoPos++)
    {

      servo5.write(servoPos);

      delay(10);
    }
    for (servoPos = 180; servoPos > 90; servoPos--) {
      servo5.write(servoPos);
      delay(10);
    }
  }  
}

Servos require 4.8 to 6V power. 8x 1.5V cells provide 12V, which will damage or destroy the servos.

A 4xAA battery pack will work for 1 to 3 SG90 servos. For nine servos, you need a power supply capable of providing around nine Amperes.

So how many cells should i use can you please tell me?

See reply #2.

It means should i use 12 cells for 9 servos. Is that so
Bever mind i am just tired of this problem can you just directly tell me the amount of cells that i suppose to use? Please

Power three sets of three servos independently. Each set of three servos gets one 4xAA battery pack. For better performance and longer battery lifetime, have four sets of two servos, each powered independently.

Don't forget to connect all the grounds.

Can i use 3x1.5 volts cells to power 2 servos independently?

Please that's my last question please tell me so i can apply this to my servos

Please that's last time?
?
Can i use 3 x 1.5 volts battery pack to power 2 servos please that's my last question please i am really sorry for disturbing you

No. The servo power supply MUST be able to provide 4.8 to 6V at 1 Ampere per servo (for small servos).

Hi,

Don't you mean Parallel?

Can I suggest you just get ONE servo connected and working before adding the rest?
It looks like you have jumped in and written a lump of code, instead of doing your coding in stages.

Go back and write code for just one servo.
In fact load the sweep example in the IDE Servo example.

Can you please post a picture of your project.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

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