Convert KiCAD BOM to Manual Pick and Place Files

Posted on 2023-04-10
Tags: espresso hardware

When I assemble a PCB by hand, I like to have a list of all footprints and their respective components on hand. My PCB usually has designators on it, R1, R2, and so on, but not the actual component values, in this case resistances, mostly for space reasons. KiCAD can generate a BOM CSV, but that is more focused on purchasing, so components are grouped together by type, and not listed by designator, which makes the lookup tedious. Here I am sharing a small awk program which converts that BOM into a more useful format for this purpose:

    FS = ";"

NR > 1 {
    gsub(/"/, "", $2);
    gsub(/"/, "", $5);
    for (i in desig)
        print desig[i] "\t" $5

This program works as of KiCAD 7, and can be used like so: I'm using gawk because I'm on macOS, where regular awk is BSD awk. On Linux this would not apply.

gawk -f bom.awk bom.csv | sort -V

A full example, on a partial BOM:

$ head bom.csv
"Id";"Designator";"Footprint";"Quantity";"Designation";"Supplier and ref";

$ head bom.csv | awk -f bom.awk | sort -V
C7      100nF
C8      100nF
C15     100nF
C16     100nF
C17     100nF
C18     10nF
C19     10nF
C20     100nF
R1      10k
R2      10k
R4      47R
R14     220R
R15     100k
R16     220R
R17     100k
R18     220R
R19     100k
R20     10k
R21     10k
R22     10k
R23     220R
R24     100k
R25     10k
R27     100k
SW1     SW_Push
SW2     SW_Push
SW3     SW_Push
SW4     RotaryEncoder_Switch
U1      NHD-C0220BIZ