Library Question, general info


I’m a new user of KiCad, but have a number of years experience of OrCad,Mentor, Altium and other free tools.

Hopefully I can at least report bugs, or provide some advice.

Anyway I’m still getting to grips with KiCad and driving the software. One area which I am struggling with is the libraries.

What I am looking to do is create a personal library for all the resistor values for the E24 range. I have a list of manufacturers part numbers and suppliers SKUs etc.

what I would like to do is create a library for the resistors which reference the schematic symbol R, but have unique instances for each value.

For example, the library has 1 symbol. R

This can be either 1K or 2K, which can be done via the alias function.

However how do I add the additional information to the 1K and 2K resistor.
If for example the 1K has the SKU of 1111 and 2K has 2222 where can I add these so they only need to be added to the library, so they can be used across
future designs?

Many thanks.

I don’t know that there is a single best way to do this at the moment.

The first option is to add those fields using the Symbol Editor.

The second option is to use the Tool Edit Symbol Fields in Eeschema; but you would have to add the symbols to Eeschema first.

ON EDIT: Just remembered that there is a Python Plugin called KiField.

@Sprig I have added fields via the Fields properties editor, which shows for the unpopulated fields for the master part ®. However it will not allow me to edit said fields for the 1K or 2K alias.

Perhaps another approach would be to duplicate R, then edit each of the fields separately. :thinking:

The duplicate method seems to be heading in the right direction.

Is it possible to edit the library file via text editor to create 100 resistors rather quickly?

Exactly. Alias is just another name for the same symbol.

Sure. You can even make a program/script to do so.

All KiCad files are human readable, so it should not be to difficult to do.

Ah right I will have a look into that, rather than using LibreCad.

Would I be correct in thinking it would be the .lib file I’d want to edit?

Sure. File.lib is a symbol library containing as many symbols as you want.

Different from a footprint library where each .kicad_mod is a single footprint and a library is a folder with the extension .pretty.

Note that the .dcm file (with the same name as the .lib one) contains metadata related to the lib file. You must manage both of them if you want to add / remove symbols in the lib file.

1 Like

@Efcis Thanks for pointing out.

I’ll see how I get on.

One alternative to doing everything within kicad is to use a house part number (or whatever you want to call it).

This would alow you to be flexible should a particular partnumber be discontinued or temporarily unavailable. (The general idea here is to encode only electrically relevant parameters in this identifier. Allowing decoupling between electrical engineering from the politics of sourcing parts.)

An idea would then be to construct that number somehow logically from the value possibly allowing for a placeholder that is then filled from the value field by a purpose build bom script. Doing this will greatly reduce the number of symbols you need to have in your lib.

1 Like

I think the inhouse/generic part numbering is the way to go.
Then I can just used a lookup on the exported bom etc.

Also I can have a single library and just assign footprints at point of build, rather than 1 lib for 0603 1 for 0402 etc.

I simply have a few symbols for resistors with partly filled out house part numbers. (only missing the resistor value that i then fill in manually as i was not motivated enough to write a script for that)
I have one symbol for 0603/1%, one for 0603/0.1% and the same repeated for 0402 and 0805. (I thought about adding 50/75V versions as well but simply decided to exclusively use 75V in my systems as they are not that much more expensive and it reduces the amount of stuff i need to have lying around. Power rating is connected to resistor size so does not really need a parameter either.)


So I have copied a single R into a personal library (from the Device library within KiCad).
When I select Edit Field properties, I can only edit the reference, which if I update to R123,
becomes R123?

When annotating would become R1231, R1232 etc.

However how do I duplicate this part numerous times, but with the value changing.

for example I want an number of resistors all with the reference R?, but the value and part number change:

One resistor of value : 1K Part number:1001
Another resistor of value 2K Part number:2001
Another one with the value 3K3 Part number;3031

How do I achieve this within KiCad?

Many thanks,

You are kind of misusing the reference designator. It is a unique identifier for the component on the current board not an identifier for your ordering system. For that add separate fields.

I have been spending a few days on this myself. I am sorry to say that you will have to create unique parts.
So the reference is the current schematics reference, leave it alone, it generates the R1, R2, R3… for the schematic and is nothing to do with part properties. You then have the Value, this is what you can edit and this is what by default shows on the schematic.

So i started creating aliases but this soon did not work because the value is the thing that identifies the base symbol, is the alias and is what you see listed in the library picker and is what shows up in the schematic and should be human readable as a resistor MPN is pretty useless.

So this is what I am doing. i am creating unique parts for everything. I am using the “value” field as the thing I want to look for on the library picker list and is the only thing I can search for in the pick a part box. So I use a short descriptive code like 1K_0805_1%, or 100n_25_0805_X7R, this way i can find parts fast.

I have created seperate MPN and Display fields and i have hidden the value field as I don’t want such long names on my schematic. This way I can see what I want on my schematic, call it what part number i want and know what it is and search for it with ease.

I am just living in hope of finding that I can have my custom fields show on the BOM which I m sure is possible.

I had to do a similar thing in circuit studio, it’s not a problem unique to kicad.

Resistors and ceramic capacitors are pointless having MPN’s, use a code of your own like mine that a board assembler would find easy to deciper. i have a whole real of ceramics on order at work. I constantly get revised delivery dates that range from 6 to 18 months time. Specifying a ceramic cap or resistor part number means that your design can never be built in the current climate of part shortages and factories now turning down orders. If i spec a part on a design at work i order a whole real of the things at prototype stage to make sure I can still make production orders. Reels of resistors that used to cost £5 are now £15 if you can get them.

I have used such technic till now. But with KiCad I will use shortly I plan to do it differently. I will have one library with one resistor 0603 with many aliases. Then second libarary R1 (1 because 1mm) with 0402 resistor with many aliases, then next library R2 (2mm) with 0805 resistor with aliases. Then the value+footprint will be used to select exact element for BOM (I use spreadsheet for it). Few years ago we decided to use only 1% resistors just to make everything simpler.

@Rene_Poschl thanks for the info. I understand the referemce designator being unique, R1 R2 can both be 1K Values.

How do I create 2 resistors with a library, which use the same symbol. 1 with the vlaue of 1K and the other with the value of 2K.

I have added addition fields for the unique inhouse part number.

@Piotr @Sparky_Labs Thanks for that info probably something I’ll adopt. Using a mixture of valure and tolerance.

Depends on what exactly you want to do. You can use aliases for this but they are very limited right now. (The only BOM related thing that can differ between the alias and the main symbol is the name/value.)
If this is not enough then simply duplicate the symbol and do it that way.

Ok, so it looks like the method to use at the moment is to duplicate the symbol.

I’ll place the resistance as the name and then used an additional filed to list the in-house part.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.