How to Lay Out a PCB

Discussion in 'General Electronics Chat' started by Wendy, May 13, 2016.

  1. Wendy

    Thread Starter Moderator

    Mar 24, 2008
    20,765
    2,535
    This thread is an experiment, and is going to be both an open discussion forum and an article forum. When I have something worth posting on its own I will start a new thread in the Electronics Resources forum. I will add contributions to the article as a editor / writer and give attributions to work that actually makes it into the article. Questions are also welcomed, if you are struggling with doing this.

    Note that this is a spin off of this thread in the Feedback and Suggestions Forum.

    http://forum.allaboutcircuits.com/threads/no-forum-for-pcb-design.112873/page-2
     
  2. Wendy

    Thread Starter Moderator

    Mar 24, 2008
    20,765
    2,535
    How to Lay Out a PCB

    By Wendy Marsden,
    Lestraveled

    In the Completed Projects forum there are several articles showing how to translate a PCB layout into a physical DIY printed circuit board using alternate techniques.

    But how do you lay out a board design starting with a working schematic? That will be the point of this article, with help and input from anyone who has expertise on the subject.

    When Wendy was a young teen in the early 1970s she did it with a paper and a pencil. It is tedious, but it can be done. After a draft was made that was believed to work a sharpie pen (felt pen) on bare PCB stock was used to make a board. Crude, but it worked.

    This was before computers and dedicated software was available for the purpose. Nowadays if you want a board made you need to generate a Gerber file. This is the standard used by printed circuit board housed to manufacturer a finished PCB. This file includes definitions for where holes are located, what their sizes are, whether they are vias (plated through from one side to another), and where the copper traces are.

    For DIY designs the copper layout tends to be the only important thing. The thickness of the copper is a function of the board stock, but everything else is defined in the Gerber file.

    There are a lot of software packages that are to lay out PCB that are free to download and use. These include

    Eagle
    PCB Express
    DIPTrace

    And more. PCB Express is very intuitive and easy to use, but unfortunately it does not generate Gerber files, using an in house standard so people will use their PCB manufacturing service.

    Eagle has a light version of its software for hobbyists, heavily crippled. The professional version is definitely not free.

    Before getting into the nuts and bolts of PCB layout, we will do an overview. What is a PCB? Sure, it makes the connections between components but, its purpose is a lot more than just that. It is a substrate that holds and supports the components. You tailor the trace width to handle the expected current. For high frequency, you create transmission lines so that there are no perturbations in the impedance. Sometimes the current is so high that heavy gauge wire has to soldered on top of the trace. Sometimes off board connections are containerized and the PCB now becomes a easily replaceable module. Long long gone are the days of point to point hand wiring. Even tube circuits are built on PCBs. There have been chassis that are all circuit board, and not a single discrete wire in them. Most of today's ICs are surface mount, absolutely requiring a PCB. So, when laying out a PCB the actual point to point connections can be simple or they can be very very complex. You have to know when a trace can be snaked through a jungle of other traces and when you have to have a straight bowling ally sized trace going from point A to point B. You have to be aware of what signals have to kept away from other signals, else they will interfere with each other. Is it wise to have a trace carrying 120Vac right next to a high impedance op-amp circuit? It will create problems.

    So, when you look at a schematic do you see just connections, or do you see frequencies, currents, impedances, digital, analog, etc.? Hold on to your hats, because this should be fun. They don't call it artwork for nothing.
     
    Dr.killjoy and shortbus like this.
  3. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    Before getting into the nuts and bolts of PCB layout, I would like to do an overview. What is a PCB? Sure, it makes the connections between components but, its purpose is a lot more than just that. It is a substrate that holds and supports the components. You tailor the trace width to handle the expected current. For high frequency, you create transmission lines so that there are no perturbations in the impedance. Sometimes the current is so high that heavy gauge wire has to soldered on top of the trace. Sometimes off board connections are containerized and the PCB now becomes a easily replaceable module. Long long gone are the days of point to point hand wiring. Even tube circuits are built on PCBs. I have seen chassis that are all circuit board, and not a single discrete wire in them. Most of today's ICs are surface mount, absolutely requiring a PCB. So, when laying out a PCB the actual point to point connections can be simple or they can be very very complex. You have to know when a trace can be snaked through a jungle of other traces and when you have to have a straight bowling ally sized trace going from point A to point B. You have to be aware of what signals have to kept away from other signals, else they will interfere with each other. Is it wise to have a trace carrying 120Vac right next to a high impedance op-amp circuit? I think not.

    So, when you look at a schematic do you see just connections, or do you see frequencies, currents, impedances, digital, analog, etc.? Hold on to your hats, because this should be fun. They don't call it artwork for nothing.
     
    shortbus likes this.
  4. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    Schematic Capture to Net List to PCB program
    A schematic capture program is not just a CADD program with electronic component symbols. A PCB program is not just fancy Paint program. The schematic capture program and the PCB program talk to one another to help you do a good layout. In schematic capture, when you place a connection between IC1-pin3 and R7-pin1, that information is communicated to the PCB program in the form of a "Net List". A Net List is normally a text file that lists what pins of what components are connected together. What does the PCB program do with this information? In the PCB program you will place component patterns and name them to correspond to the schematic components, such as IC1 and R7. In the PCB program you can find out what pins are connected to each other by simply selecting a Net tool and click on a pin. The pins on all the components that should be connected will be highlighted. Here is an example in ExpressPCB:

    [​IMG]

    The blue shows pins that should be connected. (Obviously this board has been routed.) You could have just the PCB patterns without any traces and this tool will show you what needs to be connected.

    I highly recommend ExpressPCB as a starter program. It is free, easy to learn and use, has good tutorials and it will show you the basic tools of PCB layout.
     
  5. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,004
    1,523
    Thank you both and anyone else that contributes to this in advance! I'll be watching reading and learning. When I have one of my 'dumb' questions I'll chime in, but otherwise just reading.
     
  6. hrs

    Member

    Jun 13, 2014
    82
    7
    Is there a reason to not make traces wider than they need be? I often see very narrow traces in the order of maybe 0.5 mm even if there is plenty of space to make wider traces, not unlike some of the traces per layout from post #4. For reference I've attached what I've been doing so far, I've only made around 5 boards. The red rectangle is a PID8 package so you can see the scale.

    So, are there negative effects of making traces wider than needed at audio frequencies? What about higher frequencies?
     
    • pcb.png
      pcb.png
      File size:
      19.2 KB
      Views:
      14
  7. johnmariow

    New Member

    May 4, 2016
    20
    1
    I understand that this is just an introduction. I look forward to learning about the proper layout of a PCB.

    I only know what I've learned from other engineers where I use to work. One engineer explaiined to me how an improper layout of a high frequency circuit can introduce tiny unwanted inductances in series with a component.
     
  8. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    There is little reason not to make traces wider than what they "need" to be, especially if you are etching the board yourself. The wider the trace the less chance of under-cutting. Perhaps a better way to look at it, what is the minimum spacing between traces you can reliability etch.

    - A wider trace will have lower resistance
    - A wider trace will have more capacitance to the trace below it or to a ground plane.
    - A wider trace will have a better resistance to inductance ratio.

    Unless you are concerned about transmission line impedances, a wider trace is a good thing.

    It still comes down to you knowing the characteristics of the circuit you are laying out.
     
    hrs likes this.
  9. Roderick Young

    Member

    Feb 22, 2015
    408
    168
    I use DesignSpark, which is free. It generates a Gerber package which I sent to a manufacturer as-is, and the boards came back fine.

    One thing I noticed is that I almost always have to make my own pad patterns for parts, or alter something that was in the standard library. I would emphasize to someone starting out that it's important to check and check again. Print out the layout at 100% size, and make sure it fits your actual component. Also, it will sometimes be necessary to oversize a pad pattern to extend outside the part,. For some components like surface mount trim potentiometers, the manufacturer-recommended land pattern will be completely covered by the part, under the assumption that infrared reflow will be used. That makes the part very hard to hand solder with an iron.
     
  10. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    ATTENTION - People wanting to learn PCB layout skills

    Your first homework assignment is to find a schematic/PCB program that you like. (Oooo, tough assignment.)

    There are many free PCB programs out there. They all have their good points and their not so good points. I suggest that you simply google,"free PCB software". This will get you a big list of currently available free PCB software. Check them out. They are free, so download a few and try them out. Pick one or two of them and figure out how to do the following:

    Schematic
    - Place a component symbol and name it. Example: place a capacitor symbol and name it C1.
    - Make connections between pins
    - If the software has "design rule check" functions, get familiar with them. Miss-connect a wire to a pin and see what it tells you.
    - Find out if the net list is automatically sent to the PCB program or do you have to do something to make that happen.

    PCB
    - Place a component and name it. Example: place a capacitor pattern and name it C1.
    - Understand how to connect pins with traces, how to change the width, how to change the layer.
    - How to use the Net List information. Is it automatic, do you have to import it, how do you activate it?

    Some of the PCB programs, like ExpressPCB and Copper Connection, will take you a just few hours to learn how do the above list of functions. Other PCB programs, like KiCad and Eagle, will take you longer. They are more complicated but they can do a lot of things.

    This is your assignment. Find a PCB program you like and learn how to work it. You can't learn or improve PCB layout skills without the tools.
     
    Last edited: May 14, 2016
    Roderick Young likes this.
  11. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Here's a mistake that I have made that has cost me dearly in lost time. It's a long story, but one worth reading.

    In DipTrace, a new component consists of a schematic symbol and a pattern (same as a footprint) which must be mated so that the netlist will be correctly transferred from the schematic drawing to the PCB layout. I created a pattern that had two pins switched and mated it to a correct schematic symbol. Then, when I had the PCBs made, they were wrong because the pattern was wrong. But that happens.

    I corrected the pattern, and mated the corrected pattern to the schematic symbol. So far, so good. Then, I replaced the component in the schematic of the circuit from which I had the bad PCBs made, and had more PCBs made. Again, so far, so good. The new PCBs were fine.

    Now comes the really costly mistake. I went to design a new circuit, but instead of starting with a blank page, I remembered that I had previously designed a circuit that included a section that would be duplicated in the new circuit. So, I opened it, copied the section I wanted, and pasted it in my new drawing. I finished the design, laid out the PCB, and ordered boards. When they arrived, they didn't work. After a lot of head scratching, I realized that the fault was the same as I had experienced once before, and I thought I must have failed to correct the pattern; but I checked, and the pattern was correct. I was baffled.

    The cause of my second problem was that instead of going back to the component library, I had copied/pasted a section from a schematic that included the uncorrected version of the component. So, I propagated my original mistake.

    The lesson (for me) is not that using copy/paste from one schematic drawing to another is wrong, but rather that correcting a pattern in the component library does not automatically update it in all the places it was used. After correcting a bad pattern, every schematic in which that pattern was used should be individually updated.
     
    Roderick Young and shortbus like this.
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,516
    1,246
    Layout software companies make some incredibly powerful tools, and they love to talk about them. But while auto-routing, auto-differential-stripline-propogation-delay-matching, and other goodies are very handy to a small number of users, nothing - nothing - is more important to the success of a layout project than library management. Over 50 years I've done hand-drawn on copper, direct tape, red/blue tape, and multiple generations of multiple software products. When looking at a new product or new rev, the first think I go for is the library manager. Since everyone has decent layout features and can import a schematic without errors, it quickly comes down to one or two especially important features, the overall competence of the user interface, and the library. A well-managed component/decal library is the gift that keeps on giving.

    ak
     
    atferrari likes this.
  13. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,004
    1,523
    Many of the latest versions of schematic CAD can now use libraries from different brands of software. Diptrace and designspark can use Eagle libraries, for example.
     
  14. Roderick Young

    Member

    Feb 22, 2015
    408
    168
    There is quite an art to doing a circuit that is sensitive to layout. I think those cases are best left out of a primer, and covered in dedicated chapters, as most hobby circuits are actually not sensitive to layout.

    The placement of parts deserves some attention, though. Every modern package offers auto-placement, which may be good enough if the design doesn't care at all where anything is. In addition to that, here are some tips:

    1) If some components MUST be in a certain part of the board, lock those down first. A connector may need to be near the edge of the board, or a potentiometer in an exact location. A transistor may need to be in a certain spot to attach to a heat sink, or a tall component may need to be in an area that has overhead clearance.

    2) Other than that, I'd recommend putting the component with the most connections in the middle. That might be the processor, if there is one.

    3) If the board does not have power planes, but must carry a lot of current, you may wish to have a general plan of where the power busses will be, and add components around those.

    4) Space permitting, try not to put things under a heat sink that overhangs the board. That makes those components hard to probe and test.

    5) Use test points if you expect to be doing a lot of experimentation and tweaking on the board. They can be formal components, or just extra holes to which wires can be soldered. Put the test points on the top side of the board. In fact, for a prototype, try to minimize putting components on the back side. That just makes bringup harder. Finally, don't forget to put test points on the power busses, especially ground, which could be used by your scope probe(s) during bringup.
     
  15. Dr.killjoy

    Well-Known Member

    Apr 28, 2013
    1,190
    156

    10-4
    Boss
    How would you like to see the result ??
    Oh I picked Diptrace as it's the only program I can understand ..
     
  16. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    A couple words of warning:

    1) There are LOTS of "free" software packages that are anything but. Some will let you download and install them "for free", but you have to buy a license to actually use it. Others are merely free trials that expire after a fairly short time period (one week to one month is the norm) and once they expire you can't fully remove them from your hard drive (they leave difficult to remove telltales to prevent you from simply downloading another free trial).

    2) There are LOTS of malicious software out there that masquerades as freeware specifically to get you to install it. Some of it even works for the intended purpose, but installs spyware or turns your machine into a spambot.

    Before you download and install anything, read up about it specifically determining what "free" means. Don't even bother installing a free trial of any software that you wouldn't seriously consider buying if you like it.

    Once you identify a package that you are interested in trying out, check out the company's bonafides as best you can. Look for third-party reviews that are sufficiently numerous as to make the product being disguised malware highly unlikely.

    Then, once you have decided to download something, try to do so from the vendor's page and, if possible, see if there is an MD-5 (or other) hash signature that you can verify you download against before you install it.
     
  17. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    How to get ready to lay out a PCB.

    If your schematic is not right, then your PCB will not be right. You probably have a design in front of you and you are aching to turn it into a PCB, but now is the time to slow down.

    Schematic
    - Have you run a design rules check?
    - Do all of the components have a unique reference designator?
    - Are part numbers required?
    - Are the PCB patterns specified for each component? Some PCB programs require this information before you can place the schematic symbol, other programs require it later.
    - When you think it is ready, STOP, take a break, come back later with fresh eyes. When you are heavy into the design you can become blind to things you would normally instantly pick up.
    - If your PCB program does not automatically place the patterns for you, print out a Bill of Materials list. You will use this to place component patterns.

    PCB
    - Input the size and shape of the board, and how many layers.
    - Place component patterns for every part and name them per the Bill of Materials list you printed out. Don't place the patterns in the board, place them around the outside of the board. Some PCB programs will do this for you.
    - Identify "hard points". These are things that can't be moved. Things like mounting holes, controls and indicators that have to line up with holes in the chassis, connectors that must mate with another assembly, etc. Place these parts first.

    The above is basically what you need to have in place in order begin laying out your board. If you have ignored naming the reference designators, the Net List feature will not help you. If you don't use the design rules check feature, your schematic can have duplicated names and wires not connected and you won't know it. If you follow the above steps your computer will now help you rout your board. It can tell you the points that have to be connected together. It can warn you that something got connected that shouldn't be connected. It can tell you if traces are too close together. So, learn and USE the features in your software that will make you a better PCB designer.
     
  18. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    I laid out a PCB for USB audio mixer.
    After I built I turned it on and got 1VAC on the output with no input signal.
    It turned out the power supply smoothing capacitor charging pulses were modulating the ground line injecting noise into the audio signal.
    I re-laid out the pcb keeping the power supply separate and used star grounding and the hum was negligible.
    PCB layout is a bit of a black art.
     
  19. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,991
    3,737
    How do call it a "black art" when you gave a clear example that the golden rules of PCB layout and circuit design actually work as described?

    Here is the starting point for all engineering - understand the science, use the science and get satisfying results.
     
  20. andrewmm

    Member

    Feb 25, 2011
    29
    6
    Why not make fat traces and thin traces.

    Old answer is, that the tape used to make the traces was only available in a few sizes.

    But that was a long time ago.

    But keep traces a small size.
    capacitance and inductance of the track is always something to consider.

    Use the same size tracks, and fill the spaces with plane.
    saves copper etching.
     
Loading...