Creating Custom Components in LibrePCB: A Step-by-Step Guide
LibrePCB’s default library doesn’t always include every part you need—think nonstandard connectors or ready-to-use modules like DC-DC buck converters. Building your own component solves this gap. The process involves editing your local library via the Library Manager and working across six key sections: Component Categories, Symbols, Components, Package Categories, Packages, and Devices. The first three define how the part appears on your schematic; the latter three govern its physical layout on the PCB.
Organizing Categories
Start in the Library Manager: create a new local library and switch to edit mode (Ctrl+N to add new items).
For a DC-DC module, create a new category named _Modules_—distinct from standard groups like transistors or resistors. Leave the Root category field blank to place it at the top level. After saving, wait for the library to fully reindex—this step is mandatory before proceeding.
Similarly, create a _Modules_ category under Package Categories to group footprints for board-level placement.
Designing Schematic Symbols
Under Symbols, select your _Modules_ category. Use the built-in schematic editor to draw a clean, grid-aligned representation: sketch a rectangle with labeled input/output pins (e.g., VIN, VOUT, GND) and descriptive text. LibrePCB validates pin connections and suggests fixes if inconsistencies are detected.
For a typical DC-DC module, use a simple outline with clearly marked power and ground terminals.
Building the Component and Footprint
A Component links your symbol to a specific real-world device. Name it descriptively—for example, "DC-DC Module 5V". Multiple variants (e.g., different output voltages or current ratings) can share the same symbol but live as separate entries here.
In Packages, define the physical footprint: place pads precisely using measured module dimensions. Grid units can be set in mils (1/1000 inch) or millimeters.
Standard pitch values include 100 mil (2.54 mm), 50 mil, and integer multiples. For Chinese-sourced modules, millimeters are often more intuitive—avoid awkward conversions like 787.4 mil; round instead to 750/800 mil or 20 mm.
Measure hole-to-hole distances with a ruler, then convert:
- mm × 39.37 = mil → round to nearest standard value.
Example Perl conversion script:
#!/usr/bin/perl
print "Enter mm and press ENTER:\n> ";
while(my $str = <>){
if($str =~ /([\d\.]+)/){
my $mil = $1 * 39.37;
printf("%.02f -> %.02f\n", $1, $mil);
print "> ";
}
}
Finalizing the Device
In Devices, create the final, usable part: assign it to your _Modules_ category, link the correct symbol and package. Once saved, the component appears in the schematic editor—and auto-placed on the PCB with its exact footprint.
Example: For a relay, choose category _Electromechanic devices_, assign the relay symbol, and pair it with a mil-based footprint (measure in mm first, then convert).
Key Best Practices
- Build a clear category hierarchy:
_Modules_works well as a top-level category for pre-integrated functional blocks. - Always wait for full library reindexing after any library change.
- Prefer mils for precision in imperial designs; use mm for metric modules.
- Validate symbols and footprints for errors directly in the editors.
- A completed Device seamlessly unites schematic logic and physical layout into one reusable component.
— Editorial Team
No comments yet.