What MakeDigikeyBoM is

MakeDigikeyBom (GitHub location)  takes the components that are part of a PCB schematic made in Kicad’s eeSchema and creates a CSV file that has the digikey part number information for quantities where the minimum order is 1.  This CSV file can then be loaded into an app like Google spreadsheets.  Here is a the Google spreadsheet that originated from the GrowChamberSensorPuck project (GitHub location):

Reference Value Quantity Manf Part # Digikey Part # 1 10 100 1000 Qty Avail Link
C2 4.7u 1 LMK212BJ475KD-T 587-1297-1-ND 0.18 0.128 0.0602 0.03497 216464 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=587-1297-1-ND
R7 100K 1 ERJ-6GEYJ104V P100KACT-ND 0.1 0.025 0.01 0.00451 547481 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=P100KACT-ND
U1 Si7006 1 SI7006-A20-IM 336-3124-ND 2.08 2.08 1.7372 1.56551 2199 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=336-3124-ND
R5,R6 4K7 2 RC0805FR-07100KL 311-100KCRCT-ND 0.1 0.019 0.0077 0.00345 6051592 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=311-100KCRCT-ND
R4,R1,R2,R3 10K 4 C0805JR-0710KL 311-10KARCT-ND 0.1 0.016 0.0066 0.00297 2786699 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=311-10KARCT-ND
C1 .1u 1 CL21F104ZBCNNNC 1276-1007-1-ND 0.1 0.029 0.0128 0.00718 1026228 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=1276-1007-1-ND
U2 CCS811 1 CCS811CT-ND CCS811CT-ND 15.5 12.65 9.8038 9.8038   http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CCS811CT-ND
R8 NTC100K 1 NTCS0805E3104FXT BC2562CT-ND 1.1 0.86 0.5823 0.43669 17108 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=BC2562CT-ND

I use the Eclipse/PyDev IDE exclusively to run makedigikeyBOM.py.  Yah…This is ugly compared with running python from the command line.  I do this because my skills in python are at an advanced beginer’s level (at best 🙂 ).  I take advantage of the extensive features such as debugging, setting up input, adding tasks… this IDE offers. 

When it comes to Python, I’m just not ready to take my floaties off.

Steps to Get to the BoM CSV

  • Get the Jellybean parts csv file ready.  The Jellybean parts contains categories of parts (like R for resistors, C for capacitors….) that are referenced within a component’s PN in eeSchema (see the example under the next step where the R5 component’s PN=R).  I start with this jellybean parts file.  I download  this jellybean parts file as a CSV file as a start.  I then renamed it JBParts.csv (just a simple name)…More jellybean parts can be added (or removed).
  • Run bom2csv (discussed here) to create the XML file.  The XML file will have the filename of the Kicad project.  For example, the Kicad project I used was GrowChamberSensorPuck (GitHub location).  This means the bom2csv’s output XML filename will be GrowChamberSensorPuck.xml.  The created file contains an XML tree for each component.  The important fields are the ref, value, and PN fields.  These must be filled for each component in eeSchema.  The images below point out part numbers can be either Jellybean parts, manufacturer part numbers, or X (for exclude this component from the BoM).
Example Component Property Dialog Box
NewImage
Example Output: Jellybean Part
NewImage
In the case of this component, it is a jellybean part.  (“PN”<R>). 
 
Example Output: Specific Component
NewImage
This example has a specific manufacturer’s part number.
 
Example Output: Exclude Component
 
NewImage
By saying the name of the part number is X, this component is excluded from the BoM.
  • Set the variables up within the Eclipse/PyDev environment.  As I noted in this post, there are three important user inputs:
    • The full name of the bom2csv file.  In my current example, the full name I will use:

      /Users/margaret/Documents/LettuceBuddyHW/LadyBugHydro/TheHerbSpa/GitHub/Kicad/GrowChamberSensorPuck.xml

    • The full name to the jellybean parts file.  I will use:  /Users/margaret/Documents/LettuceBuddyHW/LadyBugHydro/TheHerbSpa/GitHub/Kicad/JBParts.csv
    • The file folder where the MadeDigikeyBOM.csv will be written. I will use: /Users/margaret/Documents/LettuceBuddyHW/LadyBugHydro/TheHerbSpa/GitHub/Kicad/

To set the variables up, I’ll go into the debug/run configurations within the Eclipse/PyDev IDE:

Pasted Image 2 20 17 5 38 AM

 

NewImage

Then I run MakeDigikeyBOM from within Eclipse.  This creates the MadeDigikeyBOM.csv which I then import into a Google spreadsheet.

 

Well…MakeDigikeyBOM works for now… As I continue to use this BoM creation tool, I am sure I’ll come back to evolving the code and documentation.  For now, if you are interested, look at the code at this GitHub location.  I tried to document the code with ample information to know the intent of each section.

Advertisements