Connecting 20 Servos to Mega

i have researched and found connecting 20 servos to Arduino Mega may drain power and distroy the Mega. They suggest to power the servos separately using a 5-6V battery pack, I have tried this using 5v 2amp power supply. This is where the problem lies.....the Mega is plugged in (own power supply), the servos plugged in ( own power supply), once the PWM signal is plugged in the Mega the servo (goes crazy) rotates back and forth but i had not coded anything for that yet. it doesnt stop till i unplug one of the two power supplies. Anything idea would be helpful. Thanks

Welcome to the forum

Please post a schematic if your project.
2 amps for 20 servos does not sound enough

For small servos, budget 1 Ampere per servo, so you will need a 5V, 20 Ampere power supply at the very minimum.

For larger servos like the MG996R, budget 2.5 Amperes per servo.

Did you connect the Gnd lines of the two power supplies?


i drew this up, hope its enough to get the idea. he never had schematic plans.

https://tiltedtwister.com/tt5download.html

The project assembly instructions don't bother describing any wiring. The source code gives an indication of the servo wiring:

#define SERVO_PIN_START 22  //22 - 41
// 22 = ten hour top layer, 
// 23 = ten hour second layer and so on 

I I got that part , what about power consumption. Are all servos connected to the Mega as well. Some issues arise when too many servos are connected and unable to run or are they on separate power sorce

See post #3. An adequate power supply is absolutely required, 100 Watts minimum for 20 SG90 servos, 250 Watts minimum for 20 MG996R.

thanks. ill try that. thanks all again

With respect, the purpose of a schematic is not "to get the idea" it's to get the detail.

It's not clear from that diagram what the answer to this is:

Edit: A quick search finds there are loads of diagrams on the forum that show how to connect servos with their own power. Here's one of them:

image

Hi, @Studio41
Welcome to the forum.

An image of a hand drawn circuit will be better than trying to use a graphics program.
Please include ALL power supplies, component names and pin labels.

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

Read your comment on connecting the grounds. After I read this, It worked fine. For my information, why does this work this way. I have no issues now with my servos

Unless all of the GNDS are connected there is no common point of reference for the signal levels.

So, for instance, if the Arduino took a pin to 5V above its GND and it was connected to a servo how would the electronics of the servo know what the voltage was ? By having the GNDs connected the voltages are all referenced to the same level

1 Like

Think of a battery.... if you want to read its voltage with your meter, you need to put not only the red lead on the +ve but the black one on the -ve side of the battery.

The voltage on the signal lead from the Arduino to the servo changes from 0 to 5 in accordance with the commanded position, but to talk of "5V" only has meaning when there's a point of reference- as in the need for the black lead when measuring a battery.

Without the common ground, there is no 0V for the signal to "measure" against.

Thanks for the help. Your explanation on the GRD made a lot of sense. Thanks guys

Every signal needs a return path. The data signal from the Arduino needs to be able to travel back to the Arduino to create the loop. It's like any electric appliance; if you only connect one wire between the wall outlet and the appliance, it will not work; the current needfs to be able to flow back to the other pin of the wall outlet.

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