This week, we’re excited to kick off a three part blog series about building your first PCB prototype. PCBs (printed circuit boards) are the heart and brains of every product that turns on, plugs in, or lights up. They contain electrical components that determine the behavior of your product, and come in all shapes and sizes.
In this first post, we’re going to share some tips about defining and communicating PCB fabrication specifications, and creating gerber files for your prototype.
Wait, What are Gerber Files?
Gerbers files are the digital blueprints that allow manufacturers to build your PCB, layer by layer. Many PCB design software packages have built-in tools for generating these kinds of files - at Particle, we use EAGLE, a free and powerful PCB design suite popular with engineers all over the world.
In this blog post, we’re not going to focus on how to create schematics and PCBs in EAGLE, since there are already several extraordinary tutorials on the web that do a great job. In our opinion, this three-part series by SparkFun is among the best:
Instead, we’re going to focus on fabrication specifications - the design requirements that have less to do with defining the electrical function of your product, but have a tremendous affect on its cost, yield, supply chain, and manufacturability.
Keep in mind throughout this post that following common manufacturing standards is always the cheapest, fastest, and least complicated route through the prototyping process. The following design rules and standards are often overlooked until the price is too high or the yield is too low, so our hope is that this post will save you some valuable time along the already unpredictable road from prototype to production.
1. Understanding PCB Fabrication Specs
- Dimensions - Pretty simple, the size of your PCB. The key thing to keep in mind here is that the cost of a PCB scales with surface area, so be sure to use only the space that you need in order to minimize costs. Similarly, PCB board designs with irregular shapes that result in waste materials during fabrication will be more expensive the a smaller, rectangular footprint for the same board.
The first version of the Spark Relay Shield has a square footprint of nearly 74.5 cm^2, and lots of unused space. The second iteration (prototype!) has a reduced footprint of only 65.4 cm^2, and includes a large prototyping playground as a bonus.
# of Layers - The number of layers in a PCB is a basic indicator of its complexity (lower is simpler). You can think of additional PCB copper layers like highways stacked on top of one another - they provide new planes in which to route the traffic of electrons when the maze of electrical connections between components and pins start to overlap on one another.
Material Type - A standard multilayer PCB consists of several copper clad boards fused together on top of each other. The most common type of PCB material used these days is the glass epoxy or more widely know as the FR-4, where FR stands for flame retardant while the number denotes its flammability. About a decade ago, the more commonly used PCB material was the phenolic paper or the FR-2. This material was prone to chipping/cracking and not to mention, more toxic. Other less common PCB materials are polyimide, teflon, PEEK used in flexible boards. Most PCB manufacturers offer FR-4 as a default choice but care must be taken when designing high speed or RF boards where the dielectricity and thickness of the material becomes very important.
Board Thickness - This is a primary mechanical specification of your PCB, where 1.6mm thick seems to be the industry standard. Depending on the number of copper layers, the PCB manufacturer will choose PCB core dimensions that result in the desired board thickness. If your PCB is enclosed in a small space, you might desire a thickness like 1.0mm or less. Manufacturers can commonly accommodate thicknesses down to 0.4mm.
Plating Finish - Pad plating is a technique in which the exposed copper surfaces of a PCB are plated with another metallic material to improve solderability of the pads during assembly. The most common plating technique is leaded or lead-free HASL (Hot Air Solder Leveling), where solder is pre-applied to the board during PCB assembly. An alternate technique is ENIG (Electroless nickel immersion gold) plating. This is a more expensive plating technique, but offers improved resistance to oxidation and surface planarity (flatness). This makes it a great choice for large BGA components and exposed contact pads or test points.
The PCB on the left is ENIG plated while the one on the right is standard HASL. Observe how the HASL pads are uneven while the ENIG ones are perfectly flat.
Impedance Control - If your PCB has a radio on it (Wi-Fi, Bluetooth, etc.), you may need to specify impedance control. Impedance control means that a set of specified traces (usually the RF net) present a known resistance to all signals traveling within them. Impedance is affected by a variety of factors including the dielectric of the pre-preg material, trace width, and soldermask. Carefully controlled impedance is important for optimizing wireless antenna performance. For example, Wi-Fi antenna circuits are typically controlled to 50-ohm impedance. Impedance control requires expensive equipment, and not all manufacturers are capable of ensuring controlled impedances. Expect this to add to your fabrication costs, and to add more if your tolerances for controlled impedances are relatively strict (< 5% variance from spec. 10% variance typical).
Minimum Width/Spacing - This is a measure of the minimum width of the copper traces on your PCB, as well as the minimum distance between individual traces. 6 mil spacing is very safe for most fab houses, while some manufacturers can handle down to 3-4 mil spacing. It’s a great accomplishment to route out 64 or 128 pins of a microcontroller, but only if there’s sufficient spacing to actually fabricate it. So, pick out a spacing requirement that aligns with your manufacturer’s minimum specifications, and stick to it!
A board on the left uses default width and spacing tolerances while the one on the right asks for more. Observe how the holes on the vias aren’t exactly centered. This becomes a problem when your PCB manufacturer cannot stick to their tolerances. So try to be more generous with your copper wherever possible.
Hole Sizes - The size of the holes and vias (which create vertical electrical connections between copper layers) on your board. Specifying small pads and vias on your PCB is a great way to save space, but also makes it more difficult for your fab house to manufacture. Smaller holes mean tighter tolerances on your manufacturer’s drilling process, a greater likelihood of missing or landing outside the pad, and the creation of scrap and wasted material. 0.2 - 0.3mm vias sizes are typical.
Solder mask - A solder mask is a lacquer-like layer of polymer usually applied to the copper traces of a PCB. It helps prevent solder bridges from forming and potentially causing short circuits. Many manufacturers will give you a choice of solder mask color, which is fun! Beyond the standard green, you can oftentimes choose red, yellow, blue, black, or white. Two tips about solder mask selection:
Many quick turn fab houses optimize their manufacturing processes for standard specifications, which include green solder masks. If you want a cheaper, faster turn time, pick green!
White solder masks are awesome and unique, but hard to keep pristine-looking during assembly. The picture below is an example of a pre-production sample of the Spark Core, which occasionally became discolored during high-temperature reflow and wave solder steps. We ultimately chose to switch to a black solder mask in order to avoid the costs associated with cosmetic defects.
Pink discoloration (left) on a white soldermask caused by residual chemicals left over from the PCB fabrication process, and agitated by the high heat of reflow and wave solder. Normal sample on the right.
- Silkscreen - Silkscreens are the final layer applied to your board: the text, graphics, and designators that help to document and annotate your PCB. The correct term for this process is actually “legend printing”, but everyone calls it the “silkscreen” because silk screen printing with epoxy ink is the most common method for creating PCB legends. A more accurate alternative to silk screen printing is LPI printing (Liquid photo imaging) which creates a much higher resolution silkscreen at a slightly higher price point.
Comparison of LPI (left) versus traditional silk screen legend printing (right) at equal magnification.
- Minimum Pitch - In the world of PCBs, “pitch” refers to the distance between adjacent pins on an electrical component. If your product requires a complicated part with lots of pins and a very fine pitch, your manufacturing options may be limited to higher cost assembly houses with modern equipment. Aggressive pitch requirements often result in decreased yield, so it’s reasonable to add the projected cost of scrap (expected scrap rate % * scrap cost) to the price of whatever component is driving the complexity of your PCB. A 0.3mm minimum IC pitch seems to be common for most standard PCB assembly houses.
Modern integrated circuits are now available in almost indefinite number of packages and pitches. The QFN and BGA packages tend to be more challenging when prototyping or hand assembling the boards.
- Castellated Holes - If you’re making a module or PCB that mounts to another PCB, you might consider adding castellated pads to your design. Castellated holes are essentially vias or thru holes that have been cut down a diameter to expose copper along the side face of the PCB (see the picture below). These are super useful in particular use cases, but not all manufacturers can build PCBs with castellated holes, so make sure to do your research.
Left - PCB with castellated pads. Notice the HASL plated copper (silver) running down the side of the PCB. Right - Castellated PCB mounted to a host board.
- RoHS Compliance - If you’re building a product that will be sold and shipped to customers, you should communicate your need for RoHS compliance to your manufacturers. This ensures there will be no restricted materials (Lead, most notably) in or on your PCB, and that it will be safe for direct handling. Even though this is a common requirement, leaded and non-compliant parts are extremely common, so one might sneak into your design if you’re not explicit with your requirements.
For those interested, I’ve included a link to Particle’s fabrications specifications template here.
2. Checking For Design Rule Violations
Once you have an understanding of the fabrication specifications of your product, it’s important to hold yourself accountable to those standards throughout the development process. Here are a couple of great tools to help you do this:
- EAGLE DRC (prototyping) - In EAGLE, you can add most of these specifications to a design rule profile against which your design will be checked.
One tab of the Design Rule Check utility within EAGLE. This tab, titled “Clearance”, defines minimum distances between various features of your PCB.
Once you’ve finished building a design rule profile that matches with your manufacturer’s specifications, you can press the “Check” button to automatically identify violations for manual review or correction.
- FreeDFM (pre-production) - If you’d like to do a design rule check but only have access to the gerber files (instead the original PCB design file), you can use a free utility from Advanced Circuits called FreeDFM.
Example results from a free design review from FreeDFM
While FreeDFM doesn’t give you as much flexibility to define your own design rules, it’s a great tool if you’re aiming to design to the most common manufacturing standards. The tool provides organized reports with clearly identified issues, and can automatically correct simple design problems.
3. Generating Gerber Files
Now that you’ve finished your design and checked it for common manufacturing issues, it’s time to generate the gerber files for your prototype. I recommend checking out SparkFun’s tutorial for a good primer on how to create gerber files for your design from within EAGLE.
If you’re interested in generating gerber files for a 4-layer PCB (like the Spark Core, Photon, and Electron), you can download and use our 4-layer CAM job for EAGLE which supports additional copper layers and milled slots.
Review Your Files
Once your gerber files have been created, you should review them to make sure the design is complete and everything is rendering clearly. There are lots of great free gerber file viewers out there, but here are our favorites at Particle:
A quick look at MCN Gerber Viewer, a simple and free gerber viewer for Mac.
As a quick reference, here’s a lookup table for many of the file extensions that will be created when you generate your gerber files in EAGLE:
Note that you only need a .GBP file (bottom stencil file) if you’re PCB is double-sided and requires SMT on both sides. The 2nd and 3rd copper layers are only for 4+ layer PCBs, and are unnecessary for standard 2 layer PCBs.
Document Your Stackup
Now that you’ve got the gerber files generated, it’s time to document your stack up and send them off for production. Although it might be clear to you, it’s important to specify which layer is which so your manufacturer knows how to arrange the layers inside your PCB sandwich. You can specify your stack up with a simple .txt file, or as a part of your fabrication specifications in a more complete Excel sheet like the example document we linked to above. Here’s an example of both:
Above - Example of how to document a 4-layer PCB stack up in Excel. Below - Board documentation in a simple .txt file.
.Zip Those Suckers Up
Now that you’ve reviewed your design for manufacturability, prepared all of your documentation, and generated your gerber files, it’s time to send them all off for fabrication. Manufacturers prefer .zip or .rar files, so make sure you organize and compress all the relevant information, including your gerbers and fabrication specifications sheet, into a single file. Other information to consider packaging with your gerbers includes:
- Documentation of any and all traces that require controlled impedances
- A graphical representation of your PCB stack up
- Mechanical specifications for the creation of a panelized PCB design for your prototype
- Pantone numbers for custom-color silkscreens and soldermasks
Next Time: Ordering Materials for Assembly
That’s it for the first part of our three part blog series on building your first PCB prototype! In a future post, we’ll give you tips and resources to purchase everything you’ll need for assembly including low cost/fast-turn PCBs, solder stencils, electrical components, and everything in between.
If you liked this article and wish you had more assistance in the product development process, than be sure to check out our new engineering service, Particle Studios. Our Studios team has helped dozens of customers build their IoT products from concept to market, and they can help you too.
Until then, happy hacking! Have questions about this post? Be sure to add them to the comments section below!