Lecture 03 - Layout!

as a concept really,

Lecture 02 Lecture 04

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.

In general you want to place your components on the board before routing any traces, traces are hard to move so you want all components in their FINAL positions before you draw any traces.

We’ll start at a high level and work our way down.

Seperation of Power and Signal

Seperation of power and signal is one of the most important concepts in PCB design, it has implications for signal integrity, and is one of the most significant ways engineers try to reduce overall system noise.

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.

Based on this, we get the idea of "Seperation of Power and Signal" where we designate areas of the board where "power systems" will live, areas of the board where "digital" electronics will live, and areas where "analog systems" will live. We keep these away from each other where the analog is usually the farthest from the power.

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.

We minimize the loops by placing and orienting components intelligently on a PCB.

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.

I do this for all the parts of the schematic and then I start moving the groups to places on the board that seem resonable while accounting for seperation of power, signal, and analog.

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

Sizing Bypass Caps

TI Guide to High Speed Communication Bypass

Micron 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.

Note that all trace sizing for current is based on an accepted temperature rise. Depending on the resistance of the trace and the trace's ability to dissipate heat, current running through the trace will produce a certain rise in the temperature of that trace. It's up to us to determine what is GOOD or BAD for a given board. Sometimes temperature rises so much that it explodes :) !

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.

Note above with the torque sense CAN board, you can see some of the traces near the power converter are much thicker than others. This is to help deal with the higher current areas of the board.

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.

We LEARN BY DOING!!!!

Examples of Good Layouts that are Open Source

ODrive Motor Controller V3.1 - Altium

Ben Katz Motor Controller

Ben Katz SPINE Communications Board

Signal Integrity + Protection

Impedance Matching

Impedance Matching - EE Power

More Impedance Matching

PCB Trace Impedance Matching - TI

TI - Even More Impedance Matching

Differential Pairs

Differential Pairs

Diff Pairs on LinkedIn

Debounce

Switching Bouncing + How to Prevent it

Debounce Circuits

ESD

ESD Protection - STM

The ‘Complete Guide’ to ESD Protection

System-Level ESD Protection - TI

EMI

TI - PCB Guidelines for Reduced EMI

MCL - EMI and PCBs

Debugging + Manufacturing Resources

MCL - Test Points

MCL - what affects PCB cost?

Mechanical + Thermals

Thermal Design for PCBs

Thermal Via Management in Altium

TI - A Guide to Board Layout for the Best Thermals