A printed circuit board (PCB) turns a fragile breadboard circuit into something compact, reliable and repeatable. Free software and low-cost manufacturing mean you can design a board in an evening and have professionally made copies in your hands within a couple of weeks.
The tools
KiCad is free, open source and widely used by hobbyists and professionals. Other options include EasyEDA (browser-based) and commercial tools. The workflow is similar in all of them.
The workflow
- Schematic: draw the circuit using symbols, and connect them with wires and labels.
- Assign footprints: choose each part's physical shape and pad layout, such as a 0805 resistor or a TO-220 regulator. Check footprints against the datasheet or the part you'll buy.
- Layout: place the parts on the board, then draw copper traces to connect them, guided by "ratsnest" lines from the schematic.
- Design rule check (DRC): the software checks spacing, track widths and unconnected nets against your manufacturer's limits.
- Export Gerbers and drill files and upload them to a PCB maker.
Layout tips that save boards
- Place first, route later. Good placement makes routing easy: put connectors at the edges and keep related parts together.
- Decoupling capacitors go as close as possible to each chip's power pins.
- Use a ground plane. On a two-layer board, fill most of the bottom layer with ground copper. It gives every part a short, low-resistance return path and reduces noise.
- Make power traces wider than signal traces. See Going deeper for how to size them.
- Add labels on the silkscreen for connectors, pin 1 and polarity. Future you will thank you.
- Add mounting holes and check the board fits its case before ordering.
Before you order
- Print the layout at 1:1 scale and place the real parts on the paper to check footprints.
- Run the DRC with your manufacturer's rules loaded.
- Check the 3D view for parts that collide.
- Look at the Gerber files in a viewer, since that's exactly what the manufacturer will make.
Going deeper
How wide should a trace be?
A trace heats up as current flows. The long-standing IPC-2221 formula estimates the copper cross-section needed for a given current and temperature rise: I = k × ΔT0.44 × A0.725, with A in square mils, and k = 0.048 for outer layers (0.024 for inner layers). This calculates widths for standard 1 oz copper (35 µm, or 1.378 mils thick) and a 10 °C rise:
def trace_width_mm(amps, temp_rise_c=10, copper_oz=1.0, outer_layer=True):
k = 0.048 if outer_layer else 0.024
area_mil2 = (amps / (k * temp_rise_c ** 0.44)) ** (1 / 0.725)
thickness_mil = 1.378 * copper_oz
return area_mil2 / thickness_mil * 0.0254
for amps in (0.5, 1, 2, 3):
print(f"{amps} A: {trace_width_mm(amps):.2f} mm")
0.5 A: 0.12 mm
1 A: 0.30 mm
2 A: 0.78 mm
3 A: 1.37 mm
The newer IPC-2152 standard uses more detailed data and often allows narrower traces, especially near copper planes. Use either as a guide, and round up generously.
Return currents and ground
Every current flows in a loop, and its return path matters as much as the trace you drew. At high frequencies, return current flows in the ground plane directly underneath the signal trace. Cutting a slot in the plane under a fast signal forces the return current around it, creating a loop that radiates noise and picks up interference. Keep the ground plane solid under fast signals.
Mixed-signal layout
Keep noisy parts (switching regulators, motor drivers, digital clocks) physically apart from sensitive analogue parts, and route their currents so they don't pass under the analogue section. A single, unbroken ground plane with careful placement is usually better than splitting the ground into separate analogue and digital planes, which often creates the very loops it was meant to avoid.
Switching regulator layout
The loop formed by the input capacitor, switch and diode (or second switch) carries fast-changing current. Make it as small as possible, with the input capacitor right next to the chip. Follow the layout example in the regulator's datasheet closely, because poor layout can make a regulator unstable or noisy even with the right parts.
Design for manufacture and assembly
- Respect your maker's minimum track width, spacing and drill sizes, and leave margin.
- Use common footprints and part values, so assembly services can source them.
- Add test points for power rails and key signals, plus fiducial marks if the board will be machine-assembled.
- Include a version number and date on the silkscreen.
Sources
The main references behind this guide. Numbers we worked out ourselves, such as the code outputs, come from running the code.
- IPC-2221: Generic standard on printed board design (paid standard, not online)