Printed circuit board (PCB) manufacturing is a black art among the DIY community. If you’re putting together a prototype circuit, the process is very well established: get an Arduino or your microcontroller of choice, pick out some components, get a breadboard and wires, and then string everything together. Easy, low cost, and accessible.
However, what if your project becomes more complex? You can extend breadboard or perf-board work to a point, but the likelihood of making an error grows exponentially with project complexity. Nobody wants to end up with a circuit that looks like this:
Image credit: Big Mess o’ Wires
(note: this picture is included for visual impact, but the project, a CPU designed from scratch, is actually an amazing accomplishment. Check it out if you get a chance)
If your project is becoming more serious, you’ll need to design a PCB. EngBlaze has collected some tips to help you do this effectively, and we want to share them in the hopes of avoiding a small fire or two along the way.
Note: many of these tips were originally derived from Sparkfun’s excellent tutorial series on laying out PCB’s in Eagle and embedded electronics basics. For more background, be sure to check them out.
Without further ado, here are some guidelines to follow when laying out and assembling a custom PCB:
Double check RX and TX pinout
In standard electronics nomenclature, serial TX stands for “transmit” and RX stands for “receive”. Unfortunately, part manufacturers aren’t always so kind. On some devices, TX is an input and RX is an output, defying all logic (or using some twisted reasoning where you need to tie both “RX”s and “TX”s together). Even if they do use the normal notation, it’s easy to get things crossed up, so make sure you double check your prototype connections before you implement them in your PCB schematic.
Use Sparkfun “locking” header footprints for anything with more than 2 pins
The geniuses at Sparkfun have designed a special footprint for through-hole headers that lock your components in place via a friction fit while you solder them. Sure you can use blue-tack or tape or any number of hackjobs to hold your piece to the board during assembly, but why go through extra trouble? Use their footprints in Eagle or implement them in your own PCB design package; you won’t regret it.
Make sure all connections are complete and correct
We can’t speak for every EDA (Electronic Design Automation) package out there, but at least in Eagle, it’s way too easy to draw a connection that looks like it’s hooked up to the right component or pin, but is actually just floating. It’s heartbreaking to get a PCB order and gleefully open it up, only to see that the fab house has left a tiny break between a trace and a pad. “What is this crap?!?” you say. In a rage, you rush off and check your gerber files, determined to prove that your design was perfect and demand your money back. Huh. Turns out the fab house was doing exactly what you specified, because your trace was sneakily disconnected from pin 6 after you had moved things around. Moral of the story? Double check all your connections.
Check the overall footprint of your board
Notice a theme with the checking yet? Welcome to the wonderful life of an engineer. As a real engineer, you’re responsible for real things, often expensive ones. As un-glamorous as it is, double checking just about everything ensures that you only have to make that expense once, not twice.
In this case, it’s important to check the footprint of your board to make sure that your components are placed and sized correctly, and won’t get in the way of each other. The best way to do this is to print out your silkscreen layer 1:1 on paper. If you have chips or components that you’ll be using on the board, place them on the paper to see if their footprints are correct.
Use the largest traces possible
Well, not literally. But you should use large traces, because they’ll prevent problems. Sparkfun recommends you try for 10mil traces and 10mil spacing between them, and only reduce that if you need to. With some fine pitch SMD’s you’ll need to go to 8mil spacing, which is fine. Even though a lot of board fabrication services will accept designs with 5mil traces, results won’t always be as consistent as with a safer design.
With power and ground connections, or anything carrying high current, you should aim for even higher trace widths. There are online calculators available to figure out proper trace width given copper weight and expected maximum current.
Account for standoffs and mounting
Mounting your PCB in your project should be a primary concern, because you’re usually aiming for the smallest footprint possible and dealing with very tight tolerances. When designing your enclosure, make sure you’ve accounted for standoff height and the dimensions of your largest components. “Will my lid fit over that 1000uF capacitor?” is a question that many PCB beginners wished they had asked. Also, make sure that any connections leading to the outside world (power, USB, ethernet, etc.) have a clear pathway to where they’ll be externally connected. In the case of any on-board connectors, you’ll have to make sure that your alignment between the board and your enclosure is spot on.
When laying out the board itself, remember that your standoffs will be much wider than the standoff-screw holes, and can interfere with other components if you’re not careful. One way to avoid problems is to account for the standoff width with a custom footprint, such as the 4-40 standoffs in the Sparkfun Eagle library. Doing your own version in Eagle or any other EDA software should take only a few minutes, and is well worth it.
Connect all ground planes
Double check that all ground planes and traces are connected to each other, and connected to any external ground you’re using. Different components using different ground reference can cause serious problems that are extremely hard to debug.
In addition, it’s good practice to provide a path to ground that is direct as possible. Make your ground plane as unbroken as possible, without a lot of traces cutting it into pieces or components that current has to flow around.
Have a lot of SMD components? Try skillet reflow soldering
Image credit: Synoptic Labs
Another Sparkfun first, but we can’t stress this tip enough. Skillet reflow works. For $20, you can manufacture 5-20 boards at a time in 5-10 minutes per run. No fuss, no headache (as long as you use proper ventilation), and ridiculously simple compared to any other production method. Sure as heck beats hand soldering SMD’s or ponying up for a $1-5K reflow oven. Check out the tutorial here.
Label all external connections (and other things too)
PCB silkscreen layers are there for a reason. Use them to include labels for footprints of your major components, and any connection that has to interface with something else. You’ll have limited space, but use a logical and descriptive naming scheme – it’s much more useful to have a name like “LED PWR” than just “LED” or “LED1”. Debugging which pad goes to what is no fun, so give yourself some help. You can also use the silkscreen to label anything else that might come in handy (a mounting direction, board design version and date, etc.)
Pay close attention to your power supply when mixing components
Interesting thing about microcontrollers and other precision chips – they tend to be the divas of the electronics world. Even slight ripples in their input power can lead to resets, malfunctions, and generally nasty behavior. Development boards such as Arduino include linear regulators and filtering capacitors to enable the use of different voltage sources, but also to filter out noise and fluctuations.
If your circuit is simple and uses a consistent power source (usually batteries of some kind), you may be able to step the voltage to the level that your circuit needs, then leave it alone. However, if you’re also running other components from the same source, particularly anything that draws high current or is capable of producing electrical noise, you need to make sure it won’t affect the chips in your final design. Motors, servos, and anything that transmits wireless data are common culprits that can cause noise or inrush current issues.
There are two ways to combat this: filtering and regulation. Filtering is a good idea on any circuit, and involves putting different types of capacitors on your power inputs and microcontroller input pins to filter out low and high frequency noise. You can read more about filtering capacitors on the StackExchange electronics site.
Sometimes, filtering capacitors aren’t enough, usually when you have a high-current device that actually drags your source voltage downward for a period of time when it starts up. In this case, you’ll need to provide an external regulator for your microprocessor, just as the dev boards do. A linear regulator is the low-cost choice, and should be fine if your input voltage is close to the chip’s operating voltage because you won’t waste a lot of energy. If the regulator is converting a significantly higher voltage to a lower one, a linear regulator will be inefficient because it is burning the extra voltage as heat. You may want to consider a switching regulator instead, which is more expensive, but doesn’t waste nearly as much power.
Tent your vias
Image credit: Big Mess o’ Wires
Tenting vias means to cover them with the soldermask layer. Normally, you’ll have no reason to keep vias exposed, since they aren’t used as solder pads. Tenting via creates a cleaner look, protects the copper from the elements, and allows you to apply silkscreen over them.
Making more than one board? Design and quote accordingly
There are plenty of PCB manufacturing houses out there, and they all cater to different order sizes and features. Do your research and get quotes from several places if possible. For example, BatchPCB is a great choice for prototypes and one-offs, but if you’re looking to make 20 or more units, services such as Advanced Circuits can be cost-competitive while giving you much faster turnaround times.
Manufacturing quantity also factors into design and component selection. Most beginners find it easier to use through-hole components so they can hand solder everything. However, if you’ve ever made 5 or more boards at one time, you know that hand-soldering can quickly become painful. If you’re doing a production run, consider switching to as many SMD components as possible and using the skillet reflow method. It will save you time and often money, as SMD components are usually less expensive than their through-hole counterparts.
Designing PCB’s can seem daunting for a beginner, but if you follow some of these tips, it can be much easier. Try converting some of your established projects first, and get cheap boards made from BatchPCB or a similar service to get a feel for how things come together. Pretty soon, you’ll be doing large-scale production runs of your own.
We had so many ideas for this tutorial we couldn’t include them all, so if you have feedback or tips of your own, let us know! We’ll add information or even do a multiple part series if there’s enough interest. In the meantime, knock out some awesome PCBs!