Go Down

Topic: Best way to power a servo? (Read 347 times) previous topic - next topic

red_elephant

Hello, I'm new to Arduino and would welcome some advice. I've searched the tutorials and the forum, but I have specific question that I can't find the answer to.

I'm using a Uno to control an S3003 servo.  I have a switching mode power supply that I wish to use. The output voltage is variable in steps, including 5V and 7V.  I'd like to avoid having two separate power supplies.

From what I have read, I think there are two alternatives:

1) Set the power supply to 7V, connect it to the Uno power input jack, power the servo from the 5V pinout (I'm aware of the current limit).

2) Set the power supply to 5V, connect it to both the Uno 5V socket and directly to the servo.

Regarding (1), many people advise against connecting a servo directly to the Uno, although the tutorials suggest this is OK.

As for (2), some people advise against using 5V socket in this way, due to lack of protection.  Writing that, it occurs to me that the 5V for the Uno could be connected to the USB port. Is this a good idea?

So I'm confused!  Any information to help me decide which way to go will be gratefully received.



jremington

#1
Feb 04, 2019, 06:49 pm Last Edit: Feb 04, 2019, 06:54 pm by jremington
Quote
I'd like to avoid having two separate power supplies.
That is not easy to do with motors and servos, because they inject severe electrical disturbances into the power leads, and can actually reset or damage the Arduino.

You either have to implement "power supply decoupling" (which won't work if your motor power supply is inadequate) or use two separate power supplies. The latter is much easier for a beginner. 4xAA batteries will work for 1-2 small servos.

Don't forget to connect the grounds.

red_elephant

Thanks for your comments,jremington.  I do understand that two separate power supplies would be the ideal solution from the technical point of view.  But is it strictly necessary in every case? Almost the first thing I read about the subject was in the aruino.cc reference section - I quote:

"Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the Arduino board. The signal pin is typically yellow, orange or white and should be connected to a digital pin on the Arduino board. Note that servos draw considerable power, so if you need to drive more than one or two, you'll probably need to power them from a separate supply..."

To me that is saying that the Arduino board is robust enough to cope with the noise that a servo generates.  I'd be interested to know your reasons for taking the opposite view.

jremington

#3
Feb 05, 2019, 05:11 pm Last Edit: Feb 05, 2019, 05:12 pm by jremington
Quote
But is it strictly necessary in every case?
No, if you properly design and construct the power supply decoupling circuit, as mentioned in reply #1.

slipstick

The 5V pin on most Arduinos cannot provide enough current for anything but the smallest servos/motors...and an S3003 is definitely NOT a small servo.

But a well-regulated 5V supply connected to the 5V pin and to the servo usually works for me without too much decoupling.

Steve

wildbill

It's a bit disengenous for the reference to tell you that you can drive servos in that way without rather more caveats. Sure, you can drive a small servo, preferably without any load on it, but the stall current on most hobby servos is going to exceed the 200mA current limit for the board. Rule of thumb says budget 1A/servo, more if they're beefy ones.

red_elephant

But a well-regulated 5V supply connected to the 5V pin and to the servo usually works for me without too much decoupling.

Steve
Thanks Steve, it sounds as if you have done what I was considering with my option(2), which is encouraging!  Could you expand on "without too much decoupling" - that sounds as if you used some - a pair of capacitors or something more?

Also, would it be better to feed the 5V to the USB socket rather than the 5V pin?  Maybe there is some built in decoupling there?

Sorry, that's another 3 questions. There's a lot to learn!

Many thanks,

Roger

slipstick

Connect to 5V pin not USB though there's little practical difference. The UNO already has a fair amount of decoupling and I have used servos with no additional decoupling without problems. It's more for DC motors that I use capacitors across the terminals to get rid of brush noise.

That does depend on having a well-regulated power supply with plenty of current capability. For testing I often use a 5V 10A supply and for batteries I use either NiMH or Lipos.

Steve

red_elephant

Thanks to everyone who responded to my query.  I've connected things up as Steve suggested, and it's working fine, so special thanks to him.

ayacucho

Hi, Arduino is designed for programming, generates and control analog or digital signals, dont be stubborn.

not_a_noob

Hi, Arduino is designed for programming, generates and control analog or digital signals, dont be stubborn.
What?


Go Up