Portable Arduino with servo motor problems

Hi guys, here is the problem:

When I connect the Arduino UNO board with computer, the servo motors function well. But when I connect the Arduino with battery and remove the usb cable from computer USB port, the servo become unstable. It will suddenly stop and suddenly turn very fast. The servo should be turning from 0 degree to 180 degree, but it turn like 0 degree to 40 degree, then back to starting position again.

The battery that I use is a 12Volt, 7.2Ah rechargeable battery.It connect to the Arduino Board UNO with DC jack plug. The programming code that I use is just the example "Sweep" from the Servo library in Arduino. The battery function well as supplying voltage with other circuit (non-Arduino hobby kit);but not functioning normal in this circuit. I even tried using a 9V AC-to-DC adapter connect to Arduino UNO board and assembles with a servo motor, the problem still same.

What particular is the situation that I having here? Hope you guys can help me out with the solution. =(

Sounds like you have the servo powered from the Arduino's 5v: you mustn't do that, even though I think the tutorial says it's ok. Give the servo its own power supply....

JimboZA:
Sounds like you have the servo powered from the Arduino's 5v: you mustn't do that, even though I think the tutorial says it's ok. Give the servo its own power supply....

Indeed I powered the servo from Arduino's 5V and GND. Which mean I should use the 12V battery and make 1 extra 5V to 7V input direct into the servo with same GND instead of using the Arduino's 5V output?

No, don't power the servo from 12v: you will need to give it 4.8 to 6v, so 5v will do the trick usually, but just not the 5v from the Arduino. You'll need to link the grounds of the Arduino and the servo together.

zoomkat has a nice little pic he often posts round about here in similar threads...

EDIT: you could for example, although it's inefficient, put the 12v into the Arduino like you have and take 2 more leads from the battery to a 7805 regulator, and take that 5v to the servo.

JimboZA:
No, don't power the servo from 12v: you will need to give it 4.8 to 6v, so 5v will do the trick usually, but just not the 5v from the Arduino. You'll need to link the grounds of the Arduino and the servo together.

zoomkat has a nice little pic he often posts round about here in similar threads...

EDIT: you could for example, although it's inefficient, put the 12v into the Arduino like you have and take 2 more leads from the battery to a 7805 regulator, and take that 5v to the servo.

I tried and it now turns as normal =D thanks! But why is the 5V from Arduino different with other 5v? Is it the ampere problem? Btw, why you said "inefficient"? It did really works... :astonished:

Yep it's the current from Arduino that's the problem, although the volts are good.

The 7805 is a so-called linear device: the current is the same on the input as the output. So the power on the input side is Vin x i, while on the output it's Vout x i (and i is the same on both sides). So the difference in input to output power goes to heat: (Vin - Vout) x i, in the case of 12 to 5, you throw away 7i Watts always, which is inefficient.

JimboZA:
Yep it's the current from Arduino that's the problem, although the volts are good.

The 7805 is a so-called linear device: the current is the same on the input as the output. So the power on the input side is Vin x i, while on the output it's Vout x i (and i is the same on both sides). So the difference in input to output power goes to heat: (Vin - Vout) x i, in the case of 12 to 5, you throw away 7i Watts always, which is inefficient.

I see... I'm totally agreed with you. Is there any other solutions that is more efficient?

Yes: use a 6v battery in the first place 8)

Switching power supplies like this are better than linear supplies; this particular one can step the voltage up as well as down, which is handy.

JimboZA:
Yes: use a 6v battery in the first place 8)

Switching power supplies like this are better than linear supplies; this particular one can step the voltage up as well as down, which is handy.

I'm using the 12V with 7.2Ah battery is because the project that I'm currently doing included 5 servos and 4 DC motors. So to avoid any unexpected problem, I choose it to powered all motor. ]:smiley: ]:smiley:

P/S: Should I get a 6V with 7.2Ah battery to powered all motors and will it become efficient? 8)

You can get UBECs like below that have selectable outputs for either 5v or 6v (servos work best at ~6v). Bottom is a simple way to increase the 7805 regulator chip output from 5v to 5.7v using a small diode.

http://www.ebay.com/itm/Hobbywing-5V-6V-3A-UBEC-Switch-BEC-max-5A-Lowest-RF-for-Rc-Heli-Rc-Planes-HW3A-/321153340619?pt=Radio_Control_Parts_Accessories&hash=item4ac63b14cb