Sunday, April 1, 2012

Servo Problems With Arduino - Part 1

Servo problems are one of the most frequently posted topics within the Arduino community. While problems may arise from programming, circuit design and faulty hardware, the vast majority or problems are a result of insufficient power or incorrectly connected power.

Control is nothing without power !

The Arduino itself is very good at controlling servos, the Servo library will allow a single Arduino to control upto 12 servos with no additional hardware.

What the Arduino cannot do is deliver power to 12 Servos, its questionable whether an Arduino can reliably deliver power to even a single servo.

Power - Not All Servos Are Created Equal

While building the circuit for the pictures in this post, I decided to measure the current drawn by each of the test servos with no load applied. Each of the servos is the standard size used in radio controlled cars, they are all low end servos available for between 10 and 15 dollars. 

No Load Current Of Test Servos In mA

The Bluebird draws five times more current at no load than the Futaba, its also less smooth and the least expensive of the servos tested.

The current at no load is only relevant in a small number of applications, all of the servos drew more than the the maximum 250mA I was able to measure when subjected to a light load in the form of finger pressure.

I will be interested to follow up this test in a future post using a variety of repeatable loads to compare servo performance and current draw. The fact that the lowest cost servo draws five times more current than the Futaba servo suggest that this will be an important concern for larger autonomous projects which will need to operate both under their own power and under load.

Note that while controlling all four servos the Arduino drew only 10mA from its separate power source.

So How Can Successfully Drive Lots of Servos With An Arduino ?

The power problem is easily solved through the addition of a 'power circuit'. This is can be as simple as four disposable AA Batteries such as you might use in a camera or toy car.

4 Domestic AA Batteries in a holder

Rechargable AAs are an even better option, they store as much charge, deliver as much current and can be used again and again.

For large projects which need to operate under their own power the basic concept is the same however the choice of battery technology will be different. See the 'Performance Power' section in Part 2.

So why do we need two power circuits ?

The Arduino has a narrow operating voltage around 5 Volts (3.3 Volts in some) and is sensitive to variation in this voltage. The Arduino design is based on the assumption that a stable 5 Volt power source will be feeding the chip at the heart of the Arduino. In the case of the popular UNO, this regulated 5 Volt power is supplied by the USB Connection or through a regulator built into the board.

The onboard regulator is designed to provide power to the Arduino and supporting circuitry. It is not designed to power external devices and trying to do so is the single most common reason for failure with servo projects. This 'Not designed to power external devices' also applies to USB Connected projects.

The remainder of this post provides a walk through of setting up an Arduino servo example which will drive four servos from the Arduino using a separate power pack to meet the power requirements of the servos.

Arduino Servo Walkthrough -

1) Power The Arduino

For the walkthrough I am using an Arduino UNO powered by a PP3 9 Volt Battery.

The Arduino has been loaded with my Multi Sweep example sketch, a link is provided at the end.

While running the servos, the Arduino was drawing only 10mA. A good PP3 could power the Arduino for days, after all, they power smoke alarms for months.

 See the note below for more on the PP3 and why its not a good battery for use elsewhere in your projects.

 Note - The PP3 is a poor battery choice for most applications, it has a small charge capacity (run time) and cannot deliver the higher currents required to drive servos or motors, however the 9 volts it provides is great for powering an Arduino through the onboard regulator. As the Arduino makes so little demand on a battery the PP3 is a common and practical choice to power the Arduino - just not any shields, motors, servos, transmitters etc.

The PP3's small charge capacity and limited ability to deliver current make it an unsuitable choice for providing the power circuit in our projects, the common AA battery is a far better alternative. In the case of servos the 9 Volts supplied by an unregulated PP3 is over the 4.8 to 6 volt recommended operating range and will result in immediate damage to the servo. Again AA Batteries are a better choice as four will provide a usable 6 Volts for our servo power circuit and a better run time.

This wont work for me, I need USB for Serial Output -
This is no problem at all, you can simply connect the USB Cable to the Arduino as you normally would. This will provide power to the Arduino so you do not need to use the 9V PP3 Battery. 

You should still use the separate servo power and this will work provided that the ground from the battery pack is connected to the Arduino.

2) Power For The Servos

For servo power I am using four disposable AA Batteries. These are high capacity versions sold for cameras which will give us enough current and charge (run time) for our servos.

Each AA Battery provides 1.5 volts for a total of 6 volts (4*1.5).

Most servos are designed to operate with 4.8 to 6 volts. Powering them with more voltage can result in instant damage. The four AA Batteries give us a usable 6 volts.

I have connected the AA Batteries to the power (red) and ground (black) rails on my bread board.

Notice the black jumper running from the bread board to the Arduino ?

This is the next most common mistake in servo projects, when people introduce the servo power pack, they forget to connect a common ground.

You must connect the ground wire between the power circuit and the Arduino (control circuit) without this connection your circuit will not work. This applies whether you are powering your Arduino from a wall socket, USB port or a battery.

In the picture you can see where I have simply connected the two circuits through the black jumper wire running from the black ground rail of the bread board to the ground (GND) pin on the Arduino next to pin 13.

All of the ground pins on the Arduino are connected so use which GND pin is most convenient.

These two circuits now share a common ground allowing us to add some servos.

2) Connecting Individual Servo Power

I have added a 3-Pin section of PCB Header to make it easier to connect the female servo plug to female breadboard.

Next to this you can see that I have added a green jumper from the battery pack ground rail to pin1 of the header, this is the shared ground between the Arduino, battery pack and servo.

Next I have added a yellow jumper from the power rail - 6 Volts from the AA Battery pack - to the center pin of the header. This will provide power to our servo directly from the AA Battery pack, not from the Arduino or its 9 Volt PP3 Battery.

The final pin is the signal pin, this is the pin which the Arduino will use to tell the servo which position to hold.

Remember - Without the common ground between the Arduino and the Servo AA battery pack, your project will not work. In the picture, this common ground is provided by the black wire linking the ground rail of the breadboard with the GND pin next to pin 13 of the Arduino.

3) Adding a servo

All we need to do now is connect our first servo -
 You can see here that I have connected the first servo taking care to make sure that the black ground wire of the servo connector is connected to pin 1 of my header. This is then connected to the shared ground of the Arduino (and Battery pack ) through the green jumper wire.

You can also see that I have added headers for three more servos following the same convention of yellow for 6Volt power from the AA Battery pack and green for the shared Arduino/AA Battery pack ground.

The servo is receiving its position signals from the Arduino through the white jumper wire connected to pin 13. Remember - Without the common ground (black wire) connecting the Arduino GND Pin to the ground (-)  fo the battery pack through the black ground rail of the breadboard, this will not work !

If you have uploaded the multi sweep example sketch linked at the end of this post, you should see your servo sweeping back and forth.

4) Adding more servos

Once you have one servo up and running, you can add more by following the same convention - connect the servo plug to the header so that the end with the black wire attaches to the header pin with the green wire. You can then add a connection from the signal pin to any of the Arduino digital pins 2-13 and you should see your additional servos follow the same sweeping pattern as the first servo -

For the 'Multi Sweep' example sketch used in this video see the post - Can I control more than X Servos with an Arduino ?

Conclusions -

The Arduino can control large numbers of servos without additional hardware provided a separate power source is dedicated to the servos.

Four AA disposable or rechargeable batteries are a good choice for providing this power in smaller projects.

Large projects will require hobby batteries or fixed power supplies, part 2 will look at some of these options and the power demands of the test servos under a variety of loads.

Servo models used and current drawn at no load -

Servo                              Current mA

Futaba S3003  55
HITEC HS-322HD  75
ACE S1903  90
Bluebird BMS410  250

Duane B


  1. Nice article, congratulations. We need to see more of this real world product testing.

    1. must be tested,and need one 18AWG power supply cord.

    2. "Recondition Your Old Batteries back to 100% of their working condition" .
      - Car batteries
      - Computer and phone batteries
      - Rechargeable batteries
      - Long life batteries
      - Batteries used in alternative energy systems
      - Deep cycle marine batteries
      - Golf cart batteries
      - Forklift batteries
      - And many other kinds of common batteries!

  2. Thank you for your explanation. It was very helpful

  3. Hey, how do i rotate the servo in the opposite direction. currently i am rotating it from 0 to 45 and back to 0 but from this position i want to rotate it to -45 ie 45 in the other do i do that?

  4. Try this, but using separate power rather than the circuit suggested in the link -


  5. so how many servos in total u can drive?

  6. From the second paragraph -

    The Arduino itself is very good at controlling servos, the Servo library will allow a single Arduino to control upto 12 servos with no additional hardware.

    What the Arduino cannot do is deliver power to 12 Servos, its questionable whether an Arduino can reliably deliver power to even a single servo.

  7. I was playing around with an Uno and Fubata FP-148 servo, and came across your explanation and demonstration. Very nice work - thanks!

  8. Hi, friend,you saved my day and project!

    I am using an stepper motor with Easydriver from Sparkfun, and the motor was running without any command.

    After I connected both grounds, all started to work fine.

    Thanks a lot for your work making this post!

    Hope others can use my experience.

  9. I'm trying to run a s3003 off an arduino pro mini 5v. The system works fine when connected through a usb cable. But when I power it from a dc brick the servo acts nuts, I think the unit is continually resetting.

    I've tried two dc adapters, one at 12v and one at 9v both supplying more than 1 amp. according the label on the dc adapters.

    Can you tell me how I can test/troubleshoot? Can you confirm the wiring? I soldered the dc adapter to Vin and GND. I connect the servo's power line to the vcc pin on the side closest to d9.

    Seems like there's not enough amperage to power it but 12v 1amp should be more than the 5v usb cable was providing, which I assume is .5 amp.

    1. the 12v power source might not have any voltage smoothing (caps) built in so the down slope of the PWM especially under load can cause 0V to be recieved and the system reboots, splicing a 16V or higher cap into your 12V line should smooth out the down slope, and another cap on the supply side from board to servo should take care of the downslope from the arduinos PWM system.

  10. Thank you so much...this was very helpful

  11. Thanks a lot it is a really helpful article.

  12. Dude, this article rocks. Thank you so much, huge help for me.

  13. Super easy to read, well explained and demo'd, thank-you!

  14. muchas gracias me salvaste el proyecto ahora si funciona correctamente

  15. Thank you soooo much for the extremely clear, extremely helpful article!

  16. hey duane b, i can't seem to find the link to the multi sweep sketch :(



  18. Am I correct in assuming that this will work for bigger Servos as well without damaging my Arduino? I'm new to Arduino and I thought a Servo checker would be a fun project as it would be handy at work, we have servos ranging from 12 to 48 volts DC. As long as I make sure the voltage to the Arduino board is kept at the proper voltage, I can use whatever power supply I need for the servo, correct?

    thanks in advance.

  19. Is part2 about large project power supply?



  21. great explanation! but i'm still confused,

    is it possible to drive 2 servos with the 9v battery?

    1. 9V is too high for servos, they typically operate on 4.8 to 6 volts. A quick and easy way to get this voltage is to use 4 AA Batteries instead of one 9v battery. The 4AA Batteries will also support higher currents than a single 9V battery so your servos will support higher loads. Any model shop or electronics store will stock 4*AA Battery holders that you can use in your project.

      Your arduino has a built in voltage regulator which can produce the steady 5V that your Arduino needs from a 9V battery.

      In my standalone projects I often use a 9v to power the Arduino and 4*AA to power a servo or motors.


  22. This is entitled Problems with servos Part 1. Wheres Part 2?


  24. Thank you for this amazing post, but what if i use Arduino UNO, 4 servos and i add an HC-05 Wireless Bluetooth RF Transceiver Module serial RS232 TTL and Ultrasonic Sensor Module HC-SR04, these both should connect to the Arduino power outputs? Or how should i power them?

  25. Hi there
    Just wondering if this method can give enough power to operate 12 9g servos? (that is with the 4AA battery holder). Im currently using a mega board.


  26. I have an ESP8266 which works with 3.3V on the same breadboard as the servos. Is it correct to put the ground from the ESP, the Arduino and the battery pack (for servos) to one ground ??

    1. If you want to be able to send inputs/outputs between any two components or your project, they must have their grounds connected. So in your case I assume the ESP8266 is providing and input to the Arduino which is providing an output to the servos, in which case all three need to have a common ground.


  27. I have a project to power 4 servos & my custom pcb which has avr328(4-8mA) and a sensor shield working at 5 volts.

    the sensor & avr have common power supply via single voltage regulator 5v o/p.

    & the 4 servos have a separate power supply.
    (ground is common)

    I am a lil doubtful if i should us a single rechargeable 11.1v lipo 20-30c 1000mAH to powet the whole circuit.

    or for the servos only(via another 5v 1amp voltage regulator)
    Will it damage the servos?

  28. Hi, There a couple of things to consider here -

    1) The step down from 11.1 to 5v is a lot for the regulator to handle, it might be better to consider a 2s Lipo which will output around 8 volts giving the regulator less work to do.

    2) Each individual servo could draw 1 amp of current if it is heavily loaded, this will overload the regulator causing the output voltage to drop and effect all other components (AVR) that share the same regulator

    3) Because of 2) above I would consider a separate regulator for the servos, in fact as the servos might each draw over an amp if they are heavily loaded you might want to consider a dedicated high output regulator for the servos or individual low cost regulators for each servo.

    From memory the high output regulators are expensive and so you might prefer individual regulators, or if you project is just a short term desktop project chance a single regulator and accept that its not a production quality solution, but suitable for your own desktop entertainment if thats the goal.


  29. hi..i tried this but when i put the 4 AA bateries to the breadboard the black wire gnd of the battery got very hot and melted in a few seconds and the breadboard at that spot too..what went wrong??

  30. Thanks so much for this post, it really helped me.

  31. Crowntnm is Manufacturer and Supplier High Voltage Breakdown Tester, DC regulated power supply, Digital Micro Ohm Meter & LED Testing Instruments provider in Delhi-India.

  32. Crowntnm is Manufacturer and Supplier High Voltage Breakdown Tester, DC regulated power supply, Digital Micro Ohm Meter & LED Testing Instruments provider in Delhi-India.

  33. crown electronic systems is Manufacturer and Supplier High Voltage Breakdown Tester, Digital Micro Ohm Meter & LED Testing Instruments provider in Delhi-India, We are best online DC regulated power supply, Multi function Meter, Digital Measuring Instruments. +91-9873662332

  34. wont this method damage arduino?
    i mean extra current from external battery , which will be connected to ground of arduino should damage arduino.
    and if it doesn't get damaged then what it the reason for it!
    please answer!

  35. Is it possible to have each servo move independently?

  36. Wow that's a wonderfull blog having all details & helpful. Power Cord

  37. Wow that's a wonderfull blog having all details & helpful. AC Power Cord

  38. Wow that's a wonderfull blog having all details & helpful. Power Supply Cord

  39. Wow that's a wonderfull blog having all details & helpful.UK power cord

  40. Wow that's a wonderfull blog having all details & helpful.UK power cord

  41. This comment has been removed by the author.

  42. I have 2 servos with their own battery controlled by remoter transmitter.
    Can I power an Arduino-GPS from the same servo battery 7.2V, to avoid carrying a separate battery for the Arduino?

    When the servo is used I guess the voltage will drop - is this a problem for the Arduino, and I how do I test without damaging anything?

    thanks for any help, Mike

  43. Will this also work using a nano controller (instead of UNO)?

  44. This comment has been removed by the author.

  45. Thanks for your great post. I have read your post completely and acquire more knowledge from this article. Thanks for your useful post. Liquid Level Switch

  46. I was have similar problem. Servo do weird movement. Adding an external power supply solved issues.Thanx for tip.


    Get professional trading signals delivered to your cell phone every day.

    Start following our signals NOW and gain up to 270% per day.