Research & Learning
Other Class pages
How to use Eagle CAD
Currently, the tutorial explains how to draw a schematic and design a circuit board. It does not yet describe how to output Gerber files for manufacturing or how to print your board design for etching.
Originally written on November 13, 2008
(:toc Table of Contents:)
For Linux, it downloads as a file such as eagle-lin-5.3.0.run. You can run the installer by opening a terminal, navigating to where it has been downloaded, and then by typing:
The default install location is something like /opt/eagle-5.3.0, so you can run Eagle by typing:
If you're using a Linux distro, you may want to refer to your package manager first to see if it has the newest version available before downloading from CadSoft. This may simply save you from having to run commands in the terminal and will usually add an Eagle icon / link automatically to your Applications menu.
Installing the SparkFun Eagle Library (Optional)
This an optional step but is very useful and isn't very time consuming to complete. I will be referring to this library over and over again during the tutorial. So, if you don't have any prior experience with Eagle its best you install this so you will be able to follow along.
The SparkFun Eagle Library is a library file for Eagle that allows you to include additional electronic components in your schematics and board designs. SparkFun has been nice enough to create and share a library of a large cross-section of their electronic components that are for sale on their website. So, if you'd like to design a schematic or board that includes parts you purchased from SparkFun, this is a must have. Even if you are using parts that you didn't directly order from SparkFun, their library will still be incredibly helpful as it'll probably include parts that you plan to use in your board design. It also never hurts to have too many Eagle libraries at your fingertips.
On the Mac, it should be /Applications/EAGLE/lbr/.
Running Eagle for the first time
Upon running Eagle, you will see a screen very similar to the one below.
Creating a new project
For the time being you can ignore most of what is being shown to you, but you'll want to focus your attention on where it says "Projects". Click the triangle to the left, double-click on the "eagle" folder, then right-click, or Control+Click on the Mac, to bring up a menu. Choose "New Project".
Name your project whatever you'd like, I will be calling my project "Arduino PCB".
Creating a new schematic
Eagle projects are made of two main files, a schematic file (.sch file extension) and a board file (.brd file extension). A schematic needs to be made in order for a board design can be started though a board file isn't necessary for a project. If you'd just like to document your awesome circuit in a digital format, Eagle is great for drawing out schematics. If you'd like to create a PCB of your awesome circuit, you will need to first create a schematic and then design a board that adheres to the schematic (don't worry, Eagle makes sure your schematic and board are synced, you will find out later).
Right click on your project folder, or Control+Click with a Mac, and select "New Schematic".
It will automatically open up a blank white schematic window.
The first thing I would suggest doing is saving this blank schematic. This will create a schematic file for your project. Click on the blue diskette in the top left corner and name your file.
Designing a schematic
Creating a schematic is absolutely necessary in Eagle. If you'd like to make a PCB, you'll need the schematic designed first. And well, if you'd like to use Eagle simply to document your circuits this is where you'd do it.
There are many techniques for building a schematic and the more you use Eagle, you'll probably develop a technique that suits you best, but for the sake of this tutorial we'll start by adding all the components to the schematic first and then wiring and orienting them next.
For this project I plan to design a circuit and board based around an Atmega chip running the Arduino bootloader, so let's begin by collecting our parts.
Head over to the toolbar on the left side of your window and click the Add button. This button is below the paste tool and to the right of the big black X or delete button.
Clicking the Add button will pop up another window like this...
There are two ways to find a part you are looking for. The first is by typing text in the search form towards the bottom left of the window and pressing ENTER. This will narrow down the number of libraries in the left pane. If for some reason it yielded no results or not the results you were looking for, clear the text box and hit ENTER again. It will then display your full library list again. The second approach is to sift through the libraries in the left window pane. Double-clicking or click on the gray triangle will expand the library as well as open up devices that contain multiple packages.
I often use the search function first to narrow things down and then using the left window pane to sift through the rest. You may think that the search function is really poor but instead you aren't using it the way it would like to be used. Searching for simply "atmega" will probably yield no results, but "*atmega*" with the asterisk as a wild card will give you exactly what you need. The search function is very literal and so using the wild cards will be extremely helpful.
If you weren't able to find the part you were looking for and really tried your best to scour the libraries, it may very well be that the part you'd like to add isn't in any of the available libraries on your computer. So, you will need to find a library that has what you want.
Before we get too crazy, did you add the SparkFun Eagle library? If you haven't already, refer to the instructions at the top of this tutorial for guidance. If you have but don't see it listed in your libraries, it may be that it hasn't been activated. It should be listed as "SparkFun" towards the top of your list. Also, make sure you clear your search form and press ENTER to reset the libraries being displayed.
To activate a library that has already been copied to the correct 'lbr' directory in the Eagle installation, first press CANCEL and close the ADD parts window. Go to the top of your screen and choose the 'Window' pull-down and select the Control Panel window. Double-click or click the gray triangle to expand the 'Libraries' folder. This will show you all the libraries in the 'lbr' folder of your Eagle installation. Search for 'SparkFun'. All activated libraries have a green bulb to the right of their names, if you find 'SparkFun' and it doesn't have this. Click the dull gray circle and it will turn green, activating your library. Switch windows and return to your blank schematic. Press the ADD button and then search yet again. Still no luck?
It may very well be that you need another library with the part you are looking for.
Adding a new library to Eagle
Your search should usually start at the CadSoft website here:
This is a list of available libraries on the CadSoft site. This is great resource outside of SparkFun or the libraries available with the Eagle installation.
If you can't find what you're looking for here, try looking for alternate names of your part. Very often you are just searching for the wrong thing. Lastly, if you still have no luck. Resort to Google and all its power. Try a search like:
Perhaps you will find someone who has created a library with the part you are looking for.
Once you find the library, download the .lbr file and save it in the 'lbr' directory of your Eagle installation. Restart Eagle if its currently open and check the 'Libraries' folder in the Control Panel to make sure it is activated. It will have a green light next to it if so. If there is no green light and only a gray circle, click the gray circle to turn it green and it will activate your library.
It is now ready for use!
Designing a schematic (continued)
Return to your schematic and the ADD part window. We are going to begin by adding an Atmega chip. Oddly enough, "atmega" in the search form doesn't yield any results so we'll go through sifting through libraries that look promising. I know the SparkFun library has it so I open that up, and find something that looks about right.
Once you select a part, it will populate the two panes to the right. The one on the left will show you a preview of it as a schematic and the one on the right will show you a preview of it on a board.
We're looking for a DIP (dual inline package) version like the chip in our Arduino boards. DIP is a package type with long metal legs. They are easiest to work with but larger than most other packages. This package will do just fine for now. Select it and click OK.
You'll now be returned to your blank schematic, except this time you'll see a big red chip floating wherever you move your cursor (which is now crosshairs). Click on the white screen where you'd like to put it. For now, it really doesn't matter. I like to use the static, dotted crosshairs as my bottom left corner marker (you will notice this is also the case when you design your board).
After clicking once you'll probably notice that the Atmega chip is still stuck to your cursor. Ain't that just fun? Click on the bold lower case 'i' button or the Info tool on your left toolbar towards the top, it will activate another more benign tool thus getting rid of that sticky Atmega chip. Clicking any tool will do but I find the Info tool to do the trick nicely.
Return to the ADD part tool where we'll add the rest of the parts we'll need for our schematic. If any of the parts I begin adding don't ring a bell, you may want to refer to the Arduino on a breadboard tutorial. We're going to add most of the parts used there.
Let's grab a resistor from the SparkFun library (Note: All the following screengrabs will show the equivalent part in the SparkFun library). We're going to use this as a 10k pull-up resistor for the reset pin on the Arduino. You can find resistors in other libraries included with Eagle but its the most straight forward with SparkFun's. Choose the axial package.
Don't worry about the value of the resistor just yet. Eagle let's you annotate this part later on.
Place that in your schematic near pin 1 or the RESET pin of the Atmega chip you previously placed.
Now let's add the 16mHz crystal...
Place it in your schematic near pins 9 and 10 of your Atmega chip. You will notice they are labeled XTAL1 and XTAL2 for "crystal". Sorta like X-Mas.
Add the two 22pF capacitors that are often included with the crystal.
Select the part highlighted above then click OK. Now let's take advantage of the sticky cursor syndrome we noticed before. Click once to place a capacitor near the crystal and then click again to place a second one. The upside to the sticky cursor is that it allows you to place a particular part into your schematic multiple times.
Let's add the components to power our Atmega chip. First a 7805 5V voltage regulator. Select it, click OK, and the place it into your schematic.
The decoupling capacitors on the IN and OUT of the regulator. These need to be of the polarized variety. Select, click OK, and place into your schematic.
How about adding an LED. We can either use this as a power LED to indicate that our Arduino has booted up properly or we can use it as an output for a sensor we will add later.
We'll also need another resistor. Add this as well after place the LED into your schematic.
I think it will be a good idea to add a power jack to our board so we can simply plug our DC power supply straight into the circuit board we will be designing.
Now, I'd like to add the proper components for handling an external sensor. I'm going to assume it will be a two leg sensor similar to an FSR (force sensitive resistor). So we'll need to add a screw terminal for easy attachment later.
Then, add another resistor and place it near the screw terminal.
Awesome. We have now added all the parts needed for a very simply Arduino circuit board. There is also an LED we can control and an analog input device. We now just need to tell Eagle how to wire everything up. So, let's return to the schematic if you haven't already.
Before we hop into wiring, I just want to briefly go over some really helpful tools. At this point, the only tool I mentioned was the ADD part tool, but there are many others that will help us orient our parts where they need to go.
These tools are located on the top toolbar towards the center. They are for zooming in and out of your schematic. The button on the far left is a "Fit" zoom. It will zoom into your schematic so that all the components fit in your window. The second one over is a basic "Zoom In" tool. The third over is a basic "Zoom Out" tool. The second from the right is a "Redraw" tool which essentially tells Eagle to refresh the window and redraw the schematic. I use this to refresh the schematic if it appears to be showing strange artifacts or broken pieces of the schematic. Lastly, the tool on the far right is a "Select Zoom" tool. Click and drag to create a box in which the window will zoom to.
This is called the "Move" tool is located near the top of the left toolbar. Click the button, click on a part, and it will then allow you to drag the part around your schematic. Best tool in the world. You wouldn't be able to make your schematic look pretty without it.
This is called the "Rotate" tool and is located one button down and to the right from the "Move" tool. This tool lets you rotate a part in your schematic. Click on a part and it will rotate it 90 degrees.
The "Delete" tool. Located towards the middle of your toolbar. When activated, it will delete any part or electrical connection in your schematic that you click on.
Here are two related tools. The "Name" tool and the "Value" tool. The "Name" tool will allow you to rename any part in your schematic. So, for example if you have a resistor named "R1" you can change its name to "R10". In most cases, its more helpful to just let Eagle follow its own name convention.
The "Value" tool lets you annotate the value of a particular part. For example, we placed a couple resistors into our schematic before. This will let us assign a resistor value to them in the form of text. Click on a resistor with the "Value" tool and then type the value you'd like to assign, for example: 220 or 1k.
Connecting your schematic
First, move all your parts around and orient them the way you'd like. You may want to consider placing parts that go to together close to each other and parts that will be wired to specific pins close to the pins they will be using. Refer to the Atmega-Arduino pin mapping if you're not sure which pins are certain pins on the Arduino.
My schematic looks something like this after a bit of house keeping.
To connect all your parts together in your schematic you will be using the "Net" tool.
NOT the "Bus" tool which looks VERY similar to the "Net" tool.
Or, you can select the Net tool by going to the "Draw" drop-down menu at the top of your screen and selecting "Net".
NOT the "Wire" tool which you may think is what you need.
Simply activate the "Net" tool, click on the tip of the pin you'd like to start a connection at and then click on the tip of the pin where you'd like to complete the connection. The electrical connection will be bright green at first and will turn darker green when a connection has been successfully made.
Continue this for all your components.
Now, if you're following along with how I'm doing it you'll probably come to a point where you have a couple pins or components that seem to be "floating" or you can't seem to figure out how to connect them without running a connection ALL the way around the chip. Even though that would work perfectly fine, there is a better solution.
Here's where I'm at.
You may or may not have noticed that Eagle names all its nets or electrical connections, and if nets have the same name they are considered to be equivalent connections. So let's begin by giving the voltage coming out the regulator a nice name like "5V" and the common ground "GND". Use the "Name" tool I showed you earlier and click on the green net coming OUT of the regulator. Change its name to "5V" without the quotes.
Do the same for the GND connection coming out of the regulator. Click on the green connection with the "Name" tool and type in "GND" without quotes.
What this allows us to do is add additional "5V" and "GND" parts that are small, compact and we can place right to the pins or devices that need either of these resources. It'll save us from running a really long net all around our schematic.
Add the following part to your schematic and place it near the VCC, AVCC, and AREF pins.
Make an electrical connection from the 5V you just placed and the three pins I mentioned above. Once that is done, double-check your electrical connections are named "5V" by using the "Name" tool on the nets or by using the "Info" tool on them. If they are called "5V" then Eagle has taken note that they will be connected in your board design.
Add the a GND part to your schematic and place it near the LED resistor and the sensor screw terminal resistor.
Draw electrical connections with the "Net" tool and double-check the Net's name is GND with either the "Name" tool or the "Info" tool.
Congratulations! Your schematic is now finished and it should look something like this...
Designing the circuit board
Once your schematic is complete and you wish to create a circuit board from this, you begin clicking the 'Board' button on the top toolbar. It is located between the CAM tool, which looks like two light blue film strips, and the sheet selector, which is a drop-down menu usually displaying 1/1. The 'Board' button contains a logic gate above an IC or chip drawing.
Upon clicking the button it will ask you if you'd like to create a board file from your schematic, which you will say YES to and then typically a black window will open displaying all your electronic components and a big rectangular denoting your board dimensions.
First begin by moving all your components over to the board and orienting everything the way you'd like them. This can be done by a combination of the 'Move' tool and the 'Rotate' tool. You may have noticed that a lot of the same tools you used in the Schematic file are the same in the Board file. So, go ahead and put everything where you'd like the to be. It may be a good idea to keep in mind the usability of this board. For instance, the power jack will work best towards the edge of the board and it may be more intuitive if related components are located near each other, like the power jack and the regulator.
If you'd like to move everything over at once, click the 'Select' tool then click and drag a selection box over all your components. Once you release the mouse, it will automatically choose the 'Move' tool for you. Now press CTRL and right-click on one of the components in the group and you will now notice all the components you selected are available to be moved at once. If you're using a Mac with a one-button mouse, the equivalent of CTRL + Right-Click is Control + Command key (Apple button) + Click.
Here's what my board looks like after putting everything in place.
Now, you may notice that there is lots of empty place. The board is obviously too large for the small amount of components we'd like to put on it. So, let's fix that. Select the 'Move' tool and click on either a side of the board dimension (the gray box) or a corner of the board dimension and you'll be able to adjust it.
All your components are on the board. You may notice there are lots of dark yellow lines connecting everything. These are the electrical connections you need to make. Eagle is nice enough to keep track of all connections from your schematic. Before we start running connections, lets use the 'Ratsnest' tool to have Eagle untangle everything and compute the shortest connection to be made with your new configuration.
The 'Ratsnest' tool looks something like this...
Time to route our traces and complete the electrical connections. Before I present the two available options, there are two tools that are very useful when routing traces.
The tool on the left is the 'Route' tool that allows you to begin laying traces and the tool on the right is the 'Ripup' tool which lets you delete traces you've already made.
The two options for routing traces for your board are the automatic way and the manual way. In almost every situation, I recommend the manual way. The reason why is that the automatic routing in Eagle does a decent job, but a messy one at that. And, on occasion the automatic route is unable to route everything for you and will leave the work unfinished. If you want a beautiful board, do it yourself. If you have little time and don't care how messy things look, consider the automatic routing. Take note though, designing a circuit board with not much time to spare can be a risky undertaking. Take your time, double-check your work, and don't rush things.
The 'Autoroute' tool is located towards the bottom of your side toolbar and looks like this...
If you click on this tool a window will open.
This window is giving you the option of configuring how your Autorouter works. You may ignore most of this unless you are more experienced and wish to customize things to your liking. On the left side of the window there are two drop-downs for Top and Bottom. These drop-downs let you configure the direction of the traces on the top and bottom layers. If only wish to do a single layer of traces, for example you are designing a board that you'd like to hand etch, then turn off one of the layers by setting it to N/A. If you're etching a board, turn off the top layer so your traces will only be on the bottom.
When done, click OK, watch it work, and cross your fingers it finishes successfully. At the bottom left of your screen you will see a percentage complete.
Ripup All Signals
If you autorouted your board but weren't happy with the results, you can tell Eagle to rip up all signals. To do this, click on the 'Ripup' tool and then go to the top toolbar and click on the traffic light. It will ask you if you'd like to "Ripup all signals?". Click YES.
The manual approach is simple but time consuming and you'll most likely come out with results you can be happy with. Why? Because there's no one else to blame but yourself!
Click the 'Route' tool, via the top toolbar select the layer you'd like to use, ...
...and then click at the end of a yellow electrical signal. Move your mouse and you will notice that you now have control of a colored line. This is your trace. You can either click on the end of the yellow electrical signal to create a connection or you can click along the way to "thumb tack" your trace at certain places and create a less linear trace.
Using the 'Route' tool continue routing traces for all the electrical signals on your board. Keep in mind, you can't cross traces that are on the same layer, i.e. of the same color. So you may want to do all the traces you can on one layer and then change layers when you can no longer route a trace without crossing paths.
My finished board looks something like this...
Generate Gerber files
Helpful Eagle libraries
This library is a collection of Atmega chips where the pins are mapped to the functions of your traditional Arduino board. Very useful if you don't want to constantly refer to this pin mapping diagram.
This is the great, expansive library used in this tutorial. It includes a large amount of components found online in the Sparkfun store as well as many other useful parts and symbols.