PCB Design and Manufacturing

First introduction

In this lesson you will learn how to design and produce your own printed circuit board (PCB). It will make your electronics more reliable and compact compared to a breadboard. Furthermore, it allows mass production nowadays.
PCBs are the basics of modern electronics. The structured conductive layers on its non-conductive substrate can be easily machine produced and serves as electrical connection between the electronic components on top, reducing need for wires and therefore possible faults, costs as well as size.
While this is beneficial for mass-production, the increased reliability and size benefits compared to breadboards combined with reduced costs for professional manufacturing and the possibility for DIY-production makes PCBs even useful for small projects and prototyping.

Practical relevance

– This is what you will need the knowledge and skills for

After learning this module, you’ll understand how to design a PCB from your schematics and how to make and assemble it. This will make your projects run more reliably and ready for mass production.

Overview of learning objectives and competences

In this module, you’ll learn first about different design tools for PCB design, learn about the design steps and how to manufacture the PCB with different methods. Finally, you will learn how to assemble a PCB and find and solve faults.

Required skills for this module

Basic computer skills and Electronic skills learnt in module 7: Electronic 1

Design Tools: PCB design software and their usage.

For mass production and more reliable circuits even for prototyping you might want to use a printed circuit board instead of breadboards. This reduces the possibility of loose contacts and decreases the size of the circuit as an additional benefit. Furthermore, some components only exists as SMD (surface mount devices), which can only be mounted on PCB and not breadboards (albeit in many cases small modules exists which converts these SMD devices into breadboard-friendly variants).

Printed Circuit Board (PCB): A printed circuit board is sandwich structure out of conductive and non-conductive layers, forming electrical connections, which can be easily, and automated mass produced. The non-conductive layer might be different depending on use-case, an epoxy/glass fibre mixture is most common, ceramics and other special substrates might be used for either (di-)electrical or thermal purposes. Depending on the substrate of the PCB you can also produce semi-rigid and flexible PCBs. Solder stop masks and assembly printing further simplifies assembly.

Tools for PCB design

To produce these PCBs you need to bring the connection from your breadboard into a board layout for the latter production process. This board layout can be even done in a complete manual by using a water-resistant pen for etching or mill manually. Computer aided design software makes your life of course easier. For certain purposes even the known (vector) drawing programs are perfect, especially if you want to go for an artistic approach. 

PCB Badge, combining functionality and design

Specialized PCB design software gives you additional features, they combine a graphical design of the circuit logic with the actual board design. This allows a logical check if your board design will work as intended, as well as production parameters. 
Fritzing is an entry level program, especially useful for starters and small projects. You can even start from a breadboard, converting it into a logical diagram and finally into a board layout. 
Popular programs for makers are Eagle (https://www.autodesk.com/products/eagle/overview) as a semi-professional software, where you can still design small PCBs non-commercial for free. KiCAD (https://www.kicad.org/) is a freeware version, gaining popularity with ongoing improvements, especially through support by CERN.
Real professional systems like Target give additional features but are normally not used by makers due to costs – and freeware software allows a better exchange within the community.

Basic circuit design

A circuit designed in Fritzing

In IO7 Electronics generalities – Schematic and building a circuit you already learned the basic symbols and how to connect them for the circuit diagram, which represents the logic of your circuit. There you used Fritzing, but the other design softwares (Eagle/KiCAD)  works similarly on a basic level. Normally you start with this circuit design, first selecting the components, placing them and connecting them with wires. Try to draw the logic as understandable as possible to find errors. It helps to give both components as well as wires (meaningful) names (labels on wires might also help). Don’t draw power lines over the whole area but use VCC (power) and GND (ground) symbols (sort of non-existing, only logical components). You can also combine wires into nets or name them to reduce the need to draw wires.

A circuit designed in KiCAD

Not strictly necessary in every use case, but it’s good to make a habit out of it: Set the right values for resistors, capacitors and so on. Another good practice is the use of “dots” on top of junctions, to distinguish them from crossings of wires without connections. The program should support this automatically, but for your own sanity you shouldn’t draw these crossings – name the wires and split them would be the better option to keep the overview. Rotating or Mirroring objects might also help you to prevent crossings.

A circuit designed in Eagle

Best practice for the optics is furthermore that you only use wires at right angles. For production purposes you might also want to add some so-called passer marks, without any purpose on the logical side, but it will allow you to place some optical marks on the boards for an automatic component placement while assembling. In the case of automatic assembly, it might also help if you use a manufacturer’s component library, if available.
You can further structure the design file with frames, lines and text for grouping and remarks.

After the first layout you can check your design manually but the better programs allow a design check (ERC, electrical rule check). Furthermore, you might be even able to simulate the circuit e.g., with Spice, but this might be a bit overkill for most designs in the maker area: It is useful for simulating and designing analogue circuits, not necessary for the common microcontroller based circuits which work mostly digital. 
One challenge might occur if a component is not available in the part library. In this case you might need to design your own. But first check the internet if someone already did it and made it available in a free library, which can be normally found by just searching for program name, component name and “library”. Otherwise you need the datasheet of the part, and then draw both the logical and board layout of the component (corresponding to the datasheet) and connect both. In many cases you might check especially for the board layout if this so-called package can be found for another component in your library, so you just need to copy-and-paste it.
When the circuit diagram is complete and error free, you can switch to the board layout. Error checks can be partly made by the program, they provide an error rule check as an option, but has to be mostly done by just checking the circuit by yourself, since the program doesn’t know what you want to achieve with the design.

Basics of board design

If you switch to the board layout design, you should already see the components corresponding to your circuit design. Normally both board design and schematic should be synchronized and both are updated at the same time. In Eagle both schematic and board file has to be open, in KiCAD you might need to update the PCB file if you change something in the circuit file. 

Between the components thin lines represent the logical connections between pins.

1) Place the components roughly for the intended layout.

The same circuit from before as board design in Fritzing,

2) Wiring. Depending on the production method you might use the right dimensions for wires etc. – in some programs you can load so-called design rules to make sure your design will match production criteria. Make the wires as thick as necessary if you will transfer power over these lines (you can check possible current dependent on copper thickness and wire width through internet search, e.g., https://www.4pcb.com/trace-width-calculator.html), for normal data usage very thin wires are enough, but for production purposes go at least for the width described in the design rules). After you select the right width for the traces (wires) you can start wiring. Just start from one pin of a component and follow the thin trace to the next one.

The same circuit from before as board design in KiCAD

Make sure you keep distance from other pins and wires (don’t cross them). Best stay with horizontal, vertical (90°) and diagonal (45°) wires for a clean layout. The other basic feature is the raster system to align components and wires, helping to give the final PCB a professional look. Try to stay with one layer if possible (putting all components on one side will make life easier for manual and cheaper for automatic assembly, and for manual PCB production one sided wires will make production easier). Normally you can flip components through mirroring, for wires you can select a layer – there might be even more than the two.

The same circuit from before as board design in Eagle

If you need to cross wires, you can do this by either using the holes of Through-hole-components or using so-called VIAs, holes with conductive plating, to switch with a wire from one side to the other (VIA just stands for the latin word of path, creating a path for the electrical current from one side to the other). Another option is to add 0-Ohm resistors to your schematic for crossings, or – if possible – the exchange of used pins of components. You can also use an auto router to create the connections, but this might take up more space.

3) You also need to add a board outline (basically wires on a special layer – with each layer representing one production process) and, if necessary, holes for mounting.

4) You can also arrange the names and value of components for a so-called assembly print, making assembly and repair later on much easier. Of course, you can also add additional text, forms and logos for the same purpose, aesthetic or other reasons (version number, producer, designer).

There exist of course a bunch of other special features for more advanced designs: One option is the use of copper areas instead of wires (especially as mass area). Other features help to match different wires in length for high frequency.

Finally, you should make a design rule check (DRC) if available, it will help finding errors like crossings, distances hard or impossible to manufacture (according to the design rules). 

You might need to switch between steps back and forth while designing the PCB – and even change the circuit in the schematic again in the process – e.g. using different pins on a microcontroller or rearranging component orders within the circuit might help creating a smaller or cleaner design. This is mostly helpful for mass production or if size constraints exits

If everything is okay, you can start the production process.

Board production: Make a physical PCB

After designing your PCB, you can start with the physical production. There exist several methods, based either on base material or just available production methods. You can also just order your PCB, which you can do nowadays relatively cheap and fast even within Europe – Aisler B.V. is one example especially for prototyping. Price of course depends on size (bigger is cheaper per square centimetre) and number (more are cheaper per unit). For a basic 16 cm*10 cm PCB you might pay around 10€.

In this case you will have the advantage of getting a professional made PCB, including VIAs, solder stop masks and assembly print, which makes your life easier. But of course, for special boards and especially if machines are available you can make PCBs by yourself. Most common methods in this case are etching or milling.

Etch a PCB

One easy method for PCB production (which is even the professional method) is etching. A copper-coated epoxy/fibre (or hard paper) base material will be structured through etching.

First step: you need to get your layout as an etch-resisting mask on the copper. Again, you will have several options. 

Besides manual drawing with a plastic based pen (edding), you can print your layout with a laser printer (mirrored) and then transfer the print on the copper: The laser printer melts plastic on paper (or plastic foil). You can transfer this plastic layer onto the copper by applying heat and pressure with an iron. Very nice for home use, but you need to find the right paper/foil for your laser cutter, and a bit of manual work for removing the carrier paper after the transfer process. 

Finding the right paper is the biggest issue here – you need a material where the toner won’t be soaked in completely, an option are therefore overhead foils. Other options are high gloss catalogue paper, and also photo paper. It’s a case of trying out different materials and finding the one which works best for you.

The professional method would be using a PCB with a photosensitive layer. You can structure it with UV light with a mask (print on overhead foil). You might also use displays with a UV blacklight (similar to UV-3D-printer) or CNC controlled laser for eliminating the mask. In any case you need to develop the photosensitive layer in a chemical bath, adding an additional step with more chemicals.

The last – uncommon – method is the usage of a UV printer to print the mask directly on the copper.

Second Step:  You can start the etching process. A simple method is using a container of Fe-III-Chloride. Since all these chemicals are not very healthy and might produce stains, wear gloves, work clean and dispose of chemicals correctly. At the end, you just need a container for the fluid, big enough for the PCB.  Put your PCB with the mask into the fluid for a certain time. It works better and faster for higher temperatures and by moving the fluid and putting air into the mix – but just using a jar, big enough for your PCB, at room temperature will also work fine, just might take a while longer.

For other etching chemicals heating up the fluid might be necessary, additionally moving the etching fluid around will speed up the process. For heating, an aquarium heater can be used, for movement just moving the container. In advanced setups (commercial etching machines) a pump can blow air inside the container from the bottom to speed up the process, or in advanced setups the etching solution is sprayed on the PCB.

But the container with FE-III-Chlorid has the advantage that – with a good enough lid – you can just store the whole container without cleaning further equipment and keeping these fluids in one place, optimal if you don’t etch many PCBs, and etching time is therefore uncritical.

Third Step: Clean the PCB, first to remove the rest of the etching fluid to prevent further corrosion, second to remove the etching mask to be able to solder the components on the PCB.

Fourth Step: You need to cut the PCB into the right dimensions and drill holes if necessary – thin hard paper PCBs have the advantage that you can cut it with scissors. This might be done with a CNC mill, but in this case, you might directly mill the whole PCB instead of etching.

Excurs

An additional benefit of thin PCBs is that you can stack a bunch of them as multilayer layout without need to align Masks and PCB for the different layers within the production process, just align them later on through the connections through holes and Vias – of course you still need to make these connections between layers – creating Vias through wires or rivets is the main reason that buying multi-layer boards has an advantage… besides solder stop, assembly print and so on.

Mill a PCB

Milling a PCB works similar to the milling process of other materials. The Mill needs to be precise enough, and the tool needs to be small enough for the isolation traces – which will make the tool prone to braking. One compromise is using a cone-shaped milling head – but in this case you need to carefully adjust the distance from milling head to PCB in the machine. If the mill didn’t go deep enough you will produce short circuits between traces, if it went too deep it might remove too much copper, breaking the circuit traces.

You might also need to change tools for drilling and cutting out the PCB, an advantage of an automatic tool change. 

It is important to know that the dust produced while milling the PCBs is very unhealthy, make sure that dust exhaust and filtering works, and use filter masks.

One important part is the transfer of the board layout into the milling path, instead of just the drawing export for etching. The design software mostly exports gerber files (In eagle you can use a CAM-Processor, in KiCAD it works with plotting the different layers – in this case you need to also generate a drill file if necessary). Special software, e.g., flatcam, can translate these gerber files into mill compatible file formats (G-Code). For specialised PCB milling machines specialised software will make the following necessary steps easier and straight-forward. If available, select first a template for one- or double-sided PCB. You will then import the gerber files and assign each file to a layer if that’s not done automatically.

Excurs

For double-sided PCBs the PCB needs to be flipped around after milling one side, and both milled sides need to be correctly aligned. Some specialised milling machines use both mechanical alignments (PCB holder) or camera systems. For the latter, you need to add optical markers, so-called  Fiducials around or on your PCB. They are drilled through and allow an automatic position calibration. Similar systems are used also for automatic assembly.

Thereafter you can create the isolation path around the wires as well as the board outline path with a click of a button. Make sure that tools used for these routing are the same as used in the actual machine, and that drilling holes, board outline and path are at the right position and dimension – normally scaling should not be an issue, but better be safe than sorry.

Please make sure – especially for small PCBs – to add bridges on the contour such that the PCB stays connected with the surrounding material. Otherwise, it might move or even get sucked in by the exhaust system. These bridges can normally be added before creating the contour path.

For the machine itself make sure that the right tools are in the tool holders or in the machine head (depending if automatic tool change is available), as well as calibrate milling depth if necessary. 

For the latter just mill a straight line with the tool, and check (especially for conic milling bits) the width of the produced line. If the line is too thin, the distance needs to be reduced, otherwise extended.

Milling a PCB – on the front left you see already finalised small PCBs, just connected with the bridges to the rest of the raw PCB.

Otherwise, fixate the raw PCB with tape on the milling platform, to prevent movement.

Find a spot for your layout and move the milling head at the corresponding position (zero-position) . Then send the design (in form of G-Code) to the machine and start milling one side of a PCB. 

For double sided PCBs you need to turn the PCB over and align it correct. This might work for specialised PCB milling machines, for others this might be a hassle. 

Easier solutions are using wires if only few wires are used on the second side or mill multiple (thin) single sided PCBs for each layer and stack and glue them afterwards as mentioned before. The second challenge with double sided PCBs is the electrical connection from one side to the other as well – with through-hole components you can use their legs, otherwise you might need to use wires or rivets.

Alternative methods to produce PCBs

You can also use other machines to produce PCBs. You can cut the board design (as a pdf export of each copper layer) with a vinyl cutter out of copper tape and apply it later on a substrate. This works due to the necessary amount of manual placement or removement of copper foil best for simple circuits with thicker wire width. 

An embroidery machine allows you to stitch your circuit (again, use the pdf export of the copper layer) on a textile with silver conductive yarn. Here, the main disadvantage is that you can’t solder components on the silver yarn, you might need to use alternative methods.

Similarly, you can directly print circuits with modified inkjet printers and silver ink.

Of course you can also combine these different production methods as well as technologies – combinations like flexible-rigid PCBs are also made by professional producers.

Embroidered textile sensor pads with a clipped-on milled rigid PCB

Clean-up and improvements of a PCB

After you get the raw PCB you might want to clean it up and improve it to resemble professional made PCBs. 

1) Sand both edges (remove bridges) and the copper itself (remove the copper oxide on top for better soldering). Again, make sure to use proper safety gear like masks and exhaust systems.

2) Apply (spray) solder varnish. This will prevent further oxidation of the copper and keep the copper easily solderable. 

3) Check the PCB both optical and electrical for short circuits as well as interrupted traces. Small problems might be fixed either by applying solder (or small pieces of wire) or manually milling copper away. 

Afterwards, the PCB is ready for assembly. 

Some other options to make your PCB more professional looking or help for certain specialised use cases exist but are in most cases unnecessary and too complicated:

For example, you could tin the copper. Other improvements would be a solder stop mask; this is a bit complicated. One option would be a paint layer structured with a laser engraver. Similarly, you can use a laser engraver to add a sort of assembly print, at least on non-copper parts. Otherwise, the aforementioned toner transfer might be also an option.

You can also electrolyte gold contact areas, but if that’s really necessary a commercial made PCB might be the better choice.

Finally – but here we start to get into assembly – you can insert copper rivets into the holes to connect different layers, either by using a (very expensive professional) tool or just insert them with pincers and use a hammer to flatten the sides. It makes sense to additionally solder the rivet for a reliable electric connection.

Milled PCB after cleaning up (and assembly): Filed away bridges stumps, copper sanded and contact area gold plated.

Assembly: Populate your PCB with components

Manual and automatic pick and place

Placing the components can be done either manual or automatic. On an industrial level the automatic assembly is of course the most common method for mass manufacturing, but with laborious setting up even there manual placing is common for prototyping and limited numbers of PCBs. A simplified version of the automatic pick and place uses only the mechanics without camera system and motors, but with vacuum pincers to move and place components manually without hand tremors. As the simplest helping tools for manual positioning you can use magnifying glasses and (vacuum) pincers for small components. Make sure you place components in the right direction, if they are unsymmetric.

Soldering methods

There exist several approaches to how to solder the components on the board. The most common one is using a soldering iron. Make sure you keep the tip clean and heat it up to a temperature corresponding to the used soldering wire. Old ones with lead need lower temperature, the lead-free newer ones need higher temperatures and eventually more solder flux (and is a bit harder to solder). Melt a piece of soldering wire on a pad with the solder tip, then place the component on top, and melt up the pin as well as the components pad until the solder melts again and forms a connection between pad and pin. It should form a nice cone-shaped curve between both parts, a bubble form is wrong. Continue with the second pin, in case the component has more than two pins you will start with opposite two, the first one fixates the component, the second one allows position correction before fixation. Afterwards solder the rest of the pins/pads. Usually, you will start with the smallest components and continue with the bigger sizes such that components won’t come into your way.

Holding a smd resistor with a tweezer while soldering the other side (pad) of the component.

Alternatively you can use solder paste. Here you will either use stencils to apply solder paste on each pad or use a syringe to apply paste on each pad. Stencils can be either ordered or produced with a laser cutter based on your PCB design (solder cream layer) out of thin plastic. Afterwards you can orient the stencil on top of your PCB and fixate it (e.g., with tape). Apply a string of solder paste on one side and spread it with a spatula over the stencil and press it into the gaps of the stencil. Afterwards, you can place all components on the board and heat the whole board up, either on a heated plate or within a stove. You can even use a modified pizza stove for it – either just with high-enough temperature or with a microcontroller controlled temperature profile. 

Normally components will be sucked in place due to surface tension. Small components might lose contact on one side and move into an upright position. In this case you need to adjust it, either with the soldering iron or hot air. Again, a pincer might help. 

If you apply to much solder you can either remove it with a desoldering braid or – pump. Another option – due to the missing solder stop mask on self-made PCBs – is to smear the solder over the copper wires.

Another, but more uncommon method is vapour phase soldering. In this case you place components on the board and put it into a deep fryer. A solder material will be heated up and moved in a gasoline form between components and board, forming the solder joint. The nice thing is that it is heavier than air and therefore stays within the fryer, the main disadvantage is that it will produce dangerous chemicals if it becomes a bit too hot.

You can also use conductive glue instead of soldering, but the reliability and conductivity is much worse than a soldered connection.

Ultrasonic bonding or laser usage produces a reliable connection but is a bit of overkill from the necessary machines.

Check the PCB and fix mistakes

After components are placed you should make an optical and electrical check (multimeter for resistance measurement) again, check if all components are aligned correctly, solder joints look correct and no shorts exist through too much solder. Otherwise use the soldering iron or a hot air gun to melt the solder and reposition components, as well as removing solder with a desoldering braid/pump if necessary. One advantage of the missing solder mask of home-made PCBs is that you can smear the solder over the copper traces away from a component to fix shorts.

Rivets hammered flat, solder smeared over the copper to prevent shorts. Optically, there seems to be a short between the centre rivet and the neighbouring line (but electrically ok), on the bottom side of the controller on the bottom right you can see a short between two adjacent (but unused) pads. On the left side you see one resistor is not aligned properly (angled and close to the neighbouring capacitor), but still only an optical and not functional error.

Summary

In this content unit you learned about PCB design, production and assembly.

In the first part you gained an understanding of circuit design tools (Eagle and KiCAD as well as Fritzing) by using both schematics for the circuit logic as well as board layouts for the physical layout. You learned about basic rules for board design – keeping circuit path as thick as possible, using VIAs for connection of layers, creating outlines for the PCB form as well as optional markings for text and component placement and finally using a design rule check to verify a valid design.

In the second part you acquired knowledge about different production methods. Depending on the PCB type and available production methods. Etching and milling are the most common methods, alternative methods can involve embroidery or silver ink printing. The last lesson in this part was about cleaning and improving the produced PCB: Mainly sanding, preventing oxidation, checking for short circuits or broken circuits. Tinning, Gold plating and a solder stop mask or assembly print can be also done, but are more uncommon. Rivets can be used to produce VIAs.

In the last part you learnt how to assemble the complete board, this can involve automatic or manual assembly. You gain an understanding of different soldering methods. The most common one is using a soldering iron, the second is the use of soldering paste and an oven or hotplate. Other options like vapour phase soldering or glueing are relatively uncommon.

The last part is how to check the PCB and find short circuits or broken connections either optical or with a multimeter.

Quizz