Got a 9v power source and need to power a servo

My Arduino circuit will be running off two 9v batteries in parallel or six AA batteries in series, and while either of these might supply enough current to run a servo, I'm pretty sure servos need 6v.

So what should I do here? Do I need to use one of those three pin voltage regulators?

The Arduino will be pulling about 350mA itself, and I suspect its onboard regulator won't be capable of powering a servo as well.

If I do get one of those regulators, I just need to hook a couple pins up to the battery and connect the servo to one pin and ground, right? No resistors or anything?

For powering motors I'd recommend using the AA's over 9 volt batteries any day. What else is hooked up to the arduino? 350mA seems a tad high.

Usually people add capacitors to both sides of the regulator. The only time you need to add a resistor to a voltage regulator is if you want to raise the voltage, like use one that is preset to 5.0 volts up to 6 volts.

Linear regulators burn off the excess voltage into heat, 4 AAs for the servos and a 9volt to run the arduino might make more sense. Or maybe just 4AA's and use a few non-tiny diodes to drop from ~6v to 5v.

I clicked on a servo on adafruit and it says it'll run at 5v or 6 volts.

Use two 4-cell AA battery packs connected in series; that would give you 12 VDC (or if using rechargeables, 9.6 VDC) for powering the Arduino through its voltage regulator. You could then tap off the middle of the pack (if using non-rechargeables, you'll have 6 VDC, otherwise you'll have 4.8 VDC) for the servos. If you know you'll always be using rechargeables, then tap off the first cell in the second pack (or whichever is the 5 cell in the entire pack) in order to again get 6 VDC for the servos (but don't use that tap point with non-rechargeables; doing so with such cells you'll be at 9 VDC, and smoke your servos).

If you have a good hobby shop or a custom battery shop in your neighborhood, you might be able to have them set you up with a special 9.6 VDC NiMH racing pack, with the center tap taken off the 5th cell (for 6 volts to the servos).

Kylek:
I misspoke. I wouldn't be using six AA's, I'd be using six AAA's.

And everything I can find indicates that two 9volts supply the same mAh as six AAA's. There is the question of how much current they can actually supply at once, but information on what one might expect to get out of different types of batteries is hard to come by. The numbers I did find though seemed to indicate that two 9v in parallel should be able to supply a similar amount of current as six AAA's in series.

With that in mind, would you still reccomend six AAA's over two 9v, and if so, why?

What else is hooked up to the arduino? 350mA seems a tad high.

An array of 64 green leds (multiplexed), an illuminated pushbutton switch with one green led, two yellow leds in series, and a piezo speaker.

Usually people add capacitors to both sides of the regulator.

Why? I'm guessing that's to smooth current spikes. But is that necessary if the only thing that would be connected to it is the servo?

4 AAs for the servos and a 9volt to run the arduino might make more sense.

Use two 4-cell AA battery packs connected in series; that would give you 12 VDC (or if using rechargeables, 9.6 VDC) for powering the Arduino through its voltage regulator.

Did I mention that I have limited space in which to cram all these electronics and servos? A box about 4x3x1. Also, I'd rather not do any funny stuff tapping off the middle of a battery pack.

If you have a good hobby shop or a custom battery shop in your neighborhood

Custom battery shop? Such a thing exists?

I found this 6v regulator:

But I've got a problem.

I found this circuit diagram showing how to hook up a voltage regulator:

http://homepages.which.net/~paul.hills/Circuits/PowerSupplies/PowerSupplies.html

And that page states:
"The capacitor between the battery and the regulator is required to ensure there are no high frequency variations in the supply to the regulator. The capacitor after the regulator is required to supply high frequency variations in the current drawn by the logic chips, which the regulator is not fast enough to react to."

Which makes sense, but it doesn't tell me what values I should use for the caps, or why.

The datasheet for the regulator does contain a few circuits:
http://www.st.com/stonline/books/pdf/docs/2574.pdf

And it would seem that most of the circuits there use 0.1uF for C1 and 10uF for C2, but I don't know why, and I don't know if they're electrolytic or ceramic capacitors.

The reason why I'm cncerned about the capacitor values is because I found another 6v regulator on Digikey:

http://www.st.com/stonline/products/literature/ds/2143/l7805.pdf

And that one's datasheet contains a schematic which uses a 0.33uF cap on the input.

I think the purpouse of the larger cap is just to smooth out larger fluctuations in the input voltage, but am I going to have any fluctuations at all pulling voltage from a battery which is also connected to my Arduino, and how do I know how big of a cap I really need?

And again, should I be looking for an electrolytic or ceramic cap here? I'm pretty sure the 0.1uF cap is a ceramic cause I think that's the same size cap often used as a decoupling cap, and I'm fairly sure those are ceramic. So I'm guessing these are both ceramic?

[edit]

And now I find this page which says ceramic capacitors on output are bad:
http://www.national.com/nationaledge/jul02/article2.html

"The biggest reasons many LDO's oscillate are:

...

b) Using a ceramic output capacitor on an LDO not designed for it. The typical 2.2 - 4.7 uF ceramic capacitor will have an ESR of about 5 milli Ohms. This puts the ESR zero somewhere around 6 MHz where it clearly won't help compensate the loop. Using ceramics on the output of LDO's which are not designed to work with them is presently the #1 reason for unstable LDO operation.

Why most LDO's hate ceramic bypass capacitors

The last section explained why most LDO regulators will not operate in a stable mode with a ceramic output capacitor. Their loop requires the ESR of the output capacitor to supply a zero which gives the phase lead necessary to cancel out the effects of one of the low-frequency poles.... and ceramic capacitors have almost no ESR, so they won't provide any phase lead. Most LDO's designed in the late 1980's and early 1990's were made assuming a Tantalum capacitor would be used for the output capacitor, and so they don't tolerate ceramics very well."

Did I mention that I have limited space in which to cram all these electronics and servos? A box about 4x3x1.

Nope :wink:

If you have a good hobby shop or a custom battery shop in your neighborhood, you might be able to have them set you up with a special 9.6 VDC NiMH racing pack, with the center tap taken off the 5th cell (for 6 volts to the servos).

Wouldn't this make charging the battery pack a tad more difficult?

Custom battery shop? Such a thing exists?

Probably want to try a shop that specializes in remote controlled vehicles at a hobbyist level first.

For comparing AAA's vs 9v's I know that most 9 volt batteries have 6 AAAA's inside of them
http://www.supreme-battery.com/index.php?page=nimh-oem-industrial-batteries

These guys list AAAA's as 300mAh
The highest capacity AAA listed there is 800mAh, I'm accepting that as a valid number as I've got some Energizer brand AAA's on my desk, 2 are 850's 2 are 900's and 2 are 1000mAh cells.

I compared using nimh cells as alkaline cells aren't rated consistently. But 2x300 < 800 so the AAA's look better to me.

Oh man, am I dumb.

The 350mA I quoted myself as drawing from the Arduino is for one of my projects which will have a 64x64 led array. But the servo will be in a circuit which is very similar but uses much less power, lighting only three or four led's at a time, and playing sound on a piezo.

I can't say for sure that the Arduino's onboard supply will have enough juice to power a servo in addition to that, but the chances seem much better with like 340mA available.

Guess I gotta check out some servos and figure out how much power they'll draw.

Kylek:

The info I got on battery capacity I got from here:

It lists a typical 9v as having half the capacity of a AAA.

As for what the manufacturer states on the package, I wouldn't put any faith in that... they're using it for marketing after all. Still, it may well be the AAA's have more capacity. And it may be true they can deliver more current. I don't know. I wish there were some other source I could trust to confirm the mAh with that would also specify how much current they can put out.

Also, I'd rather not do any funny stuff tapping off the middle of a battery pack.

I can understand your space issue, but having multiple taps off of a pack is hardly "funny stuff". I've taken enough electronics apart in my lifetime to know that it is done all the time in commercial electronics (maybe not as much nowadays, what with all the power regulation and conversion options available - but it is still a valid method).

Custom battery shop? Such a thing exists?

They may not be common, but yes, they do exist. Here in Arizona we have several Batteries Plus locations:

http://www.batteriesplus.com/

They also have franchises in 42 other states as well in the US.

You can take just about any battery to them and for a fee, they can source the cells and duplicate the pack; they can also custom build packs to your specifications. I have had this done for obsolete laptop batteries (NiCd and NiMh) as well as small LiPoly packs (like you would see in an iPod; in my case, it was for a Cybiko toy). Depending on the battery pack, it can be either cheap to have done, or expensive, but generally it is cheaper and easier than trying to do it yourself (or attempting to buy the pack new, if it can be found). Some packs they won't do, either for safety reasons (tech's and customer's) or because they can't get the cells (for instance, I once asked about getting a large Lithium pack for a laptop rebuilt - they wouldn't do it).

Maybe there's something similar in your geographical area? Otherwise, you would need to look into hobby shops (but there you are likely only to find R/C style packs - obviously too large for your application).

:slight_smile:

(maybe not as much nowadays, what with all the power regulation and conversion options available - but it is still a valid method).

It's not that it's uncommon that concerns me.

My main concerns were that:

  1. I didn't know if there was even any good location on the AAA battery holders I purchased to make a solder connection, and if I did, if it would be reliable. (It appears there is a rivet I could solder to after all, though I still don't know how reliable a connection it would be.)

  2. Going this route would force me to use AAA batteries and I don't know for a fact that in the end I will have enough space in the prop for them, and I won't learn that till after I get the PCB's manufactured.

  3. I don't know how to calculate battery life with such a setup.

  4. I want to learn how to use voltage regulators, because I'm sure this isn't the last time I will encounter this issue, and it will be nice to have a plug and play solution ready to go when the time comes that I need 5v instead of 6v, and I'm only powering things from one 9v.

They may not be common, but yes, they do exist. Here in Arizona we have several Batteries Plus locations:

Oh. Yeah, we've got one of those down the street. :slight_smile: I've only been in there once, I thought their primary business was car batteries.

I'm actually not quite clear on what goes into picking the capacity of a capacitor, the datasheet says use 2.2uF at minimum, and that you'll probably want to use 10uF, I wouldn't go with anything more than 100uF.

You might want to keep an eye on this thread, which is trying to solve a very similar problem:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271281025/15