I am trying to power up about 12 servos(maximum) for the standard Arduino Duemelivo by plugging them in a similar way as the default arduino sweep example(and of course updating the code by running a loop through all 12 with the Servo Library). But they dun actually power up. Sometimes 6 of them just swing erractically, sometimes 3 of them follow the potentiometer accordingly...etc.
12 servos can draw a lot of power so you will need an external power supply, 5 volts at at least a couple of amps. Connect the power line (the center pin on the servo) to the positive voltage on the supply. Connect the servo grounds to the arduino ground and the power supply ground. connect each of the servo signal pins to Arduino pins.
Do i connect 2 wires( one to the ground pin under Power, one to the ground pin under Digital of the arduino board?) Do u also mean connecting the servo's power wire to the breadboard which connect back to the arduion Power's 5V pin? thanks. Just want to make sure i get what u mean exactly.
No, you need to wire a external +5vdc from a different power supply such that it and only it wires to the power wire of each servo (usually a red wire on the servo connector).
All the servo ground wires (usuall a back wire) and the external power supply's ground wire need to hook togeather at the breadboard's power strip carrying the external +5vdc ground, and a wire from that external supply and breadboard's ground strip common ground to the Arduino's ground pin at one of it's connectors.
You new supply needs to have a current rating enough to drive all the servos, but can't tell you how much that is because it depends of the specific servos used, their mechanical load and how many you will be commading to move at the same time. It could be many amps, say 5-10 worst case.
I did according to the diagram shown and understood the principle. But the only problem is after connecting, the other half of the servos work, but the previous half stop working. The spec for the micro servo is as follows:
TG9 by Turnigy
3V-6V
9g
0.12sec/60degree(4.8V)
Torque: 1.6kg.cm
There is no info on amphere.So for the main supply I use a Switched Mode AC to DC adaptor that supply from 5V-15V at 5A or 4A. I tried all the voltage available , but its the same result. Can anyone reccommend me the appropriate power supply(Volt & amph) and how to actually calculate based on the spec above( i am new to electronic actually)? Thanks.
From the specification you give there is no way you can tell how much current is being drawn. You will have to measure it.
Do half of them just stop working at the same time or is is more of a gradual thing. If it is them the problem is probably due to lack of any decoupling on the servos. http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
If they all stop at the same time when you add an extra one you are probably disturbing the wiring.
All of them stop at the same time(not gradual..maybe sometimes). Somehow when i connect both the power for the potentiometer(through arduino board) and the external power(adaptor) to all the servos, they all work. Though it works but i dont think its actually electically correct(i.e. my arduino may die off one day). Regarding the decoupling, i am not sure how it works . Where do i even place the capacitor & how many for each servo...etc(between the power & servo ?)? Or can i do without it?
But thanks all u guys for trying to help me out thus far, despite my electical ignorance.
It reduces noise (or small rapid voltage variations) from spreading through the system and disrupting things.
Or can i do without it?
Not if you want it to work.
Where do i even place the capacitor
No hard and fast rules but at least one capacitor on each servo as close to the servo as you can.
In addition you might need some small inductors in series as well.