SparkFun Forums 

Where electronics enthusiasts find answers.

Questions relating to designing PCBs
By uChip
#162008
Tips for Creating Components in Eagle CAD

I've now created a couple of dozen components in Eagle and have been using them in my schematics and board layouts. Everything works, but aesthetically my schematics and boards could look better. This caused me to try to learn a bit more than is in the basic Eagle tutorial on the Sparkfun site (I also recommend the Eagle tutorials from RPC Electronics that you can find on YouTube.) I call this posting "Eagle Tips 201" because it is beyond the basics of the Sparkfun tutorial (that one is 100 level perhaps) but still pretty basic. Also note that while I've read a bunch of the Eagle documentation I did not come across a document like this for component creation. The closest I've found is Cadsoft's "Library Management and Part Creation Standard v1.0" but it does not have everything here.

I definitely haven't learned everything but I'm getting better. As I improve I'm finding that I have to go back and rework components that I've previously created and used in schematics. That is a pain because the components get better when I rework the library but the schematics don't. When you use a component the definition is copied into the schematic. If you edit the component in the library the component in the schematic is not updated. You can delete the component from the schematic and replace it with the new one, but this undoes the board placement and routing for that component. Uhg. You can also use the "swap components" tool, but this does not update all the properties of the component (e.g. component name). By having your library organized with well-defined components you will save yourself a lot of work later when you use your components in your schematics and boards.

To try to get better at "well-defined" I want to create a checklist of details and work items that I use to make sure that every component is complete and consistent. I am hereby invoking the old adage that explaining something to someone else will improve my own understanding. I will capture my tips here and try to both improve my own understanding and pass along what I have learned. Plus I am hoping for the payback that others will contribute their own tips or improve on the tips I create.

My workflow for component creation is to 1) create the symbol for the new component then 2) create the package (sometimes I can reuse an existing package) and finally 3) define the device using the symbol and the package. I will therefore organize the tips into the same categories and order.

SYMBOL TIPS

TIP: When creating a new Symbol its name should be as generic as possible.

Description: I'm not so good at this yet. Most of my Symbols are named the component part number. This limits reuse. Think of it this way; how many different JFETs are there that would all be represented by the same schematic symbol? Lots right? So name your symbol "JFET" or "GENERIC_JFET" rather than the component number that you are working on right now.


TIP: Make sure the symbol >NAME variable is on layer "95 Names".

Description: >NAME will get filled in on your schematic with a component designator such as "C23". This identifies a specific component uniquely where a part number or value might be duplicated many times. If >NAME is not on the right layer you may find ">NAME" on your schematic instead of the component designator.


TIP: Make sure the symbol >VALUE variable is on layer "96 Values".

Description: It would be cumbersome to have a separate library component for every possible value of resistor or capacitor. Eagle therefore allows a generic component definition to have a value property that can be edited within the schematic and carried forward to the board layout and BOM. To get the value to show on the schematic, include the >VALUE variable in your symbol definition and make sure it's on the right layer where Eagle will see it as a variable and not just text.


TIP: You can have multiple pins with the same visible name. Use the form name@pinnum.

Description: Sometimes a symbol has more than one pin with the same name. An example of this would be a symbol with multiple grounds. If you just name the pins with the exact same string Eagle will complain. Instead of naming the pins "GND1", "GND2", etc. use the form above where "name" is the part that is the same on the multiple pins and "pinnum" is the package pin number. In our example "GND1" becomes "GND@2" and "GND2" becomes "GND@13". When the symbol is displayed both pins will show as labeled "GND" but you will still be able to tell them apart when you go to assign pin numbers.


TIP: Pins do not HAVE to have a label at all.

Description: Sometimes a picture is better than a label. To hide the pin label from showing on the symbol, set the "Visible" property of the pin to "pad". Note that even though you’ve hidden the pin labels you still should set them to something memorable to make pin assignment easier in the Connection dialog.


TIP: Active low pins can be designated with a bubble-pin and/or by putting a "!" at the beginning of the name.

Description: Putting a "!" and the beginning of a name will cause the name to be displayed with a bar over it (a bar over a name is a common schematic convention for denoting active low). The pin with the circle (bubble) on the end denotes the same thing.

Discussion: Some folks say that you should not use "!" and the bubble-pin at the same time. For example, either use a pin without a bubble and label it "!RESET" or use a pin with a bubble and label it "RESET". The implication is that using both is the schematic equivalent of a double-negative.


TIP: Set the Size property of the >NAME and >VALUE text to 0.07.

Description: This is purely aesthetics, but I don't like it when every component value or designator on the schematic each has a different sized font. Things will look more professional if there is consistency. The choice of 0.07 is somewhat arbitrary. When the font is too small it’s hard to read. This size is just a bit larger than the default size for pin labels.


TIP: Leave the Description of the Symbol blank.

Description: No good arguments for this one yet, but since only devices and packages are shown in the library list and component chooser dialog the text for symbol description seems less important.



PACKAGE TIPS

TIP: When naming a new package for a device, use the name of the package not the name of the device.

Description: This one is probably obvious. Or if it's not, it will be after you've created a few devices. Device creation is a lot easier if you can reuse an existing land pattern (package), so when you create one that does not yet exist in your collection make sure you make it as generic and reusable as possible. You will be glad you did.


TIP: Make sure the package >NAME variable is on layer "25 tNames".

Description: Similar to the >NAME variable on the symbol, the >NAME variable on the package definition will show on the board layout and will identify which of the bazillion bypass caps is at this particular location. NOTE: By common convention I have the component designators on the top side of the board. If you want them on the bottom, move the >NAME variable to layer “26 bNames”.


TIP: Make sure the package >VALUE variable is on level "27 tValues".

Description: The >VALUE variable on the package definition will show the value of that variable on the board layout. NOTE: By common convention I have the component values on the top side of the board. If you want them on the bottom, move the >VALUE variable to layer “28 bValues”.


TIP: Set >NAME and >VALUE variables to vector font.

Description: The tutorials explain that proportional fonts can be translated poorly at fab time. This tip is to make sure your components, which carry their own font attributes, match the rest of your board text.


TIP: Use the Align property to place >NAME and >VALUE where you want them.

Description: >NAME is just a placeholder for a string that might be longer or shorter on the schematic or board layout. Therefore placing the text based on an origin in the lower left of >NAME might not give the best results. Using the Align property you can for example center the text over your symbol or within your package outline.


TIP: Fill in the Description field with info about the package not the component.

Description: Packages are more likely to be reused. Putting only the component part number in the description field of the package will be confusing. Putting only the package name in the description field is redundant. Instead put in information about the package that will aid in reuse. I like to include a reference to where the package info came from in case I need to go back and check whether another part will fit the land pattern or not. Example: "As defined in the TI datasheet for OPA365"


DEVICE TIPS

TIP: Device names are more complicated, but use the most generic name that makes sense.

Description: When creating components like resistors or capacitors using the part number for the name doesn't make sense because every value has a different part number. You are better off naming them generically, for example, "RESISTOR", "POTENTIOMETER", "CAPACITOR_POLARIZED", etc.

For ICs I usually use the manufacturer's part number (or the generic industry part number if applicable e.g. 2N2222). Do not include package info in the device name as Eagle has built in mechanisms for handling that.

Discussion: To keep this simple I've left off the details/tips around creating multiple packages and package variants for a device. 300 level topic?

TIP: Set the device Prefix.

Description: Have you ever wondered why Sparkfun components get names like U1, U2, U3 or R12, R13 on your schematic but your own components are all U$1, U$2? Eagle uses a combination of location on the schematic and a "prefix" to ID each component. If you don't set the prefix Eagle uses the default "U$" everywhere. To take control, click the Prefix button on the Device editor dialog and set the prefix value for your device. The prefix can be any string but here are some common conventions.
  • Resistors, R
    Capacitors, C
    Inductors, L
    Diodes, D
    Transistors, Q
    ICs, U
    Header pins, JP
    Jacks & Plugs, J
    Switches, S
Here are a couple more that I made up.
  • Relay, RELAY
    Module, M

TIP: Set the "Value" radio button appropriately.

Discussion: In the Device edit window set the Value radio button. If the Value radio button is set to "On" the >VALUE variable will be editable in the schematic. Use "On" for devices like resistors, capacitors, inductors, etcetera. If the Value radio button is set to "Off" the >VALUE variable on the schematic will be filled in with the device name.


TIP: Fill in the device Description with info about the function not just the part number.

Description: The part number is likely already captured in the name of the device. In the description field, augment the name with key parameters that will help choose which device when in the component chooser dialog. I also like to include the manufacturer name and the Vendor part number so I can look up more details. Since the device description also carries forward to the BOM, the vendor part number will help you create the parts order for your project. Here are a few examples.

• Module/PCB, uController, 3.3-5V, 8-16MHz, USB, Sparkfun #DEV-10999 (3.3V/8MHz), DEV-11098 (5V/16MHz)
• ADC, 12-bit, 1-channel, VDDref, Delta-Sigma, 2.7-5.5V, I2C, 22.3ksps, Microchip, Digi-Key#MCP3221A5T-E/OTTR-ND
• ADC, 16-bit, 4-channel, 0.05%, Delta-Sigma, 2.7-5.5V, I2C, 15sps, Microchip, Digi-Key#MCP3428-E/SL-ND
• OpAmp, 50MHz, R-to-R, single-supply, CMOS, TI, Digi-Key#296-20645-1-ND

Discussion: The vendor part number will also spec the package so including it on a device that has multiple packages might be misleading or you might have to include multiple part numbers in the description. Uhg. Anybody got a better solution?

I hope I’ve provided at least one tip you did not already know, or collected together in one place a checklist to make sure you don’t miss any of these in your next component design. Or if you are already way beyond these tips, how about contributing some of what you know!

While I’ve tried to make this as accurate as I can, if you see any errors please point them out so that misinformation is not propagated.

Thanks for reading!
- Chip
By qwertymodo
#162016
Just thought I'd weigh in with a few comments
TIP: You can have multiple pins with the same visible name. Use the form name@pinnum.
This breaks the concept of generic symbols, even among different packages of the same exact chip. I'd suggest just name@countfrom1, e.g. GND@1, GND@2, GND@3 etc. it doesn't really matter which GND signal is assigned to which pin, since this naming scheme will have them all internally connected together anyway.
TIP: Active low pins can be designated with a bubble-pin and/or by putting a "!" at the beginning of the name.
You should add that you can also put a bar over just part of the signal name by enclosing the part of the name you want with ! on either end, (e.g. !RST!/GPIO123 will just put a bar over "RST" indicating a pin that is a GPIO or alternatively an active-low reset pin, common for a lot of microcontrollers)


...that's all I could come up with from a quick read through. Lot's of good info, thanks for taking the time to write it all up :)
By pstemari
#172725
Some more package tips:

TIP: Use tKeepout to show the physical dimensions of the part.

This is useful for things like relays, switches, and even electrolytics that are bigger than their pads to prevent parts from bumping into each other. You'll get a ERC warning if two parts overlap. Draw a rectangle or polygon on this layer to reserve space on the top of the board. For things like standoffs, you'll also want to reserve space on bKeepout.

TIP: Use tDocu for lines that cross pads.

If you draw a line in tPlace that crosses a pad, that will make the board unsolderable. tDocu doesn't show up in the silkscreen, so if you break lines at pads and move the segments crossing pads to the tDocu layer, the board editor will look ok and your board will not have soldering issues.

TIP: Add a link to the device datasheet in the description

The description is HTML, and you can use any HTML tag. Throwing in a link to the datasheet saves you time and trouble later on. I like to add the first few paragraphs from the datasheet into the description as well.
User avatar
By Ross Robotics
#172758
pstemari wrote:
TIP: Use tDocu for lines that cross pads.

If you draw a line in tPlace that crosses a pad, that will make the board unsolderable. tDocu doesn't show up in the silkscreen, so if you break lines at pads and move the segments crossing pads to the tDocu layer, the board editor will look ok and your board will not have soldering issues.
Actually not true. OSH Park, Itead, and Seeed will not put any silkscreen on pads. Doesn't matter what layer. When I make my parts for a library, I intentionally put silkscreen on the pads to make sure of the dimensions. The silkscreen never shows up. I usually use tPlace for this purpose.
By pstemari
#181027
OSH Park, Itead, and Seeed will not put any silkscreen on pads.
That's nice of them, but in general I wouldn't count on the fab house fixing the Gerbers for you. Those outfits are marketing to novices and are doing a certain amount of hand-holding. I certainly saw Batch PCB/Gold Phoenix put down silkscreen over pads when I made that mistake, and didn't blame them for it in the slightest.
User avatar
By Ross Robotics
#181035
Maybe back when Batch PCB was around, the software didn't have this feature. Now, the software takes care of elementary errors.
By uChip
#181062
I think that it is fair to say that there should be no printing (silkscreen or solder mask) covering a pad such that it interferes with soldering. As Codlink points out many PCB fab houses today will automatically clip the silkscreen so that the pad is not covered. It may also be true that there are still some houses that do not automatically clip the silkscreen. So, PCB designer beware. You can ensure that you avoid a potential problem by not putting silk over the pads but if you have a legitimate reason to do so and you know your fab house it is fine to violate this tip.

Thanks for the discussion!
- Chip