PSU for 22 Servos on Arduino Mega - external PSU causes servos to behave oddly

Hi,

I am designing a prosthetic hand with 22 4.8-5v micro servos and am using an Arduino Mega to control them from the digital pins using the servo.h Library.

They work fine when testing them one at a time with power from the 5v Arduino pin (no load on the servo of course) but when I connect them up to my 5V 30A power supply, they just rotate to the 180Deg position - regardless of what the input pin from the Arduino says - and the motor strains to continue turning, makes some electrical crackling sounds (different from the usual servo buzzing where is it just close to the angle its trying to get to) and then heats up and dies.

The code I am testing with is very basic, so I'm pretty sure it's not on that end, I just find it odd that its only when I use an external power supply (I have tried 2, one at 7A and the 30A one) do they behave differently.

This is the PSU I'm using: LETOUR DC 5V 30A Power Switching Supply 150W AC 110V/220V Converter DC 5 Volt 150 Watt Adapter LED Power Supply for LED Lighting, LED Strip, CCTV (5V 30A) : Amazon.ca: Electronics

These are the servos: Miuzei 10 pcs SG90 Servo Analog Motor, Micro Servo 9G SG90 Kit for RC Robot Arm Helicopter Remote Control : Amazon.ca: Toys & Games

Code:

#include 

Servo myservo; 

int pos = 0;  

void setup() {
  myservo.attach(23);  
}

void loop() {

myservo.write(pos);
delay(10);

}

Thanks!

Did you connect supply ground to Arduino ground.
It might help if we see a picture of the setup.

This is normally done with one or more PCA9685 servo breakout boards (Adafruit, ebay).
Then a Nano would have been enough.
Leo..

Thanks for the response, The setup is a bit of a mess too look at, but I've simplified it for testing. Arduino Mega Digital pin 22 > Servo data pin, PSU neg > Servo neg, PSU pos > Servo pos, PSU plugged into 110v outlet, Arduino Mega connected to USB.

Does the Arduino Mega need to have one of its ground pins connected to the PSU ground (and if so, does it matter which one?)?

Thanks

TechAaron:
Does the Arduino Mega need to have one of its ground pins connected to the PSU ground

(and if so, does it matter which one?)?

Yes (negative terminal of the 5volt supply).

No.

I hooked up the arduinos ground to the PSU’s and no change; the motor just moves to 180 deg and tries to keep pushing past it, as though the data pin is telling it to go past 180.

When I switch the power/ground from the servo to the arduino’s 5v & gnd, it listens to the code.

Is there any way that the PSU could be damaging the servo? Does it matter if the PSU is Linear or switching DC?

Edit: I guess maybe a better question would be how would you normally wire it up with servo sheilds and an external power supply? If I need 22 servos, can I run 2x 16 channel servo sheilds?

Got it sorted, you where right wawa, it was the ground, I just had the arduino connected to the wrong ground.

Thank you for the help!