Anyone here know how to use a voltage regulator?

I've been trying to pin down how to hook this thing up to my circuit for a week and I'm no closer to an answer.

I need to power a servo which I can't power firectly off the Arduino because I don't have enough mA left in my design, and don't want to power directly off the Arduino because I'm concerned about noise in the circuit.

To mitigate these issues I've decided to use a 6v regulator connected directly to my 9v power source. (Batteries)

Problem is, I know I need to connect some capacitors to the thing to stabilize it and reduce noise, but every source I turn to I find incomplete information and conflicting answers.

One source that appeared reputable suggested that ceramic capacitors were a no-no. Yet that same source was a few years old and also suggested that regulatores are being made for ceramics. Also, the tanatlum capacitors that they suggested have a tendancy to explode and catch fire, and were reccomended against by a different source.

Another source of conflict is that most photos I find of circuits using these regulators seem to use electrolytic capacitors for at least one of the caps, presumably the larger of the two. Yet most schematics I find have no polarity indicators on the caps, nor do they specify if elecrolyic or ceramic caps should be used.

Lastly, the size of the caps and their location seems to vary wildly. I see 1uf, 0.1uF, 0.01uF for the smaller one, and 470uF, 220uF, 10uF, .33uF for the larger one. And the side on which the larger one is isn't consistent either, sometimes it's on the input, sometimes it's on the output. And sometimes there's both large and small capacitors on both sides. I've even seen one large capacitor on the input and four small ones on the output.

To make matters even more complicated, it seems like half the regulators out there have their pins setup in INPUT GROUND OUTPUT order, while the other half have INPUT OUTPUT GROUND, which means I gotta pick one out now before I have the boards made.

Anyway, at this point I'm left simply making a guess as to what caps I should go with that are most likely to work. And going by these two datasheets, for a 5v and a 6v regulator:

http://focus.ti.com/lit/ds/symlink/tl750l05.pdf
http://www.st.com/stonline/books/pdf/docs/2574.pdf

...I want a .1uF ceramic cap on the input and a 10uF electolytic cap on the output.

Of course I can't count on getting clear information even from the single source of one specific company, can I? Here's another 6v regulator by the same company as the 6v where they specify a .33uF on the input and a .1uF on the output, which you'll note is the opposite arrangement of the above with a different large cap size:

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

So what's the deal here? Is there one specific cap size I need for each regulator? Does it not matter if the big cap is on the input or the output, or is that specific to each regulator as well? Or is the type of load/source on each size of the regulator what matters for where the big and small caps need to be? Ie, should I have a small cap on the battery size to cut noise from the servo from getting to the Arduino which is also connected to the battery, and a large cap on the servo side to provide juice when it's needs spike suddenly? Or should I have the small cap on the servo side to prevent noise from it impacting the regulator, and the large cap on the battery side to provide the regulator with more juice when it needs it? I would be inclined to say the large cap should be on the servo side because the regulator is less likely to be able to respond quickly to demands for current than the battery. But then, maybe the large cap is needed on the battery side for when there are large spikes so the Arduino doesn't brown out.

[smiley=cheesy.gif]

Note that many (most?) servos do NOT require regulated power at all.

He says he has a 9V power source (he doesn't say what configuration, though) - and if he is using hobby servos (most likely), they need (at max) a 6V power source.

If his 9V power source consists of individual cells (AA or AAA), rather than a single 9V rectangular battery, what he should do is tap off the battery at the appropriate point in the pack, and run the servos off of that; I am assuming he is using a 9V pack to run the Arduino via the external input (and consequently the on-board regulator).

:slight_smile:

which means I gotta pick one out now before I have the boards made.

Yes - that's how electronic design works, pick the component you are going to use and design the passives round that component. You have to look at the data sheet of the specific regulator you are using to see what values of capacitor they recommend. More than this value is not a problem less than this can be. One make of regulator will be quite happy with one set of capacitors and another make will oscillate. I once had 2000 set top boxes scraped because someone in purchasing changed the regulator and it oscillated with the capacitor values that were on the board.

One source that appeared reputable suggested that ceramic capacitors were a no-no.

Total rubbish.

Yet most schematics I find have no polarity indicators on the caps,

No well what are you going to do connect the -ve end of a capacitor to the +ve output and the +ve end to ground? If you have to be told these things you are not grown up enough to be using them.

the tanatlum capacitors that they suggested have a tendancy to explode and catch fire,

That is overstating it. If they fail they can fail short circuit. This can cause overheating fire and explosions only if the power source is capable of putting out that much current. So a fully charged rechargeable battery of a decent power output could, but an unregulated mains supply could probably not. That is why some circuits have thermal fuses in them.

And sometimes there's both large and small capacitors on both sides.

That is sometimes the best arrangement but it is not always the cheapest. The more capacitance the more noise it will swallow, just looking randomly at designs is not enough information, you need to know what the nature of the load was and what amount of noise was tolerable. As these change so do the values and numbers of capacitors.
Too much is never a problem too little often is.

simply making a guess as to what caps I should go with

It's never a guess, it's design. :wink:

One source that appeared reputable suggested that ceramic capacitors were a no-no.

Total rubbish.

My I temper that a bit? I attended a seminar about Using Voltage Regulators a couple of weeks ago, and the speaker said on the slide titled "Output Capacitor ESR":

Output Capacitor ESR

  • A bit of an Esoteric Subject but it is important for LDO Regulators

  • Equivalent Series Resistance
    Capacitors have a small Internal Resistance
    They also have a small Internal Inductance

  • Lower Diagram shows the Range
    of tolerable ESR vs Load Current
    for LP2980 LDO: COUT = 10uF
    ... schematic showing equivalent circuit, and a graph explaining the issue...

  • Capacitor Choice- Generally any Tantalum is OK

  • Low Value Al. Elecs. ESR may be too high

  • Beware of Multi-Layer Hi-Capacity Ceramics -
    they can have very low ESR values

He suggested that a reputable manufacturers data sheet should be clear enough to understand what is needed for specific circumstances.

HTH
GB

[edit]I should add, that I believe the speaker at the conference was trying to clarify issues, and not create Fear, Uncertainty and Doubt. For example, he wasn't trying to get anyone to pay him to design their voltage regulator circuit. So I believe him.[/edit]

No well what are you going to do connect the -ve end of a capacitor to the +ve output and the +ve end to ground? If you have to be told these things you are not grown up enough to be using them.

Well obviously I'd connect the - end to ground, but if there were polarity indicators on the schematic then I'd know it wasn't a ceramic cap.

Also, if it's uneccessary to have polarity indicators on capacitors because it's obvious which way they should go, why do they have them for diodes and leds? :slight_smile:

gbulmer:

Hm. Based on that, and going by the first two of datasheets I'd be okay with an electolytic for the larger cap and a ceramic for the smaller one. But that third schematic has the smaller cap on the output, so I might want to use two electrolytics if I go with that.

Grumpymike:

Yes - that's how electronic design works, pick the component you are going to use and design the passives round that component.

Unfortunately, I can't count on the specific parts I need being in stock all the time. Nor am I experienced enough to be sure I've desgined the circuit properly before I have the boards made. As a result, I'm trying to design the circuits to give me the widest range of options. I'll pick a voltage regulator I think will work for my needs, but if it doesn't, I don't want to have chosen one with a nonstandard pinout or which needs a specific value of capacitor not used by any others.

In fact, the voltage regulator itself is an optional component. I don't know that I will be making use of a servo in these props. But I'll be getting like 16 boards made, and it's better to have the option built in in case I decide to add that down the road than to have to spend another $200 getting another 16 boards made.

just looking randomly at designs is not enough information, you need to know what the nature of the load was and what amount of noise was tolerable. As these change so do the values and numbers of capacitors.

And same thing here. I don't know anything about noise except that motors generate it, and it can make my circuit behave in unexpected ways. I have no idea how much noise an Arduino can tolerate, how much noise a servo might make, or if the noise will even affect the Arduino since it's only connected to the servo's control pin directly, and is powered from the battery though it's own voltage regulator which may have capacitors on it to reduce noise.

Ideally I'd research those things and do the math to figure out where I stand, but I don't even know where to begin and I've been working on this the last three months and I simply don't have any more time left to design and debug. I've got people waiting on these props and the first batch won't have any servos, so if I make a mistake designing this part of the circuit it's not the end of the world. But I'd like it to work. So I'm trying to make a best guess.

AFAIK, the issue about ceramic capacitors only matters if it is a Low Drop Out device, and a decent manufacturer should alert engineers to this in the datasheet.

In fact, the voltage regulator itself is an optional component. I don't know that I will be making use of a servo in these props. But I'll be getting like 16 boards made, and it's better to have the option built in in case I decide to add that down the road than to have to spend another $200 getting another 16 boards made.

You might also design in a few extra component holes on the PCB, like a small piece of stripboard or prototype area, connected to the regulator and capacitors. Even include more than one regulator pin-out. Then you have more flexibility to adjust things after the PCBs are made.

HTH
GB

You might also design in a few extra component holes on the PCB, like a small piece of stripboard or prototype area, connected to the regulator and capacitors. Even include more than one regulator pin-out. Then you have more flexibility to adjust things after the PCBs are made.

Hm... I like the stripboard idea.

AFAIK, the issue about ceramic capacitors only matters if it is a Low Drop Out device, and a decent manufacturer should alert engineers to this in the datasheet.

I have a small prop, and I've got a 9v source, and I'm drawing I don't know how much current with the Arduino. Maybe 100mA? Lighting a few leds and playing sound on a piezo. But the servo... I don't know how much power that might draw. 50mA? 250mA? I think it's on the higher end. Anyway, I don't have a lot of room for batteries, and if I need to generate 5-6v then I kinda need an LDO regulator, I think. If I use a regulator with a 2v dropout, then my already pathetic battery life of maybe an hour or two (if my calculations based on a chart i found of alkaline battery voltage drop when drawing high current are correct) would be much worse, because that 9v source ain't gonna stay over 7v for too long I think.

But I'll look into some non-LDO regulators and see what their dropout votlages are. The 2v I quoted was what I saw on a few of them.

Personally, I wouldn't spend $200 on PCBs, until I had at least one solution I'm okay with.

The components are only a few GBP/$'s, so it seems reasonable to make something that works now. Or miss it off, and be clear that would be a small separate PCB. Only you can judge.

As Grumpy_Mike said, tantalum capacitors are usually okay.

If you are okay with through hole components, and there is enough board space available, there is the option of laying out the PCB for a couple of different regulator outlines, and holes for several capacitors, with several pin pitches, on both (electrical) sides of it.

But, as I said, I'd get a solution that works before making a PCB.

I'm sorry I can't be more helpful.
GB

Well I think the chances of it working are pretty good, I mean it is just a servo connectoed to a pin on the Arduino and a voltage regulator. And I'll have noise reduction caps. And the Arduino probably has noise reduction caps on its regulator.

I'm just being extra cautious. I want this to work on the first try. I'd rather not have to cut traces and put jumper wires on all my nice boards to fix some issue.

Well I think the chances of it working are pretty good, I mean it is just a servo connectoed to a pin on the Arduino and a voltage regulator. And I'll have noise reduction caps. And the Arduino probably has noise reduction caps on its regulator.

Maybe read this thread Powering Continuous Rotation Servos.

Quote:
One source that appeared reputable suggested that ceramic capacitors were a no-no.

Total rubbish.

Actually no, not necessarily, I've seen some specs for voltage regulators that give a graph showing both the minimum and maximum ESR for the capacitors against frequency... Good high-value ceramics might be too low a series impedance and cause parasitic oscillations.

In practice something like 1uF on the input and 20uF on the output is likely to be OK for most things - I've never seen a voltage regulator oscillate myself, they basically tend to just work.

gbulmer:
Yeah, I read that thread.

Many years ago a friend of mine copied a power supply I'd designed that delivered 5V and 12V using a 7805 and 7812 regulator. His version didn't work because he left off the capacitors causing the 12V regulator to oscillate, and not deliver any output.

Actually no, not necessarily,

Yes actually. >:(

Just because you have seen a regulator that one day might not work with a certain value of a certain type of ceramic capacitor does not in any way justify the statement:-

that ceramic capacitors were a no-no for use with regulators

That statement is wrong in almost every way it can be.

Yes I know about ESR and LDRs and that with LDRs you can sometimes have too much capacitance. But I have designed circuits that have been made in their 10 millions that use ceramic capacitors on regulators. That's lots of regulators and lots of capacitors in each of the 10 million circuits made. If they are a no-no then they have changed the laws of physics without telling me.

Well, if the light didn't come on in the below discussion, it ain't going to come on now. I've got two seperate one amp 7805 chips powering some test servos and there is no rocket science involved. Use caps of similar rating as the ones shown on the data sheets if you don't know what to do. Per the more detailed data sheets, the caps prevent regulator oscillation when they are some distance from the power source, and really have nothing to do with "noise". In the below discussion I provided a drawing of how I get the regulator to output 5.7v, which provides a significant servo performance improvement.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271281025

Anyway, at this point I'm left simply making a guess as to what caps I should go with that are most likely to work. And going by these two datasheets, for a 5v and a 6v regulator

Ok, so what regulator do you actually intend to use?

The capacitor requirements for a voltage regulator circuit depend on the EXACT voltage regulator you are using. Different regulators have different requirements.

The two datasheets you reference are for "low dropout regulators" that do indeed have relatively "picky" requirements for the ESR of the output capacitors. But you said you have a 9V battery and want 6V out, so there is no reason for you to be using such finicky and probably expensive regulators. A normal 7805 should work find, and is NOT so picky about its capacitors. (There is a 7806, but it's pretty rare. You can "bump" the voltage of a 7805 by putting some additional bits in the ground leg. Or use an LM317 variable regulator.)

Ok, so what regulator do you actually intend to use?

I haven't decided yet. 5v regulators seem more widely available, so it might be better to go with those, but the servo might be happier with 6v.

The two datasheets you reference are for "low dropout regulators" that do indeed have relatively "picky" requirements for the ESR of the output capacitors. But you said you have a 9V battery and want 6V out, so there is no reason for you to be using such finicky and probably expensive regulators.

What about battery life? If the 7806 providing 6v has a 2v dropout voltage, then doesn't that mean it will stop working as soon as the battery gets to 8v? And won't the battery reach 8v much sooner than it will reach say, the 6.6v required for the LDO regulator to keep going? Won't I be cutting my run time in half by using a non LDO regulator?

I found these 7806's on Mouser:
http://www.mouser.com/Power/Power-Management-ICs/Linear-Regulators-Standard/_/N-6g7m7Zscv7?P=1z0wa5cZ1z0z73r&Keyword=7806+to-220&FS=True

They have a 2v dropout max. There's lots of these two in stock and they use the same size caps:
http://www.fairchildsemi.com/ds/KA%2FKA7806E.pdf
http://www.st.com/stonline/products/literature/ds/2143.pdf

They don't state whether they should be ceramic or electrolytic. So I guess I should assume it doen't matter?

I think I'll stick with the LDO regulator. I've been doing some research and I'm fairly convinced using a linear regulator would be detrimental to my battery life.

As for whether I'll use the 5v or 6v one, I guess I'll go with the 6v, but I don't really need to decide right now since the two I was looking at require the same capacitors.

I think I'll stick with the LDO regulator. I've been doing some research and I'm fairly convinced using a linear regulator would be detrimental to my battery life.

LDO regulators are still "linear", and waste just as much power as a non-LDO regulator for the voltage conversion phase (9V in, 6V@1A out means the regulator MUST waste 3W while providing 6W; 67% efficient.) A modern LDO may have a lower "quiescent current", which is how much it wastes when the output is 0 A, but that's not likely to be relevant for a motor power supply.)