My KiCAD component database

Hello, everyone

About half year ago I have created a KiCAD database library for my hobby use and I want to share it. Maybe someone will find it useful and would like to create their own database or modify their own library.

Before it I just had an excel spreadsheet where I had stored information about the components I have and just used symbols and footprints from KiCAD, and add internal part number “#ID” to KiCAD component and used “lookup” excel function to fill all the other information when I extracted BoM from KiCAD. Although it was quite efficient because for most of the components I could just find symbols and footprints from KiCAD library, because I was using DB library at my work, I thought maybe I could make one for my hobby and use it instead of excel.

Excel Component Library:

Added component ID number from DBLib:

Extracted and Modified BoM:

Now I will tell you about my database library:

To create a database library I had created a dummy test library to test how it works. Then I created structure of my library.

For the structure I wanted to have several libraries in my database separated by the type of components for easier search. The libraries looks like this:

Then I needed to find out what columns I would be needed for the library. Most of the columns I have just transferred from my Excel component list and added a few. There is the list:

After that I created a database using SQLiteStudio (Instruction how to do this will be added to Github together with an example database library). My created database looks like this:

After that I had to setup my KiCAD for the database by adding new Environmental variables, setup symbol and footprint libraries and adding database to symbol libraries. I had added Visible marking in symbol libraries so that I only could use database library in project or Power Ports:


I have designed already 5 small projects with this library and I like how it turned out. There is what I have noticed using database library:

Database library pros:
• No need excel component sheet, everything is stored in database and visible directly in KiCAD
• If I find a mistake in a component information, I just need to fix it in database and update component from library in KiCAD
• Re-using component is very easy and fast
• Easy to search what component you have and can use for a project directly in KiCAD
• Attach symbols and footprint to several to several components are very easy, just copy-paste footprint or symbol name
• Easy to setup to use across several PCs or sharing library in a team (I use several laptops and just using GitHub)
• Database columns can easily be added and removed to adjust the user’s needs.
Your component can store a lot more information and it is easier to manage

Database library Cons:
• It takes some time to setup the library (for me it took about a week of work to create library structure, setup the library, transfer there all my components to it)
• When adding a lot of new components some things can be missed and noticed only when you use components in the project. Like wrong symbol or footprint name and no footprint is displayed for a component. However it’s easy to fix.
• Adding new components is not as fast as just copy-paste a resistor in a project and change a resistance value. You need to open database and add new component.
After adding new components or modifying in existing ones in a database, you need to close the KiCAD and reopen it.

Other concerns:
Q: what if I want to share my projects without sharing whole database library?
A: Create a copy of a project folder, that you want to share, then use “Export Symbols to new Library” and “Export Footprints to new Library” functions. In addition you can use “Archive 3D Models” plugin which exports and all 3D models and links them to new local footprint library. Now all project components are linked to a local project library within a project folder.
image

Q: What if I do not want to have one footprint for a component, for Example I can use THT electrolytic cap standing or bend component.
A: Just add Footprint Filters column to the database and add footprint later in a project which is filtered to display only suitable footprints.
image

Also, I want to thank the Official KiCAD Librarians as well as everyone that are contributing to the library, you guys are doing amazing job and saving hundreds of hours’ time for me and other developers.

And also I want to thank for AKL (Alternative KiCAD Library) creator Dawid Cisło for creating amazing library. I am using your component footprints and symbols a lot and they are great :slight_smile:

Most of my components symbols and footprints are either modified from Original library or AKL library, but some of them I create myself.

I added my instruction how to setup a library and my example database library to GitHub, with all the files:

Of course all criticism is welcome and I would like to hear your thoughts about it and other ideas, thanks :slight_smile:

20 Likes

This looks amazing! Thank you for making such good documentation to get this thing going.

1 Like

Glad if it is useful :slight_smile:
Thanks!

Amazing work because I’m currently making the switch from Altium to Kicad. If I may ask:

In your Global Libraries dialog you have both the database library (kicad_dbl) and the schematic symbol libraries (kicad_sym) (and I guess footprint libraries as well).

Do the kicad_sym files need to be added to the Global Library dialog as well or can those be left out for the kicad_dbl to find them?

With AD we’ve been following the One Symbol / File approach, this doesn’t seem to be useful in Kicad because you’d need to add all of those to the Global Libraries if they need to be added.

Is it common to put the symbols for a group (e.g. Passives) into a single file? Or all schematic symbols? What would you recommend?

Thank you

1 Like

Glad if it helps you to create your own DB.

In your Global Libraries dialog you have both the database library (kicad_dbl) and the schematic symbol libraries (kicad_sym) (and I guess footprint libraries as well).

Yea, as far as I have tested you need to add all the Symbol and Footprint libraries as your global libraries (I have not tested with local libraries). It is because your database will reference to those libraries.

Do the kicad_sym files need to be added to the Global Library dialog as well or can those be left out for the kicad_dbl to find them?

As far as I know, you need to add all symbol and footprint libraries that you want to reference to in your database. However, you can select that all the libraries except database library would be not visible, so this way when you will search for component in your project you will see only components from your database.

image

Is it common to put the symbols for a group (e.g. Passives) into a single file? Or all schematic symbols? What would you recommend?

I think it is common. Official KiCAD library have Device Symbol library where there is placed capacitors, resistors and other common symbols. I have separated passives into Psv_Resistors, Psv_Capacitors, Psv_Inductors and Psv_Other. This is because I like to add package to those symbols. I use separate symbols for 0402 resistors and 0603 resistors. I like this because this way I have more information on the schematics.

It more depends on how you like your schematics to look. I have worked with libraries where all the components are added into one library and after a while, when there are a lot of components, that library becomes quite messy.

I have separated my symbol libraries into:

  • Diodes
  • Transistors
  • Active_Other (Diacs, Triacs etc.)
  • Connectors
  • Integrated_Circuits
  • Modules
  • Oscillators
  • Switches
  • Devices (LCDs, Buzzers, Microphones, Antennas etc.)
  • Capacitors
  • Resistors
  • Inductors
  • Passive_Other (Fuses etc.)
  • PCB_Components (Testpoints, Mounting Holes etc.)

This seems to be working for me. Feel free if you want to do something similar. If you have any other questions I am glad to help :slight_smile:

3 Likes

Thank you, great detailed response. I’ll try to implement it the same way.

1 Like

Just wanted to give some feedback. I have successfully transferred our Altium library to a Kicad library. Also, the sym-lib-table and fp-lib-table files are generated automatically from the available files.
That’s pretty cool.

2 Likes

You don’t need separate symbols for 0402 and 0603. Just add field and put in symbol
Screenshot 2024-11-21 143204
See: the isolation working voltage is done using field. But with specified color and placement (autoplacement is disabled for this field).

Also, you may want to add marker field for SMD components
Screenshot 2024-11-21 143714

2 Likes

Glad it works for you :slight_smile:

Yea, you are right, I just like to have all my symbols with the same fields and no additional fields, but thats just my internal symbol rules.

Great idea about component marking parameters :slight_smile:

I’m not advanced enough yet to import a library but I can appreciate its usefulness. Eventually I will work with it for certain. I’m not sure if I’m just old but we used to call caps “Axial” and “Radial”. Not sure if that helps or if I just look like a jerk. :innocent: Keep up the good work!