Component

The next element you need to create is the component for a single OpAmp. Because it is still very generic (beside the LMV321LILT there are many other OpAmps with exactly the same functionality), you should enter a generic name like Single OpAmp.

Open New Library Element  Component, enter the name and assign the component category we created previously:

Create component

Set Properties

After clicking on Next you’re asked to specify some properties of the component:

Schematic-Only

Check this if the component must not appear on a board, but only in the schematics. This is typically used for schematic frames.

Prefix

When adding the component to a schematic, its name (designator) is automatically set to this value, followed by an incrementing number. So if you choose the prefix R, components added to a schematic will have the names R1, R2, R3 and so on. The prefix should be very short and uppercase.

Default Value

In addition to the name, components also have a value assigned to it, which is typically also displayed in the schematic. For example a capacitor has its capacitance (e.g. 100nF) set as its value. When adding a component to a schematic, its value is initially set to the value specified here. The value can also be a placeholder, for example {{MPN}}, {{DEVICE}} or {{CAPACITANCE}}. If you are unsure, just leave it empty, the component editor will help you to assign a value later.

Set component properties

Add Symbols (aka Gates)

Now you need to choose the symbols which represent the component in schematics (also called gates). Most components have only one symbol, but you can also add more than one, for example an OpAmp could have separate symbols for power and amplifier. In our case, select the Single OpAmp symbol we created previously:

Add component symbol

Don’t forget to click on the + button after closing the symbol chooser dialog. Then click on Next.

Add Signals

The next step is to define all so-called signals of a component. Signals represent the "electrical interface" of a component. For example a transistor consists of the signals Base, Collector and Emitter. For a component it’s irrelevant whether the "real" transistor has multiple emitter pads, or an additional thermal pad and so on — the component only specifies the three electrical signals.

LibrePCB automatically extracts the signals from the pins of the specified symbols, so often you don’t have to do this by hand. But sometimes you still should adjust the names or properties of these signals. For our OpAmp, we check the Required checkbox of all signals to ensure the ERC will raise a warning if these signals are not connected to a net in the schematics:

Component signals

Connect Pins To Signals

These signals now need to be assigned to the corresponding symbol pins to create the connections. But since they were automatically generated from the pins, you can just click on Automatically assign all signals by name:

Component pin-signal-map

Component Editor

After clicking on Finish, the component is complete:

Component editor

For our simple example this procedure might feel a bit complicated. This is due to the broad flexibility of the LibrePCB library approach which will save time in the long term due to high reusability of library elements.

The component which we created uses only very basic library features, but as soon as you understand the library concept in more detail, you will be able to easily create much more complicated library elements. We’re sure you will learn to love the flexibility of the library concept step by step.

Recommendations

Following are the most important rules to create reusable components:

  • Create generic components whenever possible. Only create specific components for manufacturer-specific parts (like microcontrollers).

  • Generally name signals according their electrical purpose (e.g. Source, Drain, Gate).

  • Don’t add multiple signals which are considered as connected. Even for a microcontroller which has multiple GND pins, the component should have only one GND signal. Keep in mind that a component represents the electrical interface of a part, not the mechanical!