Servo motor and external power supply

I have 6 servo’s I am using for a project.
I need to connect a 6 volt external battery pack to power the servo’s.
I have set it up but cannot get the servo to move at all. If I test one servo powered through the arduino 5v then it moves no problem. but I cannot do this for 6 servo’s. (A also made sure gnd was connected to battery gnd and arduino gnd)

I have attached the schematic for my setup below of just one with an external power supply which doesn’t work :frowning:

Also, anyone know how to power an arduino with a battery pack too?
I tried the connecting a battery pack to Vin and GND but it didnt work.
Anyone know, it has to be diy, I cannot get to anywhere for specialised parts in time.
URGENT!!!

Is that exactly how you have it?- if you use those power rails on breadboard, there’s often a break in the middle so if you have connections towards both ends, there might be no path across the middle. edit- see attached pic

Have you checked with a meter that you have voltage at the right place and that there is continuity of all connections?

breadboard.jpg

Yes, I made it exactly like that. I don't know why it is not working. I really can't figure it out.

Anything for powering the arduino too?

Have you measured the battery pack voltage with a meter? Also a servo can draw up to 1A so you need to make sure your pack can provide that.

If you power the Arduino through Vin, it should be over 7V.

You could also try without the breadboard in case there are one or more faulty sockets- it’s not many connections, you could just hold them together with your fingers. Or tape them.

Check the supply voltage is getting to the servo and that its ground is definitely in common with Arduino ground.

You haven't posted your code...

Trust me its not the code, I have tested to see whether that works already and it does.(The code is also incredibly long and includes a new library dedicated to this project made specifically for this project).

I will check that voltage is getting through to the servo's, I don't see what would be stopping it though if voltage wasn't getting to it! Any ideas? Anyone experienced this before? Thanks for the ideas to help too!

Some multi servo test code you can try to see if your issues are hardware or software based.

//zoomkat 11-22-12 simple delimited ',' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added 
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control 
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
        }
         readString=""; //clears variable for new input
      }
    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}

Alexisa: I will check that voltage is getting through to the servo's, I don't see what would be stopping it though if voltage wasn't getting to it. Any ideas?

Loose wires, flat battery, faulty sockets in the breadboard...

My first inclination when someone says....

Trust me

... is not to. But that might just be my paranoia showing.

hmm, interesting JimboZA. I'd say definitely your paranoia showing imo. Also, for you information it was not the code. I checked connections with a multimeter Thankyou everyone for your help and advice, the problem has been solved, it was in fact dodgy clips.

8)

Glad it's sorted... Occam's Razor at work- the simplest things1