Servo Off External PowerSupply

Hello. I have a project where I need to power a 12v Stepper motor and a 6v high torque servo. The servo draws to much current from the arduino so I wanted to have them both powered from the same external power supply. I used a 12v 2 amp DC power supply. The stepper works fine and I have a 5V voltage regulator to lower the voltage for the servo, which I figured would work fine off 5v. With power and ground in the servo does nothing. But once the input pin from the arduino gets connected it goes crazy and turns sporadically and makes noise. The sample sketch is simple.

#include <Servo.h>

Servo myServo;

void setup()
{
Serial.begin(9600);
myServo.attach(2);
myServo.write(0);

I tried it with a smaller servo that works fine when powered from the arduino and also goes crazy when using the external 5v. I know I am doing something very simple wrong. All help is appreciated.

Thanks.

Google supply decoupling , basically you need extra capacitors on the power rails.

Yes, that's most likely it. Thanks!

Question- how is a bypass capacitor different than a regular capacitor? Or is bypass capacitor just the term for when a capacitor is being used in that method.

Or is bypass capacitor just the term for when a capacitor is being used in that method.

yes, it's a cap in a bypass application. Other application might be used as a coupling capacitor, or as part of a L/C tank circuit, etc.

Lefty

Please post details of how this works out... I have the same issue on an up coming project!!

Gladly! Ill be stopping by radioshack first thing in the morning. If it works I'll post pictures/other resources I found online.

Sounds like you don't have a common ground between the external servo power supply and the arduino. Below is a typical power setup. Bottom is how I get better servo performnce when using a 7805 reguator chip for power.

After not finding the right capacitor at radio shack I tried the common ground method and it worked great, thanks zoomkat! However, only for the small servo, not the bigger one. The larger one has no static though, it just does nothing. Which is still better than before.

Any reason why one servo would go and the other wouldnt?

here is the spec for the larger one...
4.8V 6V
Torque: 266.5 oz-inch 333 oz-inch
Speed: .20 sec @ 60° .16 sec @ 60°
Size- 2.6 x 1.18 x 2.25 in. (66x30x57mm)
Weight- 128g (4.52oz)

Any reason why one servo would go and the other wouldnt?

Bad wiring, inadequate power supply, possibly damaged by operating without a proper ground, bad code, lot of possibilites.

After not finding the right capacitor at radio shack I tried the common ground method

Common ground isn't an alternative method it is essential, you need the capacitors in addition. See this link for why:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html