I have and Arduino Mega Board connected to ac power supply . I have 10 servos connected to it wich all have their signal on pins 6-13. If i ttry to move one suddenly all of them start moving.
#import <Servo.h>
Servo servos[8];
void setup() {
// put your setup code here, to run once:
servos[0].attach(13);
servos[1].attach(12);
servos[2].attach(11);
servos[3].attach(10);
servos[4].attach(9);
servos[5].attach(8);
servos[6].attach(7);
servos[7].attach(6);
}
void loop() {
for (int pos = 40; pos <= 100; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
servos[2].write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (int pos = 100; pos >= 40; pos -= 1) { // goes from 180 degrees to 0 degrees
servos[2].write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Please draw and post a schematic. show all components and connections.
This sounds like a power supply issue. You did mean DC, right? DC supplied by something you plug in to AC like at the wall?
a7
yeah dc but converted from ac from the wall
A breadboard is great for low amp digital or analog signals.
If those are SG90 things then they want about 800mA as stall current. I round that up to 1 amp per servo. A breadboard cannot handle 10 amps.
If you cannot solder and make your own servo power distribution board, I then recommend using something like this

or

or

or some other power distribution block thing.
Alright tank you ![]()
