You are on page 1of 15

A tutorial on EAGLE

Mehul Tikekar July 13, 2009

Contents
1 Introduction 1.1 What is EAGLE? . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 The design ow . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Making a schematic 2.1 Components and libraries . . . . . . . . . . . . . . . . . . . . 2.2 Making connections . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Changing names and values . . . . . . . . . . . . . . . . . . . 3 Making a board 3.1 The grid and the layers . . . . . 3.2 Placing components . . . . . . . 3.3 Routing and vias . . . . . . . . 3.4 Autorouting and ground planes 2 2 2 4 4 5 6 7 7 8 10 11

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

4 What next? 13 4.1 Design Rule Check . . . . . . . . . . . . . . . . . . . . . . . . 13 4.2 Gerber les . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5 Miscellaneous 5.1 Special considerations for 5.2 Shortcuts and hotkeys . 5.3 Backups . . . . . . . . . 5.4 Check these out . . . . . 14 14 14 15 15

prototyping . . . . . . . . . . . . . . . . . . . . .

boards . . . . . . . . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

1
1.1

Introduction
What is EAGLE?

EAGLE stands for Easily Applicable Graphical Layout Editor. It is a very convenient software you can use for designing printed circuit boards (PCB). It has lots of nice features and using it is quite simple. A free version of EAGLE can be downloaded from the CadSoft website. Although the free version has some limitations, they arent too restrictive and you should be able to get along with it, unless you have a really large and complicated board to design. We shall learn to use EAGLE by way of an example : the USBasp. USBasp is a USB programmer for the AVR microcontrollers and is a very useful circuit if you are using AVR microcontrollers in your projects. Throughout the tutorial, the technical terms used in pcb design are highlighted . These are standard terms and you should avoid using alternate words so as to prevent confusion while communicating with others.

1.2

The design ow

Designing in EAGLE starts with making a schematic. The schematic is only a circuit diagram and contains no information about the size and placement of the components or the routing of connections i.e. no physical details. It only tells how the components are electrically connected to each other. From the schematic, EAGLE generates an initial board which has all the components and indicators of the connections between them. You have to properly place the components and convert the indicated connections to actual routes as on the pcb. The completed board le is, essentially, your pcb design. The pictures below show the dierent stages of a typical pcb development. The rst image is the schematic. The second one is the board with the components properly laid out and the connections routed. The photograph beside it is the actual board made by a professional manufacturer.

Figure 1: An example schematic (not USBasp)

Figure 2: The board design and the actual board Notice how the red routes in the board design correspond to the actual light-green traces on the pcb. The white lines denote the outlines of the components which are yet to be soldered on the board. Also note that the green pads become the tinned areas where the components get soldered.

Making a schematic

The best way to use this tutorial will be to actually carry out the instructions as you read them. So, at this stage, you should download, install and run EAGLE if you havent already done so. To create a new schematic, go to File > New > Schematic in the EAGLE Control Panel Window. This opens up a new Schematic window.

2.1

Components and libraries

A schematic is made by adding components and connecting them together. There are a lot of predened components available in EAGLE. These components are grouped into libraries. For example, resistors, capacitors and inductors can be found in the rcl library. The ATmega8 microcontroller is in the Atmel library. If a component is not available in the EAGLE libraries, you can download some more libraries from the web. If you are using a highly customized component, you will have to make a new library and create the component. But more on this later. For now, rest assured that all the components used in USBasp are available in the EAGLE libraries. To add a component to the schematic, go to Edit > Add in the schematic window. An Add button is also available on the left pane. Then, select the component from the appropriate library or use the search function. Some components are available in many packages. In this case, you need to select the package you have. For example, the ATmega8 has three variants MEGA8-AI, MEGA8-MI and MEGA8-P corresponding to the MLF, TQFP and PDIP (or DIL) packages. See the ATmega8 datasheet for more information about these packages. In our example, we shall be using the PDIP package; hence choose MEGA8-P. The Add window also shows how the component looks on the schematic and on the board. In addition, there is some extra information about the component and the package. Note that it is not strictly necessary to select the correct package at this stage. We are only making a schematic which, as explained before, does not incorporate these physical details. Resistors, capacitors and inductors are available in a huge variety of packages. In this case, just select any package and add the component. We can change to the correct package while designing the board. A list of components we need for the USBasp circuit is given below. Add them to the schematic.

Component ATmega8 Crystal Resistors Capacitors LEDs Zener diodes USB connector 2 pin header 4 pin header 6 pin connector

Library atmel crystal rcl rcl led diode con-berg pinhead pinhead con-amp-quick

Component name How many MEGA8-P 1 CRYSTALHC49S 1 R-EU 9 C-EU 4 LED3MM 2 ZENER-DIODEZD-2.5 2 PN87520 1 PINHD-1x2 2 PINHD-1x4 1 M06 1

Table 1: List of components in USBasp Searching for the names should get you the component. In case the names are dierent in your version of EAGLE, just look for it manually in the corresponding library. After you search once, your next search will happen within your search results. To make a new search within all libraries, make an empty search and all the libraries will be listed for searching afresh. You can move components around by Edit > Move. Left-click on the component you want to move, move it to the right location and left-click again to place it there. You can rotate components with Edit > Rotate. You can also rotate the component while moving it by right-clicking. This will rotate the component by 90, counter-clockwise and you can continue moving it around or rotate further. Note that the zoom commands are in the View menu. Using Zoom to t will zoom and re-center your view so as to bring everything on the schematic in the screen.

2.2

Making connections

Once some components are added, you can begin connecting them. To make connections, use the Draw > Net button and connect the components as in the schematic. You can quickly check the connection by moving the components around. If the net is connected to the component pin, it will move along with the component. The connection between two overlapping nets is indicated by a junction dot. EAGLE places the dot at the junction automatically if the nets are connected, else you can manually put a dot using Draw > Junction.

The symbols in the supply1 library can be used to make the power connections. Since a typical circuit has a lot of power connections, using the symbols makes the schematic look a lot cleaner. For example, the two circuits shown below are equivalent, but which one looks better is perfectly clear.

Figure 3: Supply connections The basic idea is that if two nets have the same name they are implicitly connected even if there is no net connecting them. When you connect a net to a +5V or a GND symbol, the net automatically gets named +5V or GND respectively. Thus, all nets connected to the +5V symbols have the name +5V and are implicitly connected together. You can check the names of the nets by right-clicking on them and selecting Properties. Alternatively, you can use View > Show and select a net. All the nets and pins connected to this net will get highlighted.

2.3

Changing names and values

Although this is not strictly necessary, it is a good practice to change the names of components and nets to reect their purpose in the circuit. Similarly, the component values should be set to the actual numbers we intend to use in the circuit. Nets and components can be renamed using Edit > Name while the component values can be set using Edit > Value. The completed schematic for USBasp is in the RAR le. You should use it as a reference and make one yourself. Save your schematic as usbasp.sch

Making a board

Once your schematic is ready and saved, you can start making your board. To do so, go to File > Switch to board. A new board le with the name usbasp.brd will be created and opened for editing in a Board window. Right now, you will see that the board has all the components you put on the schematic. The nets on the schematic are represented by yellow wires on the board.

3.1

The grid and the layers

The rst thing to do when designing a board is to set up the XY grid. Go to View > Grid in the Board window and turn the Display on. Make the Size 0.05 inch and leave the other settings as they are. A grid with a unit length of 0.05 inch will become visible. The grid size and the current coordinates of the cursor are shown near the top-left corner. EAGLE has an option of setting an alternate grid with a dierent grid size. This is the Alt setting in the Grid dialog box. Although this grid is always invisible, it has a use which will be explained later. So just make a mental note of this at this point. If you are using the free version of Eagle, you will see a white 3.95 inch x 3.15 inch rectangle. That is the maximum sized board you can design in the free version. Before you start routing the wires, you should understand that the pcb tracks can be laid on both sides of the board. In fact, for more complicated designs, the pcb is made of many layers stacked on each other, with tracks on each layer. For the USBasp, we shall be using a single-sided board. Hence, only one layer, the Bottom layer, will be used for routing. The complete list of layers can be checked at View > Display/hide layers. For the free version, only the Top and Bottom layers are available for routing. You will also notice many other layers like Unrouted, Dimension, tPlace, tNames, tValues, etc.. These layers can be used to view or hide groups of gures and shapes at a time. For example, the names of components on the top layer are on the tNames layer. So, hiding that layer will cause all the names of the top-side components to disappear. Similarly, if you want to see only the tracks on the bottom layer, you should hide all layers except the Bottom layer. Find out which layer the white rectangle for the board size is on. For now, keep the default layer settings. Group all the components together using Edit > Group and dragging a rectangle around all the compo-

nents. Now go to Edit > Move and press Ctrl + right-click to move the entire group around. Bring the group into the white rectangle and left-click to place it there. Your Board window should look something like this:

Figure 4: The board window

3.2

Placing components

Even though the components are grouped together now, you can move the individual components . The group you dened earlier is valid even if you move, rotate, delete, or do anything to its members.(you can try Ctrl+rightclick to see that). Once a group is dened, it remains valid until you dene another group. Only one group can remain valid at a time. Another thing is, you will notice that the components move only in steps of 0.05 inch in either direction which is the grid size you have set. Sometimes you may want to move the components by a smaller distance. For this, you can press Alt while moving them. This makes the components move according to the alternate grid size which is set smaller than the normal grid size. If you want to move a specic component with a really great precision, you can just specify its coordinates in its properties by right-clicking on it. We will now look at placing the components. The basic idea of layout is to make the circuit as compact as possible. There are many reasons why a small circuit is desirable:

1. Cost of manufacturing a board is proportional to area of the board. 2. A large board means longer tracks than needed. This means that the tracks will have higher parasitic properties like resistance, capacitance and inductance. This causes many problems. For example, a long power supply track will have a signicant voltage drop across it if it is carrying large currents. The capacitance between two wires will reduce the maximum speed at which they can transmit digital signals. Besides, you have capacitive and inductive coupling of noise. 3. When designing pcbs for robots, space is often a constraint. 4. Small looks cool. After all, we are in the nano-age. However, take care not to make the pcb so small as to cause problems while actually making the board. For example, you may end up with components ghting for space or solder pads so close that solder bridges the gap between them. Moreover, there are many important guidelines depending on the specic circuit you are designing. Datasheets of components usually mention the most important ones. Some common ones are listed here. 1. Keep decoupling capacitors (the capacitors used on power lines) close to the components. 2. Keep high frequency signals like crystal clock signals short. 3. Keep analog components and digital components as far apart as possible. Typically, you do not get the layout right at the rst try. When you start routing the board, you will see that moving some components around will result in shorter tracks. Hence, you will go through many iterations before you arrive at the best layout. Always remember that it is worth the time and eort you spend on improving your board design. The performance of your circuit is highly dependent on the layout and routing of the board. Coming back to the board, take a look at the usbasp tut.brd le and place the components on your board similarly. Right now, you dont have to place them at exactly the same locations, but the placement should be roughly the same. If you nd that the wires are getting all mixed up, try Tools > Ratsnest. This might clean things up by minimizing the wire lengths.

3.3

Routing and vias

Let us now begin routing the wires. Go to Edit > Route. You will see the following menu bar near the top of the window. Each of the options is briey described below it.

Figure 5: Routing options Since we are making our tracks on the bottom side of the board, choose the Bottom layer. The width of the track is an important parameter. Thin tracks are risky because some parts may not appear on your actual board due to over-etching. A professional manufacturer provides the value of the smallest width you should use. If that is not known, 0.012 inch is the thinnest you should go. Also, remember that power tracks should be thicker than signals. I typically use 0.016 - 0.024 inch for signals and 0.032 - 0.05 inch for power. Once you have the required settings, select a wire and route it. It is not necessary to route it completely; you can partially route it and leave the rest for later. Since have only one layer for routing, we will not be using vias in this board. But it is a good idea to tell you more about vias are at this stage. Vias are connections between tracks on two dierent layers. For example, you may have a track on the bottom layer and you have to continue it on the top one. So, you route the bottom part of the track, then you change the layer to top and continue routing. When the routing is done, you will notice a via at the point you jumped to the top layer. Now, depending on the pcb manufacturer, the via may or may not connect the tracks. If the pcb is of the plated-through-hole (PTH) type, then the via will essentially be a hole with a metal coating on its walls. In this case, the metal coating connects the top and bottom tracks. If the pcb is not of the PTH type, the via will just be a hole and you will have to insert a piece of wire and solder it on both ends to connect the tracks.

10

Figure 6: Vias

3.4

Autorouting and ground planes

For small pcbs like USBasp, you can easily route all the wires manually. This allows you to optimize your board very well. But routing a large board with a lot of signals takes a lot of time. For this, EAGLE has a powerful feature called Autorouter. All you need to do is to place the components and click a button and voila, you have a routed board! OK, sometimes the autorouter is not all that great. It may take a lot of time to route large boards and may not be able to route all the signals. But you can always use the result of the autorouter as a starting point for manual routing. The autorouter should be able to do most of the easy connections and you can then work on the more complicated ones. The autorouter options are at Tools > Auto.... To disable routing on the Top layer, choose N/A as the preferred direction for it. You can set some parameters which will aect choices the autorouter makes when routing your board. For example, if you have a double-sided board but for some reason, you prefer tracks on the bottom than on the top, you can set a higher layer cost for Top. The autorouter does a few iterations to optimize the routing. You can use dierent cost settings for the iterations. Thus, the rst optimization can be run with a top layer cost of, say, 10 and it could go on to, say, 50 for the last iteration. This is better than simply setting 50 for the rst one and keeping it 50 for the rest. You will notice that EAGLEs

11

default settings for other costs are also graded in this fashion. You can also add or delete iterations thus trading o between better routing and lesser run-time. Your settings can be saved and used later for your other boards too. Another nice feature of EAGLE is that it allows you ll up unused regions of the board with a ground plane a.k.a. copper pour . To do this, go to Draw > Polygon and make a polygon in the bottom layer around the region you want to ll up. Then go to Edit > Name and change the name of the polygon to GND. Now, right-click on the polygon to check its properties and change the value of Isolate to 0.024. Now, click on Tools > Ratsnest to ll up the polygon with a ground plane.

Figure 7: Creating a ground plane

12

The isolate parameter essentially tells EAGLE to keep a distance of 0.024 inch between the ground plane and the other tracks. Also, you will notice that the ground plane has gobbled up the ground tracks that existed before. This is natural since we named the polygon as GND. You could have named the polygon as +5V or any other name and it would then gobble up that net and keep a distance from the other tracks including GND. You can look up EAGLE help for more information on the other polygon options such as Orphan, Thermals, Pour, Rank, etc. Now that we have gone through all the steps, you should be able to complete routing the board. Use the usbasp tut.brd as a reference.

4
4.1

What next?
Design Rule Check

After you have nished designing the board, it is time to check for any errors. Typical errors are overlapping tracks and components, tracks too close to each other or component pads, holes too small and tracks too thin. EAGLE provides a Design Rule Check function to look for these errors. Go to Tools > Drc... and click Check. EAGLE will then generate a list of DRC errors and point them out when you when you select each instance of the error. Else if your design has no errors, it says so in the bottom-left corner. Right now, EAGLE used some default rules for the DRC. You can modify some parameters such as minimum clearance between two objects according to the manufacturers specications and save your settings. The manufacturer may also provide you a le for the design rules which you can load into EAGLE. The schematic also has an Electrical Rule Check function which I encourage you to try out yourself.

4.2

Gerber les

Some manufacturers require the board les in the gerber format. You can generate the gerber les from the board in the following way. 1. Go to File > CAM processor in the Board window. 2. In the CAM processor window, go to File > Open > Job and open the le gerb274x.cam.

13

3. Click on Process Job to generate the gerber les. 4. Now open excellon.cam and run Process Job again to generate one more le. You can view the Gerber les with a gerber viewer like Gerbv. This can be downloaded from gerbv.sourceforge.net. A list of free gerber le viewers can be found here. Some manufacturers need only the images of the top and bottom tracks. This is the case when no solder-mask is applied. To take a print-out of the bottom tracks, keep only the Bottom, Pads and Vias layers visible. Then, go to File > Print. Amongst the options, enable just the Black and keep the scale factor as 1. You can also create a pdf le if you dont have a printer connected to your computer. In this case, make sure you use the appropriate scaling options when actually printing the pdf. To be sure, keep some actual components on the the printout and verify if the pins match up with the printed board. You could also keep all the components just to check if some are overlapping or if you have used the wrong package while designing. To print the top side, keep only the Top, Pads and Vias layers visible. The rest of the steps remain the same.

5
5.1

Miscellaneous
Special considerations for prototyping boards

When you are designing pcbs not to be manufactured elsewhere but plan to assemble the circuit yourself on a prototyping board, you need to design the board appropriately. Since the prototyping board has holes in a specic grid, you need to change your grid setting to match the prototyping board. Most boards have a grid of 0.1 inch since the PDIP package has a pin pitch of 0.1 inch. Now, the pads of all your components must necessarily be on the grid points. All the tracks must be routed along the grid lines as well. Check out the le usbasp proto.brd for an example board design for a prototyping board.

5.2

Shortcuts and hotkeys

Most of the commonly used functions are present in the panes on the left and right of both, the Schematic and Board windows. Using them is certainly

14

faster than going to the menubars on the top every time you want to move a component or add a wire. However, a more intelligent way is to assign hotkeys to these commands. EAGLE already has some default hotkeys such as F3 for Zoom in, F7 for Move, etc. The complete list of hotkeys can be seen and modied at Options > Assign. Note that you can assign dierent hotkeys for the Board and Schematic windows.

5.3

Backups

It is a good idea to periodically save your work. When you do so, EAGLE creates a copy of your previous saved le as a back-up. For example, when you save usbasp.sch for the second time, your earlier saved version is now saved as usbasp.s#1. When you save the next time, usbasp.s#1 becomes usbasp.s#2, usbasp.sch becomes usbasp.s#1 and your current design gets saved as usbasp.sch. Thus, the .s#1 le has the most recent backup. In case you wish to revert back to an older back-up, just change the extension to .sch and open the le in EAGLE. A similar convention applies to the board les too.

5.4

Check these out

- The EAGLE installer comes with a tutorial and a manual. There are the rst documents you should go to if you get stuck at anything. The les are in the doc folder in your EAGLE installation directory. Also check out the CadSoft website for new libraries and updated versions of EAGLE. - Instructables has a really nice tutorial on using EAGLE here. They also touch upon creating new libraries in some related tutorials. - Spark fun also has a good tutorial and a really awesome library with a huge number of components. The EAGLE tutorial starts from here. While at their site, also check out the other tutorials they have.

15

You might also like