We will learn how to make your first Printed Circuit Board (PCB). In this DIY project you will learn step by step how to draw schematics and board layout, how to get your board made cheaper.
Tag: Project 135e How to make a PCB with KiCad. Acoptex.lt
- Sketch: None;
- Libraries: None;
- Other attachments: KiCardProject2.zip
Step by Step instruction
We assume that you have KiCad version 5 (v5) already installed.
1.Open KiCad. Go to File ->New -> Project to create a new project.
2.Give your project a name and choose the location where to save. Then click on Save button.
3. You created an empty project. The first step of our DIY project is to create a schematic. Open the Eeschema (Schematic Layout Editor) by double-clicking on the schematic file (for example, KiCadProject2.sch) or click on the Schematic Layout Editor button. When you open the Schematic Layout Editor for the first time, you will be asked to Configure the Global Symbol Library Table. Just use the recommended settings. Click on OK button.
Please note that if the recommended option is disabled, it means you have installed KiCad without default libraries. So, you will need to download and install them manually.
4. The schematic is a simplified drawing of your circuit that uses the components and wires connecting the components. Click on Place Symbol button (or press Shift+A on your keyboard) and then click anywhere in your work area to add a component. The component chooser pops-up. You can search for a component which you want to add. For example, if you need a resistor, type in “resistor”. Look through the results and choose the best matching.
5. When you have chosen a component, place it in your schematic by clicking in your work area with your mouse. Place the mouse pointer over it and press M on your keyboard to move a component. Press R to rotate a component. You can zoom in/out by using your mouse wheel. Click on OK button.
6. Add battery and led components the same way as described above.
7. Let’s draw the wires between the components now. Click on Place Wire button or press W on your keyboard. Click on the pin of a component to start drawing a wire and then click on the pin where you want the wire to end.
If you want to move a component which is already connected, there are two options:
- Move. If you place your mouse pointer over a component and press M on your keyboard, you will move the component without the wires.
- Drag. If you place your mouse pointer over a component and press G, you will drag the component with the wires attached.
- If you want to cancel moving or dragging press the Esc on your keyboard to release.
8. Each component must have a value. If you place your mouse pointer over a component and press V on your keyboard you can edit its value. You also find this option in the opened menu when you right-click on the component.
If resistor value is 220 Ω – write 220. If the battery value is 9 volts – write 9V. If you have LED write “RED” or something similar to the color of the LED. Please note that the value does nothing to your circuit. It just a reminder for you, so you will remember later which components to use when you start to build the circuit.
9. We need to give the components a unique identifier (for example, if you have several diodes, they will be named D1, D2, D3, and so on). Go to Tools->Annotate Schematic. Use the default settings and click on Annotate button. Then click on Close button to close the window. The components will have numbers now: BT1, R1, and D1.
10. Let’s add footprints to the components now. The footprint is what will be printed onto the board for each component. For example, for a through-hole resistor, you’ll choose a footprint with two holes, so that you will get two holes for soldering the resistor onto on your board. Go to Tools ->Assign footprints…
- On the left side, you see the footprint libraries you have available.
- In the middle, you have the components from your schematic.
- On the right side, you have a list of footprints to choose from.
If you want to see how a footprint looks like, right-click on it and select View Footprint. Click on 3D Display button to see how it looks like in 3D. There are a lot of footprints in KiCad but filters will help you narrow down the footprints options.
- If you filter by pin count you will only see footprints that have the same number of pins as your component.
- If you filter by library you will only see footprints from the library that you have selected on the left.
- The schematic symbol footprint filter will filter based on filtering rules set by the symbol.
11. There are many ways to connect a battery – use a battery holder that is fixed onto the board, a barrel connector or two pins. As we are going to use 9V battery the best to use a battery clip which is fasten to the top of the battery (see the picture below). So, you just need a couple of holes where you can solder the wires from the clip. If you add a pin header with two pins, the footprint will be two holes. We will use Connector_ PinHeader_2.54mm: PinHeader_1x02_P2.54mm Vertical footprint option. Double-click on it to choose.
12. There are two resistor libraries in KiCad – Resistor_THT and Resistor_SMD. Through-Hole Technology (THT) – the type of component where you put the legs into holes on the board and solder on the other side as shown below. It is the classic type of component, often used as it’s easy to solder.
Surface Mount Device (SMD) – the type of component that lies on top of the board. You solder it on the same side, as shown below. It’s a standard component type for modern electronics and it’s smaller and use less space.
We will use Through-Hole Components, so we select the Resistor_THT library. There are many footprints options available. It’s does not matter which option you choose as all of them have two holes on the board to solder your resistor. If you need a perfect fit then measure the resistor you plan to use or look at its size specification. Choose the closest which you can find and double-click on it.
13. We will use Through-Hole Components, so we selected the LED_THT library to add a LED. A typical LED is 5mm in diameter. There are many 5mm footprint options. Please note that many of them have the same footprint but different 3D models. Double-click on any to choose. Click on OK button to close the Assign Footprints window.
14. It’s easy to do mistakes, for example, forget to connect a component if you have large circuits. We can use the Electrical Rules Check (ERC) tool which will help you find these mistakes. Go to Inspect -> Electrical Rules Check or click on Perform Electrical Rules Check button.
15. Click on Run button and look for error messages under Error List.
16. Save your schematic, go to File->Save.
17. That’s it. Your schematic is ready. You can use this Schematic Layout Design checklist with key points for your next KiCad project now:
- ( ) Add all components
- ( ) Add wires to connect all components
- ( ) Add values to all components
- ( ) Annotate your schematic
- ( ) Add footprints to all components
- ( ) Run Electrical Rules Checker, check and fix errors
18. Let’s start with PCB design now. We need to decide where to place our components, draw tracks to connect the components. Go to the Tools->Open PCB Editor. Pcbnew window pops-up. It has an empty work area.
19. Click on Update PCB from schematic button or going to Tools->Update PCB from Schematic… to retrieve information about footprints and connections from your schematic.
20. Update PCB from Schematic window pops-up. Use default options and click on Update PCB button. It will load your footprints. Click on Close button.
21. Click anywhere to place the components. If you zoom in on the components, using your mouse-wheel, you will see white straight lines between the pins – air-wires. These lines will tell you which pins to connect according to your schematic.
22. We need to position the components so it will be easy to connect them according to our air-wires. We recommend the positioning of components same way as you did in your schematic. To move a component, move your mouse over it and press M on your keyboard. If you already have a group selected, the whole group will move. To deselect the group, press ESC on your keyboard. To rotate a component, press R on your keyboard. If you accidentally place your mouse over the component name, you will move just the name. Press ESC to cancel.
23. Let’s replace the air-wires by drawing tracks to connect the components. These tracks will become copper traces on your completed PCB board. Click on Route Tracks button or press X on your keyboard. You can also go to Route->Single Track.
You can choose if you want to draw on the front or the back of the board, by selecting a necessary layer in the Layers Manager. The little blue triangle on the left will show you the layer selected.
- F.CU is the front (or top) side.
- B.CU is the back (or bottom) side.
Click at the beginning of an air-wire to start drawing a track and click where the air-wire ends to finish drawing the track. If there are no more air-wires, you have done with the tracks.
24. Let’s draw the outline of your board by adding a polygon on the Edge.Cuts layer. Select the Edge.Cuts layer in the Layers Manager and click on Add graphic polygon button. Click to start drawing the polygon, click again for each corner, click at the point where you started to complete the polygon.
25. We need to run the Design Rules Checker (DRC) to check if we have made any errors. Typical errors are when you placed two components too close to each other, or when you forgot to draw a track. Make sure that the Edge.Cuts layer selected. Click on Perform Design Rules Check button or go to Inspect->Design Rules Checker. Use default options and click on Run DRC button.
Check both the Problems/Markers tab and the Unconnected Items tab. The Problems/Markers tab will list any design issues, such as a track being too close to another track. The Unconnected Items tab will list any air-wires that you have not yet connected by drawing a track. If you see any items on any of these tabs, make sure you fix them. When you have zero errors listed here, you are done. Congrats. Your PCB board is finished!
26. Go to View->3D Viewer to see your PCB board.
27. Save your board layout, go to File->Save.
28. That’s it. Your PCB design completed. You can use this PCB Layout Design checklist with key points for your next project:
- ( ) Open the PCB Layout Editor and run Update PCB from schematic
- ( ) Position your components in a good way
- ( ) Draw the tracks to connect all components, make sure that no air-wires left
- ( ) Add your PCB board edges (use a polygon in the Edge. Cuts layer)
- ( ) Run the Design Rules Checker (DRC), check and fix any errors that you might have
- ( ) Check your PCB board design in the 3D Viewer
29. You need to have Gerber and Drill files ready to submit your PCB design to a manufacturer. The Gerber and Drill files is a format that all the usable software alternatives for designing PCBs can output, and that all PCB manufacturers can read. Look at our DIY project How to generate Gerber and drill files from KiCad and generate Gerber and Drill files for this project.
30. Navigate to the directory in your PC where your KiCad project located. Select and zip the following 8x files (You can use 7Zip software for that):
- *.drl – Drill file
- *.gbl – Gerber Bottom Layer
- *.gbs – Gerber Bottom Soldermask
- *.gbo – Gerber Bottom Silkscreen (Overlay)
- *.Edge.Cuts.gm1 – Board Outline (Gerber Mechanical 1)
- *.gtl – Gerber Top Layer
- *.gts – Gerber Top Soldermask
- *.gto – Gerber Top Silkscreen (Overlay)
31. You can now use this zip file to place the order on any PCB manufacturer website.
32. In addition to your gerbers, you’ll need to specify on the PCB vendor’s website various elements of the PCB:
- What thickness PCB? 1.6mm is standard but 0.8mm is just as rigid and may help with 50 ohm trace impedance matching.
- What color soldermask? Green is default but red looks awesome.
- What color silkscreen? White is most common but other colors are available.
- How many layers? This example is a 2x layer board meaning there is just a top copper and bottom copper. However, some designs need to have 4x, 8x, 10x and even 16x layers to route the board. Additional layers increase the cost significantly.
We have learnt how to make your first Printed Circuit Board (PCB).
If you need more information on PCB and design, check out Printed circuit board and terms used in connection with PCB design and manufacturing