Making a good BOM is not simple

I can see that making a good Bill of materials BOM is not valued enough. It is not simple fire and forget script. In a commercial CAD I once used, Bom function was highly customizable and there were a lot of field names, and export options.

1 Like

I understand.

Parts library should also be flexible.
I’ll give files from Kicad elsewhere, and they have to be able to buy those parts too. Then there is JLCPCB with their parts list.
And then hobbyists, I have made those boards, too.

I should not comment much, or we are copying an old CAD I was using, but a part library entry and BOM are related. If there are no “Manufacturer” field, there is not much to put in the BOM “Manufacturer” field.

As a compromise: How about JLCPCB specific part library and bom? Not for my paid job, but JLCPCB have exact instructions about BOM and production documents.

This is an old question. For a hobbyist it does not matter what is in the Bom, or if there is no a parts list. But if you work somewhere where there is a sourcing department/buyers, generic part is not good. Byers do not know about electronics, so they don’t have to know what is a generic part.
KiCad should should be suitable for both hobbyists and paid work. I understand that people don’t want something in their schematic, and every serious user should make his or hers own parts library anyway and BOM to match too. That’s why there should be some official libraries and BOM tools, to show how they should look like.

JLCPCB is a useful PCB manufacturer, I don’t care who uses their PCBs, but supporting them would help hobbyist, and serve as model for others.

And we once had a long discussion, whether we should use one library component with different values, Like Tesla resistor manufacturing SMD resistor 0603 model 12345 and let values tell which resistor to use, but then we made each value a separate entry.

Kicad can do several flavors of BOM’s. And, user can Tweak the .PY file that’s used for it.
BOM’s can be done from PCB and from Eeschema but, they are different beasts.

Try this:

  1. Decide what you want in the BOM (naturally, it’s based on the Data/Fields in the Symbol/Footprint.

  2. Review the various .PY files in Kicad and discover the Keywords/etc for them (also look at the BOM exported from PCB).

  3. Tweak the .PY as needed and save with new Name.

I have a few I did and my favorite is HTML followed by CSV (that I further customize in LibreOffice’s spreadsheet app).

You’ll need to discover how to implement it’s use (pretty easy but, not necessarily clearly understood).

Thus, for your amusement, my HTML version attached (I hacked it from a stock one)
Screenshot of some code and the actual file…

My_bom_html.py (3.0 KB)

The Result shown in Firefox

Not bad. Then I wish libraries would be neat, so that something like could be made. (That is: do your own libraries)
One question, How is this add on? used. Where to put it, and how to start it.

You’ll need to do some homework to clear-up any confusion but, basically, here’s the scoop on BOM’s:

BOM, from PCB editor: Fabrication_Outputs> BOM

BOM, from Eeschema: Tools>Generate_BOM

Put the file I posted in the folder called: SharedSupport>Plugins (finding it is part of your homework).

If the folder contains a file called “kicad_netlist_reader.py” then, all should work…
(when you’ve Quit and Re-started Kicad, then, arrive at the Panel (via clicking Generate_BOM), you should see the File you placed in the Folder. Select it and OK, it will make the BOM and put it in the Project’s folder.)

I agree that making a good BoM is a complex task. And this isn’t a KiCad problem.

KiBot can be used to generate HTML, XLSX, CSV, TSV and TXT BoM like this or this. Note that these examples where generated without configuring KiBot, in fact KiBot generated all these BoMs. You have a high degree of configurable stuff on KiBot and we are open to add more options.

KiBot currently works on CI/CD environments (like GitHub and GitLab) and on Linux systems. Running it on Windows is currently tricky (you must install WSL).

Generating BOM should begin with making good part libraries. I have began to think that every user should do his/hers own part libraries. And BOM generator should be able to use data in those. It should also be possible to have some useful or meaning names data fields, Field1 Field2 and so on, are silly.

It should be easy to import data data from official (KiCad ) part library, and from libraries from other sources.

I haven’t actually used the BOM scripts which come with KiCad (because editing them didn’t have enough ROI compared to just exporting BOM from Pcbnew and editing it with LibreOffice), but I think those field names in some script were just examples, and the script was meant to be customized.

Of course it’s not good usability, and a flexible GUI which is still simple enough that it can cover most use cases is needed, and the need is known to the developers, and is in plans. But as you know, there are n plans and n^2 needs and only a handful of developers. You (anyone) can try to design an easy to use yet flexible GUI and show us what it looks like.

KiCad provides the flexibility to create your own field names in EESchema. Check the preferences for “Field Name Templates”. Here you can create your own custom fields that will apply to all schematics after you define them in preferences. Here I made 3 dummy names to demonstrate:


Then you should be able to write (or customize one of the existing) Python scripts to use these field names in addition to the defaults when generating BOMs.

Yes, this requires you to do the customization yourself, but it should only need to be a one time thing.

Yes, and there are some common names used by tools like KiCost (integrated in KiBot). But this is very personal. I always suggest users to use separated fields for things like tolerance, power, voltage, current, etc. You can join those fields in the BoM and you get more flexibility in the sorting and positioning of these values. But some people doesn’t like it, is just a question of preferences.

1 Like

I typically put an internal part number (IPN) in my schematic symbols, and then create a spreadsheet to cross reference IPN to MPN. Then I can do anything I want – change sources, multiple sources, etc. Also created GitPLM, which is a tool that takes a KiCad BOM, combines with spreadsheet, and then outputs a BOM with MPN. This is working very nicely for current projects (team of a couple engineers).

1 Like

What to put in the schematic? I agree that not every bit of info is usefull visible in the schema. But part library is a different. To me it needs ordering info for others to use.

Very nice job with your tools – first I’ve seen your project. I added a link in the GitPLM readme so I won’t lose track of it.

Indeed, we are all reinventing the wheel! My attempt https://github.com/Gasman2014/KC2PK
linked to the MySQL backend database behind PartKeepr and used Octopart to get pricing and availability - until Altium bought out Octopart and changed the API. One day I might rewrite it for the new API.

I am working now with the bom generation from kicad project and reading the requirements for pcbway. It’s a little confusing as for example the description of required fields in here does not 100% match with their provided example BOM file.
https://www.pcbway.com/assembly-file-requirements.html

To be able to create the PCB, they need this info.

  1. “Item #”
  • value: line number: 1, 2, etc
  1. “Designator”
  • value: C1, C2, R1, etc…
  1. “Qty”
  • value: 1, 2, etc
  1. Package: (Is imperial allowed, is metric allowed, etc.)
  • value way 1: Capacitor_0603_1608metric
  • value alternative metric way: 1608
  • value alternative imperial way: 0603
  1. Type:
  • value: SMT, PTH, DNS/DNP(Do Not Stuf/Do not place)

And to be able to also assembly the board they will in addition need these fields:

  1. “Manufacturer”
  • Value: ST, ROHM, Mura, etc…
  1. MPN: (Manufacturer part number)
  • value: FTS-101-01-L-D, etc.
  • Empty field to allow fab to select generic part from multiple manufacturers?
  1. DPN1, DPN2 (Distributor1 part number, Distributor2, etc…)

But I think that only the values for fields number 1-3 (line number, designator and quantity) are schematic specific information.

Values for all other fields like Package, Type, Manufacturer, MPN, DPN1, DPN2 (fields 4-8) are clearly PCB manufacturing specific and are determined, specified and saved during the PCB placement and routing phase when assigning real footprints and components to schematic symbols.

So my question is that could KiCad use same BOM tool both from the schematic editor and pcb editor? If only the schematics are done, then not all of the information would yet be available unless there is a way save some of those fields to some type of shared data that is available for editing and reading for both of these tools.

I mean that values for fields like “package”, “type”, “mpn” and “dpn” could come automatically once footprints and manufacturing info have been assigned to symbols in PCB editor instead of manually specifying them to table in schematic editor.

I have made so many PCBs that I forget other ways to use a CAD. To me, every library part should have full info, that is, also your fields 6-8.

It’s not the KiCad devs job to take care of fabrication houses. JLCPCB (and other manufacturers) can take care of themselves well enough. All the instructions to generate the BOM and CPL files to their requirements are written up on their website. For a few jobs it’s easy enough to do manually. JLCPCB is one of the easier ones since they just require a single part ID starting with C which you can find on the LCSC site. For more automated workflows others have written plugins and scripts. Eventually some of those will get widely used.

PCBWay does not have as simple a scheme as JLCPCB because they don’t have a sister company like JLCPCB has LCSC. So they require more information for their buyers to find suitable parts for you. Partly this is a problem that PCBWay has to solve, to make things easier for job submitters. Partly this has to wait for a future KiCad version to acquire the capability to connect to databases so that it becomes easier for people to develop tools to accompany KiCad.