Wednesday, June 20, 2018

9mm POTS--creating an Eagle Library

(Advanced warning: If you don't use Eagle for schematic/PCB/gerber creation, this post will mean zilch....You have been warned....)

 I bought some dual concentric pots from Small Bear and needed it in the PCB for a few projects.  I couldn't believe I couldn't find an existing library (Alps?  Bourns? Adafruit?  Anyone?) that already had this part--this is super simple, just an array of 100 mil traces with proper spacing and some kind of tName silkscreening that works….but I couldn't.  Time to roll my own....

To summarize the very basics:  Eagle libraries have 4 components that all have to be created and linked properly to work in a useful library

Library: a set of devices.
Device: the entire component--a joining of a Package and Symbol
Package: what goes on your PCB.  Traces/drills etc. must be right or your part won't lay onto the PCB correctly after you fab.  I have also seen this called "Footprint".
Symbol: the image that goes on your schematic.

There are so many pages about creating Eagle libraries that I won't go into it here. Here is a good webpage link; here is a good vid.  This was my first attempt at creating a library--and if I can, you can.  It really isn't hard at all.
But I figure it might be worthwhile to mention what I got stuck on, maybe it will help you, or maybe it will help me in 4 months when I forget all of this.
Why can't I edit a @$%^ library?  What comes with Eagle is "read only". Assuming you're modifying library content that came with Eagle--it's way easier to modify something vs. starting from scratch--you have to make a copy of the source lbr file and copy it somewhere else. Then point your Eagle prefs to the new library location.  

It's described here and here--yes, you have to do all this. 

I got somewhat confused when I read instructions that you "import" libraries--what web tutorials really seem to mean is just copy the damn library somewhere else--then you can edit it.

Where are the libraries that come with Eagle?   For windows 10 they are here:
C:\Users\[username]\AppData\Roaming\Eagle\lbr. You may have to enable hidden files and folders in Windows to see this at all. Search for the library you want in there and create the copy somewhere else. Now you can edit the latter.

For other OS's?  No idea.  Sorry.  I am pretty good with Linux and Mac as well, but have never gotten round to using Eagle in either. If you have that information (I am too lazy to look it up) please add a comment.

What order do I need to do to make this work?
You create or edit a device, then add the Symbol (using the add symbol icon from the left column or the command below), then add the package, then connect.  

When you say ADD SYMBOL it's like adding a part to a schematic--you have to drag and place the symbol into the symbol window.  I kept clicking the "add symbol" icon and waiting for magic to happen--nope.  It's just like a part.

ANOTHER GOTCHA: Where is "ground zero" for your symbol or footprint? If you look at the editor for these, on the blank canvas, you will find a plus sign.  Move your creation so it's close by the + symbol.  That's where you grab your part to move it around.  Took me too long to figure that one out!

You can also use commands for this:

Create your new device and then issue this command:  

ADD [packagename] and the package pops into the device, ready to connect.

and/or

ADD [symbolname]

CONNECT and then make sure you connections look OK.

….with all of that in hand it was time to do a Proof of concept board.  I did a quick layout for 3 concentric pots spaced 850mils apart.  Also useful for single 9mm pots or duals.

You can find the files for this  PCB on my website. The result--yep it worked. I can see a lot of uses for this going forward.

Now what?

You can get the clone pot library from my GITHUB page.  I will try to keep expanding this library as I need more components. As always if you find mistakes, have problems, etc. please let me know and I'll fix it.







No comments:

Post a Comment

Synth Gates, Interrupts, and Arduinos; a million and one uses

Yes once again: more Arduino Control Voltage Fu. Continuing from last time ...how can we use an Arduino to get rid of mountains of analog ...