vibrating servos,erratic movements

Hi

I have looking through many posts, with similar problems but I think that my problem is a bit different...

I will explain to you the wiring

I have 3 servos like this one

3 signals to 3 digital arduino pins

A 7.4V and 2200 mAh battery, powering directly the three servos.

Besides, the battery goes to the Vin pin and ground of my arduino.

I just want to move the three servos together

My code is:

#include <Servo.h>


// Variables estáticas

Servo servoc1;
Servo servoc2;
Servo servoc3;

// Variables dinámicas


void setup() {
  // put your setup code here, to run once:

 servoc1.attach(4); //servo derecha
 servoc2.attach(5); // servo izquierda
 servoc3.attach(6); //servo arriba     
}

void loop() {
  
   servoc1.write(50); 
    servoc2.write(50);
     servoc3.write(50);
   delay(2000);
    servoc1.write(110); 
     servoc2.write(110);
      servoc3.write(110);
   delay(2000);
}

My problem is that servos moves erratic, it moves from one to another position, but sometimes during the delay they move like vibrating, other times the movement from 50 to 110 happens in two steps, like if it goes to 80 and then to 110.
Sometimes they move fine...but those are the less.

I don't know where is the problem... I tried powering just one servo... and the problem is thesame...

Any ideas? Thanks

You shared GND between Arduino and servos?

try just putting the battery on the breadboard rails and sharing arduinos ground with it.

It is shared...

GND of the servos goes to a switch
GND of the arduino goes to a switch

Switch goes to the battery gnd

I thought an option could be having two different batteries... one for arduino and othe rfor the servos... But it doesn't seem logic

Hi,
Why are you switching gnd?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a picture of your project?
What model arduino are you using?
Do you have a DMM?

Thanks.. Tom.. :slight_smile:

Sorry about my drawing skills...

This is how I did the wiring

I think that the code is ok, so ... it has to be or a problem on how I did the wiring, or malfunction servos...

Thanks in advance

Hi,

What size wire are you using?
Do you have a DMM to measure the battery voltage while you move the servos.
Are you batteries charged?

Can you please post a picture of your project?

Please put the switch in the positive wire of the battery, instead of the gnd.

It is a standard that everybody uses and ensures that interconnection with other equipment will be reliable.
Connect ALL gnds together at the battery terminal.

Thanks.. Tom... :slight_smile: