Designing an Eagle Part Library

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

owel

Well-known member
Joined
Jun 3, 2004
Messages
1,088
Location
Nashville, USA
This is my workflow when designing a new Eagle part library.

I like to buy the part beforehand, if possible. This gives me the chance to touch it and visually inspect the part and verify that the part dimensions match the working drawings from the manufacturer. 

If working drawings from the manufacturer are not available, I use my digital caliper to make detailed dimensions of the part outline, and pin spacing and pin diameters.

If official PDF working drawings/datasheet are available, I use it though. Trust, but Verify.

Today, we're creating an Eagle part library for a switch.

Opening the datasheet, we look for the part dimensions.
4836218483_111ff83ee5_o.jpg


In this case, we also take note of the switch positions, to see which terminals are connected depending on the switch position (up or down).

4836218489_2a9e9c48f5_o.jpg


Next step is creating the schematic symbol for the part. In this case, an SPDT switch. 

We also add "pins" to the schematic symbol. I use a "point" when defining pins on the schematic symbol.

I also like to match the "pin numbers" with the actual pin numbers used by the manufacturer.... makes life simpler.

4836828722_e4d614dbe1_o.jpg


Next, is creating the physical outline of the part. This is the FUN part for me. I like to make the part looking as authentic as possible. We also take care that we're following the part dimensions specified by the manufacturer. Don't forget to check pin spacings, and most importantly... pin DIAMETER.  Since the PCBs will have plated through holes, I make the pad diameters  just a hair-thin slightly bigger.

To make working easier, make sure to set your snaps and grid to 0.05" square, and 0.01" for the fine grid spacing.

And make sure holes/pads are centered on each "snap."

4836828746_c36bc30b9a_o.jpg


Make a print out your part and overlay the real part against your "printed part outline." Check if the holes, dimensions are correct and aligned.  You may need several passes to get this right if you don't have official working drawings and just relying on caliper measurements.

If everything looks good, then we proceed to the next step.

Now, we tie together (match) the pin#s we created in the schematic symbol with the actual pin#s in the part outline.

This is also a good time to enter a part description field. I try to include Mouser or Digikey part #s in the description.

4836218549_807ae7408a_b.jpg


Next step is I try to use the new part library in a test schematic.

I want to verify that when I connect other components to this new part, that the correct pins correspond with the PCB design.

This is a good time to catch any errors you've made in pin-matching.

Here's our test schematic. R1 is connected to terminal #1 of the switch, R2 connected to terminal #2 and R3 connected to terminal #3.

4836828788_365240a7fe_o.jpg


Then we switch to the Board Layout view and verify that it's correct.

4836218685_0ea5023b57_o.jpg


And we see that everything is OK. The pin #s in the schematic match the pin#s in the board layout.

And we're done.
 
great tutorial! but don't forget to add a prefix for your part otherwise your BOM and part numbering will be screwed up.
 
Ahh yes. Thanks for the reminder.

In Eagle, the text ">NAME" and ">VALUE" are special.  Eagle will substitute these text with the actual part name and part value in your schematic. 

So in the symbol editor, let's add these text.  Put the ">NAME" in the NAMES layer and put ">VALUE" in the VALUES layer.

4837347583_5e73ab835a_b.jpg


In the Device Editor, click the Prefix button.  Enter a prefix text. 

4837352753_cd67f006e6_b.jpg


Since this is a switch, we could use the prefix "SW" or "S". Now when you add multiple parts in your schematic, it will be renamed "SW1", "SW2", "SW3".... (Of course, you need to have ">NAME" present in the symbol, see step above.)
 
A couple of hints to add to Owel's nice tutorial:
- Don't forget to use the MARK tool to make your life easier.  Add a new zero wherever you want to have a dimension referenced.
- Don't be scared to use the command line.  Placing pads for complex parts by exact location is often the best.  You can even put round parts into eagle using polar coordinates.
- Put some of the part silkscreen on the tPlace layer, but most of it is for reference only, so put it on the tDocu.  This is a good way to keep silkscreen off of the pads.
- For parts like the switch you can make several symbols to represent the entire part.  This lets you add the ground terminals as Add=Request so that you can connect them if you need to, but they aren't cluttering up the schematic if you don't.  Also good for dual switches.  If you use the same symbol for both decks, then you can use the Gateswap tool to make routing easier. 

I'm sure I'll think of a few other things to add later. 
 
Great tips from Brad!  So that's what the MARK tool is for. I learned something new. Thanks!

Other tips to add to this list:
- The Description field can also accept HTML tags. You can format the description for a nice output.
<b> for Bold, <i> for Italics,
line break, <p> paragraph break, and you can even put <a href> tags to link to the manufacturer's website or PDF datasheet.
- If you want Eagle to avoid some areas of your part (or your whole part) with copper fill (for example, during a ground plane fill)... mark the area's outline using the polygon tool. Then do a Change Layer and move this polygon to the "tRestrict" or "bRestrict" layer.  tRestrict = Top Copper Restricted Area; bRestrict = Bottom Copper Restricted Area
- You can use the "i" icon tool to access any object's information or properties (be it a line, hole, pad, part, etc). You can enter X,Y coordinates, change pad shapes, pad diameters, hole diameters, rotation, etc.
 
I usually find it easier to MODIFY an existing part.  What I do is "save as" the library with an X added to the end (i.e. resistor > resistorX), then make the modifications to the part, and save the library.
Best,
Bruno2000
 
thanks for the tips.... I am getting into eagle ever since my work laptop crashed. I was using proteus before which had a ton of part lib.  Eagle is much simpler.
 
owel said:
Great tips from Brad!  So that's what the MARK tool is for. I learned something new. Thanks!

Other tips to add to this list:
- The Description field can also accept HTML tags. You can format the description for a nice output.
<b> for Bold, <i> for Italics,
line break, <p> paragraph break, and you can even put <a href> tags to link to the manufacturer's website or PDF datasheet.
- If you want Eagle to avoid some areas of your part (or your whole part) with copper fill (for example, during a ground plane fill)... mark the area's outline using the polygon tool. Then do a Change Layer and move this polygon to the "tRestrict" or "bRestrict" layer.  tRestrict = Top Copper Restricted Area; bRestrict = Bottom Copper Restricted Area
- You can use the "i" icon tool to access any object's information or properties (be it a line, hole, pad, part, etc). You can enter X,Y coordinates, change pad shapes, pad diameters, hole diameters, rotation, etc.

tRestrict and bRestrict layers can be drawn on directly as well.  You don't need a polygon as long as you close the loop with wires or use the circle tool.  (ie for around holes)

You can draw directly on the stop layers as well to make an area without soldermask. 

 
Back
Top