A brief overview of Layout
Layout is the FUN part of PCB design! And, after circuit DESIGN, it’s 90% of the actual work of making a PCB. I like to call layout “Introduction to Urban Planning for the Distinguished Electrical Engineer,” mostly because that’s EXACTLY what it is.
I actually believe this SO strongly I’m going to link the UN Habitat Urban Planning Guidelines here, and challenge you to find the parallels. Additionally, because it’s a great example of how knowledge in the ARTs can help knowledge in the SCIENCEs and vice-versa.
Your PCB is a City of Tiny Electrons
Think of your PCB as a city. The electrons are the people and they have places to go, things to do. The components are buildings where they go do their business, and the traces are the roads that take them there. Bear with me as I stick with this analogy for a brief amount of time to explain some basic concepts.
- Cities have zones for different types of land use, industrial districts, residential districts, the idea being to keep activities in the areas they need to be in without affecting life in other areas. PCBs are the same, we seperate the board area based on the types of use. Power goes in one spot, digital signals goes in another, and nalog has it’s own space as well so there’s no interference or overlap. (We’ll talk about this more below).
- The best cities have short and direct roads with relevant buildings placed near each other. People are lazy, so are electrons, and most don’t like walking far distances to get where they need to go. People can get distracted and meander off-path, electrons can pick up interference that won’t let them do their job as effectively. Therefor our job as PCB designers will be to place relevant components as close together as possible to minize the lenght of the traces in-between them.
I’ll save you from more analogies for now, but you are likely starting to get the idea. I encourage you all to channel your inner artist while doing layout. A good layout is function, but also BEAUTIFUL. It puts the “Art” in the Art + Science of PCB design.
Location of Components
The FIRST STEP once you start your layout is placing and orienting all your components.
We’ll start at a high level and work our way down.
Seperation of Power and Signal
Let’s talk power breifly. There’s many types of power converstion but primarily we have LDOs, and switching converters. Switching converters are more popular because they’re more efficient.
Here’s a guide on the differences between them.
Here’s a good guide from TI on how switching regulators work.
The main point here, if you look at switching converters, is producing power is NOISY. You have this transistor banging a voltage back and forth, and if we take a fourier transform of this signal, we’ll notice frequencies being emitted equal to the switching frequency and many other higher frequencies super-imposed on each other. The NOISE in general is something we don’t want to interfere with the other electronics on the board right?
- If we have a digital circuit, noise being thrown off the power converter can affect our digital circuit causing errors in communication and voltage values if the digital circuit is too close to the power electronics.
- Digital being close to the power electronics is STILL BETTER than analog being close to the power electronics. Noise in the power rail near an analog circuit is usually devastating to the analog signals which are very susceptible to any kind of environmental noise and electromagnetic interference (EMI).
An AMAZING BOOK on EMI is Henry Ott’s Electromagnetic Comaptability Engineering. Well worth a read.
These images above are of a BMS and of an MPPT, see how the power stuff is on one side of the board, and the digital control circuitry is on the other half. NOTE that even if the digital control circuitry is controlling the power electronics, we still produce a level of seperation.
And yes, this is all so operation of a circuit in ONE part of the board does not affect whatever a different circuit is doing in another part of the board.
Kind like how you don’t want a landfill next to your house, that would be pretty upsetting. The same way a bangin’ transistor next to your bangin’ stereo amplifier will produce some bangin’ noise.
Orientation + Placement of Components
So that’s how we seperate parts of the circuit, how do we place components with respect to each other? And we start with the concepts of inductance loops.
Inductance Loops
Inductance loops start with Faraday’s law of Induction. So here’s a video on that.
Based on the law of induction, we know that magnetic field travelling through a loop of wire causes a voltage. Now we use this to our advantage in motors, but we don’t want this on our PCBs, unless we’re designing a wireless charger PCB.
Magnetic fields resulting from EMI can come from many places in the world. Here are some examples
- Animal from the Muppets playing the drums in bohemian rhapsody
- A nearby power converter
- You’re beloved Xfinity Home Internet
Basically, we want to minimize the existance of these inductance loops on a PCB, which means minimizing the distance a trace travels, and how “circular” that trace is.
This is actually an AMAZING TUTORIAL on Inductance loops form Hackaday.
So now, how do we place and orient components?
I usually begin with the schematic. Let’s take a look at this buck converter.
Take a look at the components connected to the central chip of the above buck converter. I’m going to start by taking all the components that surround the chip in the schematic and putting them in a little group. Then I’ll orient the components to minize the trace length between them.
Let’s look at a different example of a PCB that reads the voltage form a torque sensor and publishes it on a CAN-Bus network.
A simple intro to what CAN Bus is.
Here’s the board in question with some of it’s good features labeled. I want to zoom in on the power area and the signal area to look at how we oriented components and drew traces.
Notice here how we oriented the resistors in this network to connect them with traces that were as short as possible, and the side of resistors that went to ground faces away and uses a VIA to go to ground. We placed the signal path we care about, the signals going through the resistor amplification network, as close as possible so we could draw the traces.
You’ll notice there are some capacitors on the bottom of the board, this is in general a bad idea, and we’ll get to why later.
You can kinda see the same thing in the power converter, all the components are very close together and they are oriented so the trace lenght can be minimized. We tried to minimize loops in the circuit as well, in a few places we could have done a better job.
Our layouts aren’t perfect, we’re still learning too!
Bypass (concept + location)
So you’ll also notice on some of our designs we have these weird capacitors. Many of them, connected to chips. What are these? These are called Bypass, or Decoupling capacitors. Remember how we said that switching converters flick on and off really fast to convert voltages? And there can be some noise in the output? Chips don’t like this, especially audio chips and microcontrollers so these capacitors filter it out.
You can watch the lecture video for an intuitive explination of bypass capacitors using very hungry sharks, but we’ll explore some technical resources here:
Bypass + Decoupling Capacitors
Basics of Decoupling Capacitor Sizing
TI Guide to High Speed Communication Bypass
Some general rules:
- Large capacitors deal with lower frequencies, smaller capacitors deal with higher frequencies.
- Electrolytic capacitors have large parasitic inductances and resistances which only allow them to work at low frequencies.
- We usually use multiple capacitors in parallel to sink a large range of frequencies so only the DC component of voltage comes through.
Location of Bypass Capacitor + Traces to Bypass Capacitors
Here’s a great tutorial on where to place bypass caps. And I’ve listed some general rules below.
- In general, you want bypass as close to the chip as possible.
- Multiple bypass capacitors are usually placed next to each other.
- Many chips have multiple power pins, we want bypass caps for each of the pins and we want the positive side of the capacitor as close to EACH of the VDD pins as possible.
- Some designs place bypass caps on the BOTTOM of the board UNDER the chip. This is not a great practice as it introduces inductance loops that go through the board. There is some debate on this though.
Another GREAT PDF from Analog Devices, this one is on Bypass + Decoupling.
Connections
Trace Sizing, Trace Spacing
There’s three main things to consider when laying down traces, weight, size, and spacing. The first two are coupled, the third is independent.
These are super important to make sure your PCB works! The width and weight of a trace determine its current capacity. The spacing determines its ability to stand-off voltages without arcing between traces.
Considering Current
Trace Weight
Trace “weight” is a funny term we use for trace “thickness.” That’s the thickness of the copper layer on the PCB, how deep does the copper go? The “height” if you will when we start to calculate a trace’s cross-sectional area.
“Oz” refers to 1.35 mil thickness of copper and it comes from the thickness of a layer required to lay down X ounces of copper on a 1sq-ft plate. This unit is likely used because it’s helpful in calculating manufacturing cost.
More info on the oz ratings of copper
Good blog post on copper weight
Trace Width
This is a great tutorial on PCB trace width calculation from Milennium Circuits Limited (MCL).
Another good table for trace widths.
Here’s a GOOD CALCULATOR from digikey on trace widths for both INTERNAL and EXTERNAL layers.
Trace Location
Note that trace width and weight are fundementally changing the resistance of a trace, which changes the power dissipated as heat. The better the trace can dissipate heat into the environment, the smaller it can be for a given current. So the layer of the board matters as well. We put high-current traces on the outer layers of PCBs to enable them to dissipate heat better.
In super high current applications we’ll use copper POURS instead of traces.
Considering Voltage
PCB trace SPACING is based on VOLTAGE differences between two adjacent traces. You can read all about it here. That’s a really good tutorial on trace spacing.
Sometimes for really high voltage applications, they’ll put SLOTS in the PCB.
A List of Many Many Layout Considerations
Our goal with this page is to give you things to google. Layout is a massive topic that takes practice to get good at. The only way to get good is by looking at examples of what IS good, and trying it yourself.
The following is a list of a whole bunch of other considerations during layout and design we’ve linked hear for your interest.
Examples of Good Layouts that are Open Source
ODrive Motor Controller V3.1 - Altium
Ben Katz SPINE Communications Board
Signal Integrity + Protection
Impedance Matching
PCB Trace Impedance Matching - TI
TI - Even More Impedance Matching
Differential Pairs
Debounce
Switching Bouncing + How to Prevent it
ESD
The ‘Complete Guide’ to ESD Protection
System-Level ESD Protection - TI
EMI
TI - PCB Guidelines for Reduced EMI