2021 May 10

Acoptex.Com

Arduino and Raspberry Pi projects

Basics project 135l How to generate a bill of materials and add BOM plugins in KiCad v5


SHARE

Basics: Project 135l

Project name:  How to generate a bill of materials or BOM files in KiCad v5.

Tags: KiCad, KiCad v5, bom, bill of materials

Attachments: KiCad_BOM_Wizard-master.zip

General

We will learn how to generate a bill of materials or BOM files in KiCad v5.

There are two options in KiCad to create a a bill of materials(BOM). You can do it from the Schematic Layout Editor (Eeschema) tool or PCB Layout Editor (PCBnew) tool.

Creating a BOM via PCB Layout Editor (PCBnew) tool is very simple but limited in its capabilities, as the PCB Layout Editor (PCBnew) tool knows only about the reference, value and footprint assigned to a symbol.

Creating a BOM via Schematic Layout Editor (Eeschema) tool is a bit more complex to setup but you can do a lot more. Schematic Layout Editor (Eeschema) tool can include much more information for each symbol (one can add additional fields to symbols).

Step by Step instruction

1.Creating a BOM via PCB Layout Editor (PCBnew) tool

  1. We assume that you have the KiCad v5 already installed. Double-click on the KiCad shortcut to start the program.
shortcut KiCad

2. You will see KiCad project manager window opened. Click on PCB Layout Editor (PCBnew) button.

bom

3. Go to File -> Fabrication outputs -> BOM File… Select the location, give file a name and click on Save button to save your BOM file.

bom
bom

4. The BOM file will include the references, values and footprint fields. It is grouped by value.

bom

PCB Layout Editor (PCBnew) tool also has a pyhton api so it is possible to write more powerful BOM plugins that way but it will always be limited by the information available to PCB Layout Editor (PCBnew) tool.

2.Creating a BOM via Schematic Layout Editor (Eeschema) tool

  1. We assume that you have the KiCad v5 already installed. Double-click on the KiCad shortcut to start the program.
shortcut KiCad

2. You will see KiCad project manager window opened. Click on Schematic Layout Editor (Eeschema) button.

bom

3. Every symbol placed in the schematic can have a number of fields (or attributes). By default, these are the value, footprint and datasheet fields but one can also include more information like, for example, order information. These fields can be added at schematic design time, or they can already be set in the symbol library.

4. Look at simple way to get BOM via the Edit symbol fields.. window. Go to Tools -> Edit Symbol Fields… Symbol fields window pops up. You will see a table view of all symbols fields in your schematic. Use the Group by and Show tick boxes to leave the required BOM information. Left click on the top left cell and shift+left click on the bottom right cell to mark the table. Press Crtl+C to copy. Open any spreadsheet program (for example, MS Excel or Libre Office Calc) and press Crtl+V to paste your table, BOM information.

bom
bom

5. Schematic Layout Editor (Eeschema) tool uses a plugin system to create the BOM. KiCad comes with a few default plugins but there are many useful plugins build by the community, these give more powerful results. We will show you how to set up one of BOM plugins. The plugin used in this tutorial will generate a html page which is readable with your web browser.

4. Go to Tools -> Generate Bill of Materials… or click on Generate bill of materials icon. The Bill of Material window pops up. It will be empty when you run it first time, but if there is already a plugin setup then you can run it to see the results.

bom
bom

5. You can see the list of BOM plugins on the left. Select the bom_html_grouped_by_value.py file and click on Generate button. Your BOM file will be generated and saved in your project folder. You can open it in any web browser (for example, Edge, Mozilla, Internet Explorer, Google Chrome..)

bom
bom

3. Adding a plugin

1.You can also add other plugin by clicking on + Add a new plugin and its command... in the Bill of Material window. The file browser window will open. Go to the location of your BOM script. The scripts supplied with KiCad can be found here:

  • in Windows: C:/Program Files/KiCad/bin/scripting/plugins/ or C:/Program Files (x86)/KiCad/bin/scripting/plugins/
  • in Linux (Ubuntu): /usr/share/kicad/plugins/
bom

2. Download the KiCad_BOM_Wizard plugin KiCad_BOM_Wizard-master.zip and unzip it with 7Zip software. Navigate to the folder, select the KiCad_BOM_Wizard.js file and click on Open button. Please note that you should have Node.js with all dependancies and npm installed in order to use this plugin. We used the node-v12.22.1-x64.msi for Windows 7 64bit.

bom

3.Give nickname to the plugin and click on OK button. Your plugin is added to the list of BOM plugins now.

bom
bom

Update the Command line: with the one for the 3 options bellow:

  • Generate HTML BOM: kicad_bom_wizard “%I” “%O.html” “HTML”
  • Generate CSV BOM: kicad_bom_wizard “%I” “%O.csv” “CSV”
  • Use your own template to generate BOMs: kicad_bom_wizard “%I” “%O.html” “Path_To_Your_Template_conf/Your_Template”

4. User BOM scripts

You might want to add some of the other scripts as well and check if one of them suits your needs better than this one.

The KiCad default BOM generators are quite limited. Luckily the community has made some very powerful plugins.

  • KiCost – A utility that generates a spreadsheet from a schematic filled with the part pricing information scraped from distributors like Digi-Key, Mouser, etc. For each distributor and part, the spreadsheet contains the quantity-dependent prices, available quantities, link to the part page, and ordering codes.
  • KiCad_BOM_Wizard This KiCad plugin can be used to create custom BOM files based on easy configurable templates files. The plugin is writing in JavaScript and has been designed to integrate into KiCad’s BOM plugin manager. Exports CSV, HTML and PDF files. The template files permit customisation of output to include (for example) certification docs, logo etc. KiCad_BOM_Wizard will group and sort all components together that have same parts value, the same starting designator reference prefix and the same fields value.
  • BOMs Away A Component/BOM Management tool for KiCad. Maintains a local database of components and facilitates associating components on schmatic with identified parts. Simply enter a part’s manufacturer, supplier, manufacturer PN, and supplier PN then click ‘save to datastore’. Information is keyed off of component value and footprint, so future uses can simply use the part lookup button to retrieve the information. Multiple suppliers, manufacturers, and part numbers are supported. (wxPython)
  • KiBoM KiBoM is a configurable BOM (Bill of Materials) generation tool for KiCad EDA. Written in Python, it can be used directly with KiCad software without the need for any external libraries or plugins. KiBoM intelligently groups components based on multiple factors, and can generate BoM files in multiple output formats. BoM options are user-configurable in a per-project configuration file.
  • KC2PK KiCad to PartKeepr BOM Tool. This tool, written in Python3, aims to integrate component management using BOMs produced from KiCad and inventory and stock management using PartKeepr. It also includes an Octopart lookup function to check on current pricing, availability and price breaks of components.
  • Interactive Html Bom (demo) tool designed to assist with hand assembling pcbs. Output is viewable in any modern browser and allows user to easily highlight a specific reference or all components in a group on a visual rendering of pcb. Script works both as Pcbnew action plugin and as a command line tool.
  • KiCad JLCPCB BOM Plugin Eschema plugin to produce BOM compatible with JLCPCB SMT Assembly BOM format. Also includes a script to convert the Footprint Position file into the format required by JLCPCB.

Summary

We have learnt how to generate a bill of materials or BOM files in KiCad v5.

Thank you for reading and supporting us.

Libraries:

  • None

Project resources:

  • See attachments on the beginning of this project description.