# Solved: PCB layout question



## Who's Me (Aug 29, 2006)

I want to build a circuit board that includes a 5v regulator. The schematic on top shows the regulator circuit as I would normally build it. That layout shows a very clear sequence of events, power in, input filtering, regulation, output filtering, clean 5v out. I would consider anything AFTER clean 5v out to be my power and ground rails which feed the circuit.

Trying to layout this board with other components the bottom schematic would be a lot easier.
I basically folded the Schematic in half

1: I'm thinking ground is ground so it shouldn't matter where the filter caps are tied to ground (not necessarily in ladder config.) and it shouldn't matter where I connect my circuit to ground. Is this correct?

2: For the 5v out if I connect directly to the output pin of 7805 (red A) do I get filtered 5v because the filter caps are on the line, or do I have to connect AFTER the caps(red B)?

I hope I'm making sense.


----------



## leroys1000 (Aug 16, 2007)

Connect the positive after the capacitors to compensate
for load variations.
The ground in that circuit is common all the way across,
so the ground is the same at all points.
You can ground the caps where you want.
Remeber that the caps with the curvered plates are eletrolytic and are polorized.
They have to be connected properly,plus to positive and minus to ground.
The other caps are nonpolorized.


----------



## Who's Me (Aug 29, 2006)

So my circuit is good as long as I connect positive to B instead of A.
Thank you for the quick reply.


----------



## leroys1000 (Aug 16, 2007)

Yes,connect to B for properly filered output.
The electrolytic caps filter the output.
The nonpolorized caps stabilize the regulator so it doesn't oscillate.


----------



## ChuckE (Aug 30, 2004)

Who's Me said:


> So my circuit is good as long as I connect positive to B instead of A.
> Thank you for the quick reply.


A and B are the same point. The top circuit and the bottom are electrically the same, also. When circuits are laid out on a board very little worry is made about the physical position for DC circuits. And if it is for RF then as long as you are not in the realm of GHz, I don't think there's too much to worry about there either.

(Assuming that electrons travel at the speed of light, and in one foot of wiring electrons will take about 1 nanosecond (1 billionth of a second). I would imagine that since you are worrying about layout simplicity, that your board will have much less than 1 foot of distance on any one trace.)

Schematics are drawn the way they are (left to right) so as to help in understanding what the circuit is. It does not have to physically match the drawing.


----------



## JohnWill (Oct 19, 2002)

I'd be more worried about the size of the traces and the amount of current you're going to draw. The ground circuit should be the heaviest circuit here, and keep the traces as short as possible, even for DC regulator circuits.


----------



## Koot (Nov 25, 2007)

*Here - this should help*.


----------



## Who's Me (Aug 29, 2006)

Uploaded a new pic.
The way I read Leroys Answer is at the top and the way I read ChuckE is on the bottom.
Which is correct?

The reason I'm asking is because as John said I want to keep the power trace short, if I connect to the Regulator(ChuckE) My power trace will only be ~.5in. Connecting to the last cap(Leroy) makes my power trace ~2.5in. and has to loop around and travel down next to the caps back past the regulator and then to the final circuit.

John My traces are .040 and I'm Only drawing a couple of milliamps running a Picaxe08-m with the occasional .5 second, 20 milliamp pulse to drive a mini 5v reed relay. I was planning on filling most of the free space on the board with a ground plane, mainly to save on etchant but also gives a huge ground trace. the best I can tell my trace size and the regulator should be way overkill for what I expect it to do.


----------



## Koot (Nov 25, 2007)

What is your input source? Voltage? AC or DC?


----------



## leroys1000 (Aug 16, 2007)

You can connect at the shorter point if needed.
ChuckE is correct.
In that circuit A and B are the same point.
I am used to dealing with power circuits that have more
components and like to keep the current running in the same direction.
Being as current load is dependent on the hieght and width of the
trace,I would guess that any trace you etch that doesn't end up
hair thin will be enough for the load you are putting on it.
It looks like the input would be AC due to the rectifier on the input.
Half wave rectifier with positve output.


----------



## Who's Me (Aug 29, 2006)

Thank you for clarifying that.
I am figuring 12v DC in. 
The diode is there to prevent damage from hooking the power leads up incorrectly and Knocks the voltage down a hair.
I considered using a couple more diodes in series to bring the input voltage down a little. 12v in, 5v out means I'm dissapating 7 volts as heat even though I'm drawing so little current it shouldn't matter. I would like to use a smaller TO-92 regulator the only thing I'm worried about is that excess voltage.


----------



## leroys1000 (Aug 16, 2007)

You might consider putting a small potentiometer (variable resistor)
inline on the input to vary the input voltage and make it adjustable.


----------



## Koot (Nov 25, 2007)

Who's Me said:


> Thank you for clarifying that.
> I am figuring 12v DC in.
> The diode is there to prevent damage from hooking the power leads up incorrectly and Knocks the voltage down a hair.
> I considered using a couple more diodes in series to bring the input voltage down a little. 12v in, 5v out means I'm dissapating 7 volts as heat even though I'm drawing so little current it shouldn't matter. I would like to use a smaller TO-92 regulator the only thing I'm worried about is that excess voltage.


I think you're way over-thinking this simple little rugged circuit. There's probably no less than a zillion 7805 circuits doing duty right now with no problem. Your current load can easily be handled by one strand of a tiny 24 gauge wire, thus the PCB copper, component leads, etc. will all very easily carry much more current than you'll ever need. Your heat dissipation is based on the amount of voltage drop and the load current, which will be minimal for the rugged cased 7805 in free air. Also, since the voltage regulator will be DC (in) to DC (out) you don't have to deal with any problems of smoothing out AC ripple with a half wave or full wave bridge. You didn't say what kind of device your load is. Unless it is a highly sensitive device that may be interfered with by noise the caps you'll be using will take care of transients and noise, and create a nice smooth DC output for you.


----------



## Koot (Nov 25, 2007)

I see that your load is only a couple of milliamps. The smaller TO-92 case regulator can handle 100mA. Thus, with 12 volts input the regulator will handle .7 watts of dissipated heat [100mA * (12V-5V) is .7W]. Your dissipated heat will only be .014 watts [2mA * (12V-5V) is .014W], which is nothing.


----------



## JohnWill (Oct 19, 2002)

Since the current draw is minimal, the extra diodes are pointless, you aren't dissipating that much power anyway.  I agree with the TO-92 package here, it's plenty for this application.


----------



## Koot (Nov 25, 2007)

Since he only has six tiny components he could easily build the circuit "dead bug" style with no PCB to save space and weight. It would probably be about the size of your thumbnail.


















Examples of "dead bug" (or "ugly") circuit construction.


----------



## Who's Me (Aug 29, 2006)

Thank you for the figures, I get lost in the math. I will use a TO-92 if I can Get my hands on one before I built the Circuit otherwise I'll Stay with the Big A** TO-220 which I have a Few of on hand.

So at what wattage would I start worrying about heat dissipation with/without heatsink, TO-92 vs TO-220?

I see that the extra Diodes would be pointless now, but is the first diode even necessary as the datasheet says the regulator is virtually indestructible? (is it already protected from reverse power hookup?)

Dead bug Won't work for me here as the final circuit so far has 4 caps, 8 resistors, 1 regulator, 8 pin IC, 2 diodes, 1 relay, 1 transistor, 4 pos. DIP switch, an LED, and a push button.

Koot, Over-thinking a simple little circuit? This thing was done about 20 components ago I just couldn't leave those extra In/Out pins sitting there doing nothing! I'm glad I ran out of pins or I would have been Trying to figure out how to make it start my car and play Jingle Bells while Doing it


----------



## Koot (Nov 25, 2007)

Use a small silicon diode (1N914, 1N4001, etc.) on the input. The circuit built using a TO-92 case will have an output current capability of 100 mA, which is much greater than your needs. The larger TO-220 case will have an output current capability ten times greater (1 Amp), which is way overkill for your needs. The circuit contains current-limiting circuitry and thermal overload protection so you won't have to worry about the IC being damaged in case of excessive load current (heat) - it will reduce its output voltage instead. If size and weight is a concern you may want to use much smaller tantalum capacitors instead of the typical electrolytic capacitors. 

That thing should be able to mow your grass and change the oil & filter on your car when you get done. :up:


----------



## JohnWill (Oct 19, 2002)

You certainly won't need a HS on the TO-220 package for this application!


----------



## Who's Me (Aug 29, 2006)

Ok I'll Keep the 1n4001 on the input and I understand that either regulator will easily handle this circuit, I was thinking for future reference that it would be nice to know at what wattage would I start worrying about heat dissipation with/without heatsink, TO-92 vs TO-220. 
I had a 7805 on a Picaxe trying to run a stepper motor a few months ago and started generating noticable heat on the regulator I installed a heatsink on that but did not know how to figure power dissipation. so I have no idea if it was neccesary. now I can figure wattage but not sure at what point it matters. 
Or am I not understanding you and 1oomA(TO92) and 1A(TO220) is the allowable amperage withOUT a HS?


----------



## Koot (Nov 25, 2007)

Who's Me said:


> Ok I'll Keep the 1n4001 on the input and I understand that either regulator will easily handle this circuit, I was thinking for future reference that it would be nice to know at what wattage would I start worrying about heat dissipation with/without heatsink, TO-92 vs TO-220.
> I had a 7805 on a Picaxe trying to run a stepper motor a few months ago and started generating noticable heat on the regulator I installed a heatsink on that but did not know how to figure power dissipation. so I have no idea if it was neccesary. now I can figure wattage but not sure at what point it matters.
> Or am I not understanding you and 1oomA(TO92) and 1A(TO220) is the allowable amperage withOUT a HS?


That's correct - the TO-92 case design is rated at 100mA (1/10 ampere) and the TO-220 case is rated at 1,000mA (1 ampere) without a heat sink for the TO-220. The smaller TO-92 case does not have provisions to mount a heat sink. As for the amount of wattage (heat) the two case designs will disipate - your wattage equals the voltage difference (between input voltage and output voltage) times your load current, as I exampled previously.


----------



## JohnWill (Oct 19, 2002)

The maximum with a HS is dependent on the ambient temperature and the airflow over the regulator. The spec sheet for the regulator will give you dissipation curves to plan your installation.


----------



## Who's Me (Aug 29, 2006)

I knew I wasn't crazy I thought I had seen TO-92 heat sinks before, Googled it and I didn't make them up
I think I messed up the wording of my last question...
We know max Amps w/out HS (1A) and we know max Voltage (35V). The max Wattage the case can safely dissipate w/out HS is what I was asking about.
I used your example:
" "I see that your load is only a couple of milliamps. The smaller TO-92 case regulator can handle 100mA. Thus, with 12 volts input the regulator will handle .7 watts of dissipated heat [100mA * (12V-5V) is .7W]. Your dissipated heat will only be .014 watts [2mA * (12V-5V) is .014W], which is nothing.""

And was Happy until I applied it to a TO-220 and found that,
If .1*(12-5)=.7 Watts (TO-92) then,
1A*(12-5)=7 Watts (TO-220)
If you used the minimum Voltage drop (2V) then
1A*(7-5)=2 Watts
and if you were to go to the maximum Vin (35V) then
1A*(35-5)=30 Watts 
7 Watts sounded a little high and 30 Watts really seemed like a lot of heat to me so I looked at more 7805 datasheets and the one from KEC shows maximum power dissipation as 2 Watts without heatsink. which would mean 1A output BUT ONLY at Minimum voltage drop (7-5V). [ 1A*(7-5)=2 Watts]
That would mean that with 12 Vin,
2Watts/(12-5)=.2857A or (285mA max output)
and going to max Vin (35V)
2Watts/(35-5)=.0666A or 67mA max output so..

To-220 1Amp Regulator:
7 Vin = 1A allowable current w/out HS
8 Vin = 666 mA " "
9 Vin = 500 mA " "
12 Vin = 285 mA " "
18 Vin = 153 mA " "
24 Vin = 105 mA " "
Or did I just go on some incomprehensible rant?


----------



## Koot (Nov 25, 2007)

You said that your load was only a couple of milliamps (.002 amperes). Therefore you should not have any problem using either case package style. Unfortunately, the various manufacturers often use varying data input, ambient conditions, heat sinks, airflow, graph data, tables, etc. in their specifications making it difficult to compare "like" components with one another. If you really dig I believe you'll find a vast difference between different manufacturers of these types of ICs, even to the extent that some manufacturers might not even provide current-limiting circuitry and thermal overload protection in their devices - however most I believe do. Therefore, instead of trying to confirm your data and your math, which some of the latter appears at first glance to be incorrect, I suggest you consider the following points:

* Your load at 2 milliamps is obviously well below the device rating (for TO-92 or TO-220).
* Unless you hook-up an actual lab test circuit under the exact operating conditions the circuit will be used in and run tests for all parameters you'll never know the real current draw, output voltage, temperature rise, device failure point, etc., etc., etc.
* With the 2 milliamp load you say you'll have it is clear to me that the smaller TO-92 case style is like having a fire hose hooked to a fire hydrant to water pansies. In other words, you have plenty of over-engineering designed into the circuit. And if you use the TO-220 case style it would give you an even greater over-engineering design.

*Here* is an article you should read, which has a test table toward the bottom of the article you'll find interesting. These test were performed by a model train hobbyist on a 7805 voltage regulator circuit using different input voltages, load currents, heat sink sizes and airflow from fans, using dead bug construction versus PCB construction, etc. He took the devices all the way to shutdown failure. He also took readings of the heat sink temperature with each test parameter. This should give you very good data to overcome your concern about what this IC can handle in terms of current and temperature.

As you will see in the test table:
* The 7805 with dead bug construction with small heat sink at 12V input was stable with a load of .34 amperes at 4.95V output with a HS temperature of 142F (61C) 
* The 7805 with dead bug construction with small heat sink at 12V input was stable with a load of .68 amperes at 4.88V output with a HS temperature of 215F (102C) 
* The 7805 with dead bug construction with large heat sink at 12V input was stable with a load of 1.02 amperes at 4.89V output with a HS temperature of 150F (66C) 
* The 7805 with dead bug construction with large heat sink at 12V input was stable with a load of 1.36 amperes at 4.91V output with a HS temperature of 179F (82C) 
* The 7805 with PCB construction with heat sink at 12V input was stable with a load of .34 amperes at 4.92V output with a HS temperature of 116F (47C) 
* The 7805 with PCB construction with heat sink at 12V input was stable with a load of .68 amperes at 4.96V output with a HS temperature of 168F (76C) 
* The 7805 with PCB construction with heat sink at 12V input was stable with a load of 1.03 amperes at 4.98V output with a HS temperature of 201F (94C) 
* The 7805 with PCB construction with heat sink and fan airflow at 12V input was stable with a load of 1.03 amperes at 4.98V output with a HS temperature of 106F (41C) 
* The 7805 with PCB construction with heat sink and fan airflow at 12V input was stable with a load of 1.37 amperes at 4.94V output with a HS temperature of 114F (46C) 
Note: The 7805 has a maximum operating temperature of 125C (257F).

(Keep in mind that you only have a tiny fraction of the current load (2 milliamps or .002 amperes) compared to the loads that were tested above.)

Here are some observations he notes, which I agree with:
* If you are drawing less that 1/3 amp not much of a heat sink is needed, if any, regardless of the input voltage. It is unlikely that you would ever go above this with simple electronic circuits.
* Large heat sinks are much better than small ones. 
* Fans, even small ones, make a dramatic difference in the efficiency of the heat sink.
* Good quality voltage regulators shut down when their internal temperature becomes excessive and automatically start up when the temperature drops.
* The regulators tested were able to supply significantly more than their rated amperage so long as they were kept cool.

For what it's worth I have personally used the 7805 voltage regulator in dozens of different projects and never had a failure. It is a proven workhorse.

PS - Yes, you can get a clip-on heat sink for the smaller TO-92 voltage regulator. And there are a number of clip-on and bolt-on heat sinks for the larger TO-220 voltage regulator. I can't fault you for using a heat sink, but you definitely do not need one. Heat sinks are rated by their thermal resistance given in Degree C/W. For example, a rating of 2*C/W means the heat sink (and therefore the voltage regulator attached to it) will be 2*C hotter than the surrounding air for every 1 watt of heat it is dissipating. (Heat sinks for the 7805 typically range from 10*C/W to 2*C/W, with the lower temperature rating being able to dissipate more heat.) As we've discussed your 2mA load with 7V difference between Input and Output (12V-5V = 7V) only equals .014 watt, which is about as much heat as a house fly generates while it sleeps. As you can see, your tiny little load will only produce .014 watt of heat, which probably can't even be felt by placing your fingertip on the device with no heat sink. For comparison, the 7805 voltage regulator has a maximum (stable) operating temperature of 125C (257F), which of course will burn your finger like a hot stove element and boil water.


----------



## Who's Me (Aug 29, 2006)

I think I may not have been clear, but anyway. You guys solved my actual problem somewhere back on the first page and answered my question about how much power I was using. Then I got sidetracked researching the heat dissipation of voltage regulators (Then got sidetracked reading about houseflies  ). I have now gotten back to what I was trying to do in the first place and ran into another problem. So this thread is solved, I'll start a new one for that. Thank you guys for your help.


----------



## ChuckE (Aug 30, 2004)

Kind of like a person who asks "what time is it?" and then you are instructed about how to build a clock?


----------

