Issues with Servos

Hello, (With Ardiuno Uno) I have a small moveable robot with 2 continuous servos and 1 normal servo. Essentially the 2 continuous sit on left and right sides, and the normal one sits in the center a couple inches forward. In brief the center servo just raises and lowers a third wheel to tilt the robot of the tip of itself and on.

Anyway Im trying desperately to program some pre determines paths and falling short each time. With the current code I have it works great when plugged in to the USB port. However once its on batter it has a mind of its own; often it doesn't carry out the full cycle. I wonder why??

Here's my code: http://pastebin.com/dk19RV4h

Anyway any way I can fix this problem? Or any suggestions to a newcomer to better format this code, because at the current format Im not getting to far.

What are you using for a power supply? Servos need a strong power supply.

Allow an amp per servo for small servos, more for larger.

All three servos are on the 5v Pin, on the Arduino Board, and the Arduino is plugged into a 9v Battery.

The Arduino 5v pin can’t provide enough power for servos - you risk damaging the Arduino.

And a PP3 9v battery can’t provide nearly enough current for motors - it is only intended for low current applications. It wouldn’t even power the Arduino on its own for very long.

…R

Typical way to power servos with an external power supply.

zoomkat: Typical way to power servos with an external power supply.

Can I use an 9v batter hooked directly into the 2 servos? Also would the power sources ground go into the arduino?

bt1996:

zoomkat: Typical way to power servos with an external power supply.

Can I use an 9v batter hooked directly into the 2 servos? Also would the power sources ground go into the arduino?

The answer is already in one of the earlier replies.

...R

bt1996: 1- Can I use an 9v batter hooked directly into the 2 servos? 2- Also would the power sources ground go into the arduino?

1- No, unless the servo is rated 9v... most are 4.8-6v., so you'll need the right voltage. You could use a regulator to take 9 down to 6, but PP3s are useless anyway and it's a huge waste to lose all that energy if you regulate. As suggested, go for Edit: Try 4x1.5. (If you use rechargeables those are 1.2, so 4 of those for 4.8 is on the low limit. I have seen battery packs that piggy back a 5th 1.2 to give you 6)

2- Yes