Voltage regulator not working as expected

I picked up some 5V 1A voltage regulators at a shop in town. It's a 3-pin TO-220 package. Seems fairly standard. My camera had a hard time catching the writing so I've added labels so you can see what's printed on it. (Click for larger version)

I found a datasheet here:
http://www.national.com/ds/LM/LM2940.pdf

The pinout is on page 2. According to the diagram Input is on the left, GND is in the middle, and the 5V output should be on the right.

When I hook this thing up to a 9V battery, (+ to input, - to GND), and pass the output to a resistor and an LED I'm only getting about 3.8V from the output. If I hook up another 9V in parallel (to add more current), it suddenly jumps to around 7V (which I would expect if it were in series, but it's not).

The wiring diagrams in the datasheet include capacitors, but I assume that these are for smoothing out ripple, and would have no effect on this massive increase in voltage I'm seeing.

Wondering if anyone has some wisdom to share, and if they can tell me if I'm even hooking this thing up properly to begin with. Thanks!

EDIT: Now that I look at it again, it seems that the markings on the package don't match up with the datasheet. Datasheet says left pin is input, but it's labelled -5.0 (which would lead me to believe it's ground).

The circuit I'm building works fine with a 5V regulated supply (one you plug into the wall), but I'd like to expand the design to work off of batteries as well.

I use these all the time, quite handy, especially with batteries since it can take a hit with the polarity hooked up backwards

I can confirm for you that

Left is Vin
Middle is GND
Right is output

ive never tried without cap's but yes they are for smoothing, but I dont know what effect outside of that they have

my little breadboard bug that i made is rock solid @ 4.99 volts

Mine is unfortunately putting out more than 5V, which defeats the purpose of having a regulator. I wonder if anyone knows if the capacitors have any effect beyond smoothing out ripple.

EDIT: Further reading of the spec sheet yields...

"The output capacitor is critical to maintaining regulator stability,
and must meet the required conditions for both ESR
(Equivalent Series Resistance) and minimum amount of capacitance."

I'm going to try throwing in some caps to see what I get. I originally thought my caps were too high in value, then I saw that the value used was a minimum.

4.95V :smiley: :smiley: :smiley:

My caps are only rated to 6.3V though. The battery is a little over 9V. I wonder if this will pose a problem.

StkMtd:

Can you let us know what is printed on the third line? According to the datasheet in your link these devices come in six flavors, LM2940CT-5.0 ... LM2940CT-15.0. The number after the hyphen is the regulated output voltage and the input voltage must be somewhat higher.

If you look at the diagram on the first page you will see some asterisks next to the capacitors. The output capacitor is required to 'maintain stability' which probably means to keep it from oscillating, which in turn could cause the strange output readings you are getting.

Don

OK - I see the third line info now! You probably still need the capacitor.

Don

4.95V Cheesy Cheesy Cheesy

My caps are only rated to 6.3V though. The battery is a little over 9V. I wonder if this will pose a problem.

depends on which side of the regulator its on, on the high side yes it will cause a problem, if not eventual minor explosion, it probably will heat up and poof out

if its on the out side, then your sorta pushing it from a rule of thumb point of view

I would go bigger, on my breadboard bug (its the latest thing ive used one of these on) ive got 5 * 0.001uf ceramic's in parallel, and on the output i have a 22uf 50V

yea thats way overkill, but I work with audio amplifiers a lot during the day, and so have a ton of that type of parts, to put it in perspective were running 35volts into 50 volt caps. My rule of thumb is at least 2x the voltage

I went digging through my dad's old junk box and found a 16V, 150uF electrolytic cap. How's that for redundancy? ;D

Thanks for the insight, guys.

The actual values of the caps matter, too. For best/reliable performance, use the cap values the datasheet recommends.

Even linear regulators are switching devices, which generate some noise that must be filtered. The cap values are related to the frequency of the noise to be filtered.

-j

The actual values of the caps matter, too. For best/reliable performance, use the cap values the datasheet recommends.

Even if the specified values are minimums, and the datasheet says higher values will result in improved transient response?

Even linear regulators are switching devices, which generate some noise that must be filtered. The cap values are related to the frequency of the noise to be filtered.

After looking at an equivalent circuit diagram, I see where this thing could produce some bothersome noise. I suppose you have to add them because it would be a pain to include them in the chip (if not impossible due to size limitations). Good to know.

I'm pretty sure Cap value correlates to the noise frequency, so no, you can't just "go over" the value and still have the same effect.

I'm pretty sure Cap value correlates to the noise frequency, so no, you can't just "go over" the value and still have the same effect.

If I recall, though, smaller caps are for high frequency, and larger caps for lower. I'd assume this thing isn't switching fast enough to warrant a small cap value.

While I would be interested in understanding the specifics in more detail (it's next up on my list of things to learn), I'm just glad the component spitting out a steady 4.95V for the time being.

From the datasheet (pg. 13):

MINIMUM CAPACITANCE:
The minimum output capacitance required to maintain stability
is 22 [ch956]F (this value may be increased without limit). Larger
values of output capacitance will give improved transient response.

ESR LIMITS:
The ESR of the output capacitor will cause loop instability if it
is too high or too low. The acceptable range of ESR plotted
versus load current is shown in the graph below. It is essential
that the output capacitor meet these requirements, or
oscillations can result.

My output cap isn't significantly off from the recommended value, so I'm not too worried.

The key phrase is:-

or oscillations can result.

So check on a scope that the output is free of oscillations before you use it.

Even if the specified values are minimums, and the datasheet says higher values will result in improved transient response?

I hadn't read the datasheet. My point was to read the datasheet and do what it says (which you are obviously doing. :slight_smile: )

In general (for other regulators), you need a cap for a filter as specified by the datasheet. If you want better transient response, you may need to add another cap (as opposed to simply replacing an existing cap with a larger one).

There's a common myth (even among some EE students!) that if the regulator is attached to a battery it doesn't need the filter caps. This is totally wrong, as you've learned by experience.

As far as your cap voltages go, the 6.3V should work fine on the output side of the regulator. The voltage rating of the caps on the input side need to be suitable for your unregulated input voltage (but you seem to be on the right track for that, too).

-j

check on a scope that the output is free of oscillations before you use it.

I'll remember this for the day that I finally get myself a scope. Sort of thing everyone should have but only few can afford.

There's a common myth (even among some EE students!) that if the regulator is attached to a battery it doesn't need the filter caps. This is totally wrong, as you've learned by experience.

Academics! They'll believe anything if they never get their hands on it. Not that I'm bashing them (I was once one too), but I've been finding experience is the way to go if your intent is to build things and not merely design them. And from working on the test team for a large mobile phone company, I have seen first hand how the theoretical types don't necessarily get it right the first time... or the second... or the third for that matter.

Although to be fair, saying caps are unneeded is far from theoretical, it sounds downright silly now that I understand a little better what's going on. If anything, I would imagine caps are MORE critical with a battery, as batteries are pretty much the root of all evil.

Here's some pictures of the final product. (thumbnail, click to enlarge)

The project on the powered board is just a demultiplexer (changes which LED is on) with the select bits coming from a dipswitch. I think of it as a sort of binary counting tutorial for children :P. Was a good experiment to help me understand voltage regulation, pull-up/down resistors, and getting components working without the safety net of a well-designed Arduino. However, this will only strengthen my ability to utilize the Arduino. Good times.