How to create a schematic component
In the previous chapter we searched for an nRF24 part in the schematic library but didn’t find anything relevant. In this chapter, I will show you how to create this part from scratch.
To do that we’ll use the library editor, this button here brings up the library editor.
To start the library editor, click on the button that looks like a book with a pencil over it.
Click on it and here is the library editor window.
The empty library editor window.
In the library editor window, we will make symbol to represent the RF24 component. Remember that this schematic only so it does not need to look like the real thing. The objective is just to have a symbol that represents the component and especially its electrical connections. As far as Eeschema is concerned, the symbol is the component.
Components like the nRF24 are typically represented as a box. So we’ll create a new part through the part library editor and will start by clicking on the new component button to create a new component.
The new component button.
We’ll give this new component a name. We’ll call it NRF24. We leave the designator like that as a “U” and this package is only going to have a single unit.
The new component properties window.
Imagine that other cases of—for example, integrated circuits that contain logical components like gates, for example, and/or gates and you could have multiple of those gates inside a single integrated circuit.
This component contains 4 units per package.
If you have an integrated circuit with two “AND” gates in them, then you may want to indicate that to the user, so you would say “2” in the “units per package” box.
Click “OK” to close the properties box. In the Part library editor window you can see the name of the new component, as we entered it in the component properties window.
The name of the new component appears in the centre of the part editor window.
We can make use of the same shortcuts as in the main schematic editor window. Because we have two text labels, one on top of the other, we should seperate them by moving them. We can move a component by selecting it with the M key. Put your mouse cursor over the text and type “M”.
Kicad does not know which label I would like to move, so it asks for clarification.
Because there are two labels under the mouse cursor, Kicad is asking me to select which field or which label is it that I want to move. Choose the first one and move that up the top and I’ll take the second label and just move it down here. Center the component where the two lines are intersecting, just to make it a bit more symmetrical.
The two labels are separated.
Next, we will create a frame for the RF24 custom component.
Choose the rectangle button to draw a rectangle.
Choose the rectangle button and then draw the rectangle by adding a line starting from the top left corner of where I’d like the rectangle to be. Right-click there and then drag a line to the bottom right corner where I’d like the rectangle to end.
This rectangle represents the nRF24 component, but without the pins added.
Next, we must add the pins. As you know, the actual RF24 part has its pins arranged in two rows of four pins each. To make this schematic more readable, we will add connectors on one of the four sides of the box we just created, in a single row. There is no need for a one-to-one match with the real actual component – the real life component. Later, we’ll connect these pins to the part footprint which we’ll also have to create from scratch and that will be modelled after the real, physical RF-24.
You can click on the “Add pins” button to add a new pin.
To add pins, you can either click on the “Add pins” button or hit the P key. The pin properties window will come where you can type in the pin name.
The pin properties window.
You should look at the original part pin descriptions so that you can properly name the pins in your custom component. And on the original nRF24 part, “MISO” is pin number four. The orientation is going to be to the right. The pin type should be input and the graphic style should be a line. When you are finished with these edits, click on OK to exit the editor.
The new custom part, not complete yet
In the editor window, you can see the new MISO pin #4 added to the schematic of the custom part. Notice the little dot on the edge of the line? this is where wires will connect eventually to/from other components. This of the dot as the terminal for the pin. The line should be placed so that the dot is away from the border of the box. Also, the number of the pin, in this example “4”, corresponds to the number of the MISO pin on the real part. Consistent numbering makes it easier to figure out which pin is which eventually when you got to connect everything together.
If you want to make a change to this pin, you can just edit like any other component. Place your mouse over it and then hit the E key. This will bring up the pin properties so you can make any changes here.
I have actually just spotted an error: in the real part, MISO is actually pin number three. I am also going to move this pin a bit lower so that there is enough room above it for the other pins.
Here is the current state of the custom component:
The new custom part, current state.
Let’s create the rest of the pins. Repeat the process described above 7 times, so that in the end, you have a schematic like this:
The new custom part, completed
Remember that you can use the M key to move things around and arrange everything so that the component looks symmetrical
Now we need to save this part, but before we can save it, we must choose or create a working library. In Kicad, you cannot have a schematic component on its own. A component must be a member of a library, even if the library contains only a single schematic component.
Let’s create a new library. To save the component to to a new library, click on this icon here, looks like a book.
Click on this button to save the component to a new library.
Next, select the location on your computer for the library. I recommend that you place this library in the same working directory as my project, so NRF-24 breakout, and the naming of the library—let’s call it “nRF24_schematic_library”.
Store the new library within the project folder.
Click on the Save button to finish the process.
The new library and it’s content will not be available until it is loaded by Eeschema. Creating a new library will not automatically load it in Eeschema. You have to explicitly go into Eeschema and add this new library to the list of libraries that it has access to. This is something that people get confused about and the way that the libraries work in Kicad is not very intuitive, to say the least.
And at this point you’ve got a new library and in it you have a new component. You’ve got the NRF24 schematic component. We can get out of the library editor and now we’ll have to add that library that we’ve just created to the project so that we can access the parts in it.
In Eeschema, go to preferences and click on component libraries.
To add a new library to Eeschema, go to Preferences and the Component Libraries
Here, we will add the library that we just created. Click on the Add button, and browse to the location where you saved the new library.
Click on Add to add the new library.
Browse to the location of the new library, and click Open.
Scroll towards the bottom of the libraries list in the libraries editor, and you should see the newly added library.
The new library appears in the bottom of the libraries list.
Let’s drop the new component to the canvas. Press the A key, and search for the library that we just created and here it is. You can drill in it and you can find the part that we just built. Or you can just look for it using the filter. Select the component and click OK to add it to our schematic.
The new component is in the component chooser, from where you can add it to the schematic.
In the next chapter, we will do annotation of the parts in the schematic.Back to top