Sunday, 21 September 2014

How to input a schematic diagram using Cadsoft's Eagle 7.1

I'm getting a lot of requests for a tutorial on how to use Eagle to design printed circuit boards.  Not just on how to use the software but what drives the design decisions and how does this affect the results.

Eagle is a piece computer aided design software specifically written to enable electronics design engineers to design and develop printed circuit boards or PCBs.  Eagle is currently on version 7.1 of the software and is available cross platform - Windows, Linux and Mac.

The software can be downloaded from Cadsoft's website here:

Cadsoft's Download Page

For the purposes of this tutorial we will be concentrating on the latest iteration (Eagle 7.1) using Windows as the operating system.  The linux and Mac installations are a little more involved but should be fairly self explanatory.  I may go into more detail about those if requested.  I don't have a Mac so I can't help much there but I do use Ubuntu Linux so watch this space.

Run the downloaded executable file and install Eagle into the folder of choice.  Note - you will be presented with a warning dialogue box due the installation process being unsigned click 'Ok' and continue the process, there are no issues with installing the software.

The dreaded Microsoft Security Warning for an unsigned installer!
Next you will be presented with a 'Winzip Self Extractor' window.  Click 'Setup' and continue.  The self extraction process will unzip the files needed to install Eagle 7.1 to a temporary directory.

Winzip Self Extractor for the temporary installation files
Once the temporary files have extracted you will now be presented with the window below:

Click on the 'Next' button to carry on with the installation....there do seem to be a fair number of installation pages and steps for this software.

Agree to the licencing agreement which is fairly boilerplate stuff....I didn't read all of it in truth because it's really boring. I doubt I will void it as I will be using the free version.

I'm using the default install directory....feel free to use another location...just remember what it is!

Click 'Next' to start the installation process...

Once complete you will be prompted to decide which kind of licencing you will be applying.  I'm using the freeware version so I selected that option.  If you have a licence file you can obviously apply it or a 'Freemium' code, again if you have one.

Click 'Finish' to end the installation - any superfluous installation files will be removed by default.

A new red 'Eagle 7.10' Icon will have been added to the start bar.  Click on the Icon and load up the software.

You will presented with the following screen:

If like me, you have used Eagle previously there will already be an Eagle 'projects' folder present.  If you are new to eagle you will prompted with a request to create a folder for your projects in a location of your choice. Choose where to place the folder and carry on.

At this point it's time to really discuss what eagle is for and why electronics engineers, designers hobbyists and anyone with a passing interest in making electronic equipment use computer aided design software (CAD) and specifically PCB layout computer aided design software.

In the days before computers and CAD software were readily available on order to make an electronic circuit on a printed circuit board this meant drafting a schematic diagram on paper, deciding the mechanical dimensions of the final device and then choosing the type of components to be used before actually making the device. Making the device meant getting a piece of copper clad PCB, cutting it to size and deciding on the copper where the components were to be fitted and finally drawing tracks between the components using a special etch resist pen or special tape.  In order to do that we need to make several decisions relating to the questions below:
  • Which components are to be used and how many are there? 
  • What are the voltage and current ratings of those components and how much current does the circuit draw in use? 
  • How physically big are the components?
The first and third question dictates the size of the printed circuit board - we need enough space to fit all of the components on the board.  The second question dictates to some extent the size and type of components and the size and thickness of the interconnecting tracks or wires between the components.

Rather than go through the process of designing a circuit from scratch I'm going to make the assumption that people have a circuit they have prototyped and tested and now want to design and make a PCB.  I have written a post concerning the design of the circuit I'm using to discuss the techniques if people are interested here:

How to design a simple light dark detector

From the information in the above post we calculated that every component in the circuit must be capable of withstanding 107 mW of power flowing through them.

This information then allows us to choose the types of components we could use to physically build our circuit.  There are many different versions of electronic components with different characteristics and properties.  Lets choose ones which have the values we require or perform the function we want whilst still being able to withstand the 107 mW of power dissipated in them...

The light dark detector circuit mentioned uses semiconductor devices.  All of the information about these components can be found from their associated datasheets.  I've said it before but when doing anything with electronics the datasheet is one of the best places to start.  The light dark detector contains two NPN transistors (of the same type) and an LED.  We can get information concerning the transistors and the LED from their associated datasheet which is supplied by the manufacturer and available from any search engine.  If we read through the information we find that these components are rated for 107 mW of power dissipation.  The other information given in the datasheet is the physical size of the components - often called the package size or land pattern.  This is useful to know...there are often different packages provided in the PCB CAD software depending on the type of component and it's power dissipation.

Semiconductor components also use some designations relating to their physical size and the number of pins present.  The standard where these designations was compiled by an organisation called JEDEC - Joint Electron Device Engineering Council.  The organisation started in 1958 and is still going strong.  The standards are free and available for download online.  They have a wikipedia entry here:


Here are some of the standard JEDEC packages for semiconductors:

TO92 package - leaded component, normally a transistor but not always - D-shaped plastic package

TO-220 - leaded component with a tab, transistors or voltage regulators - rectangular shaped package

TO-3 - leaded component, high power transistors,  diamond shaped designed to mount directly to a heatsink

TO-263 or D-PAK - half leaded, half surface mount component, used for transistors, rectangular shaped with two short leads.  The third terminal is on the base of the component.

DIP - Dual inline package, normally used for integrated circuits, rectangular shaped package with short leads either side

SIP - Single inline package, normally used for resistor networks and integrated circuits similar to DIP, rectangular with a single row of short leads

SOIC - Small Outline Integrated Circuit - used for integrated circuits, very small rectangle with very short leads on either side, much smaller than DIP.

TSSOP - Thin Shrink Small Outline Package, similar to SOIC - even smaller surface mount device normally used for integrated circuits.

There are many many more packages available, the only way to learn them is to research and use them as needed.

Because our circuit's power dissipation is 107 mW we can afford to use smaller component packages without any consequence...lets use the T092 package for the transistors and a 5 mm LED package.  To be honest we could use any size components we liked as long as they perform the function we want and we have them to hand!

Next we need to choose a resistor type which is capable of withstanding 107 mW.  Resistors come in standard sizes and power ratings,  The most common power rating is 250 mW package or quarter watt.  There are also half watt resistors, 1 watt, 2 watt and various power ratings as required....the higher the power rating the physically larger the component is.  Usefully the datasheets give the dimensions of the parts so we have an idea of how physically big they are and how far apart the leads are - known as pitch.

Here are some images of these components:      

These types of packages with long wire legs are known as through hole components.  There are two distinct types - axial and radial. Axial components have wires coming from the sides (like the resistors). Radial components are circular and the wires come from the body of the component vertically.  The benefit of using through hole components is that they are easy to solder and use and are easy to obtain...

Through hole Components

There is another type of package for electronic components called 'surface mount'.  These types of components don't have long wire leads and are physically much smaller than the through hole type. They come in a huge variety of shapes and sizes.  They are more difficult to use because they are physically smaller but as a bonus they cost less and are used in all modern electronic circuits.

Surface mount Components

The equivalent surface mount components are shown below:

The LED and resistors use a specific package number known as 0805.  This number relates to their physical dimensions in imperial scale - length by width - 0.08 is the length in thousands of an inch and 0.05 is the width in thousands of an inch.  There are even smaller packages - 0603, 0402 and 0201.  There are also different acronyms for packages such as Melf, mini-melf, SOT-23 etc.  These all relate to different package sizes and types.  Its difficult to know them all.  I learn as I go and check the datasheets for the parts I intend to use...datasheets are to electronics design engineers as recipe books are to chefs!  The dimensions for 0805 packages and the SOT-23 package are below:

The mechanical information is useful as it gives the designer an idea of how much space each component will take up on the printed circuit board.  Luckily all of this information is already available in Eagle - that is why CAD design packages are so useful - they save the designer having to check this information and draw each component to scale...

From the previous post here is the sketched schematic diagram:

Let's input the schematic diagram into Eagle 7.1 and while we are doing that select the component packages we intend to use.  I'm going to show two versions of the circuit, one using through hole components and the other using surface mount 0805 packages and a SOT-23 package.

If we load up the EAGLE 7.1 we are presented with the following screen:

Click on the eagle folder menu and expand it - if like me you have used eagle previously there are lots of projects not there will be nothing present.  Lets create a new project - click on the file menu and the new option followed by project.

I called mine light dark can be anything you like but I would suggest something that relates to the circuit function so you remember what it is...

Next click on the eagle folder and expand it and navigate to your newly created project.  Then right click on the icon and from the menu select 'new schematic'

A new window will appear which looks like this:

At this point its a good idea to save the file - again choose a sensible name so that it is easy to remember.  I chose light dark detector....

Next click on the 'add parts' icon on the tool bar on the toolbar on the left side of the window, it looks like a two pin electrical plug:

A new window will appear with a list of the available component libraries and a search field and some options - type frame into the search field and press enter...

The library contain all of the different types of available frames is displayed - select 'A4L-LOC' and click the 'OK' button.  This selects an A4 landscape frame with a title block in the right hand corner.  It makes our schematic look all 'professional'!!  I chose A4 because that is my standard paper size for my printer - there are plenty of other options.  Choose the size which suits your situation.

Place the frame in the schematic editor workspace at the 0,0 co-ordinate which is highlighted with a cross.

Press the 'escape' key on your keyboard to stop placing another frame object and return to the select parts window.  Press the 'cancel' button to close the add parts window and return to the schematic editor...If you look in the bottom right hand corner of the frame you should see the file name and the sheet number - cool huh!  I like to save the schematic at this point as it then refreshes the title block with the time and date:

It is now time to add the symbols for our circuit components.  We need to select 3x resistors, 1x 5mm LED, 2x T092 Transistors, a 5mm LED and a battery symbol.  Click on the add parts icon again in the tool bar.  All of the available libraries will then be displayed.  Inside these libraries are the symbols and the mechanical footprint sizes of all of the available parts.  This is what makes Eagle so useful - there are loads of libraries with all of the most popular components already available!  Lets search for a 1/4 W axial resistor, type resistor in the search box and press enter.  All of the libraries with resistors parts present in them will be displayed.  Scroll down the list until you locate the 'resistor' folder and then expand it and select the 'R-US_' sub folder and then finally select the R-US_0204/7 object.  This is a through hole package for a 1/4 watt resistor using the American style schematic symbol.  Even though I'm a shamelessly British I've always used the American symbol for resistors - don't know why and it doesn't really matter.  The IEC symbol is also available....In the top right of the screen it shows the schematic symbol in red and the package with rough dimensions.  If you were to scroll though the different library objects you will see all of the different package options and symbols for a resistor.  It's up to you to select the correct type and orientation for your project.  In this case as we are using a 1/4W through hole resistor I've selected a the correct package for a horizontal orientation when the component is mounted on the printed circuit board...

Now click on the 'OK' button and then click the left mouse button three times within the frame to place three resistors.  Then press the 'escape' key and click cancel.  The add parts window closes and we are presented with the schematic editor workspace containing a frame and three resistor symbols.

At this point I like to add the values for the components I've just entered.  There is no hard and fast reason to it's just something I like to do...I think it's better to ensure all of the information relating to the circuit is added before we start making connections.  On the schematic editor work space click on the 'value' icon on the toolbar on the left side, it's highlighted in the screenshot below:

Next click a resistor symbol...A 'value' dialogue box will appear where you can enter the value for the resistor:

Repeat the process for the other two resistors (330, and 1000) and then click on the add parts icon on the toolbar - it's time to add the rest of the components.  Lets do a search for an LDR... part name found.

OK let search for light dependent resistor...

Ah part name found, disappointing -

OK -

Lets do a wildcard search for any parts with the word light present in it's description or name - type "*Light" in the search box (the test between the quotation not include the quote marks) and lets see what the wildcard search finds....

Yet again no match was found.  Not to worry this does happen, quite a lot unfortunately.  Because there are so many different electronic components available it is difficult to write and compile software that contains the schematic and dimensional information for every package.  We have two choices at this point.  We can use the eagle software to actually draw a schematic symbol for a light dependent resistor or we can search online for an external eagle library which already contains the schematic symbol and package information.  There are several hundred eagle libraries available and the cadsoft website has a download area where a great deal of these can be obtained.  The trick is knowing what to look for...

When I performed a google search for "LDR Eagle package" nothing useful really popped - apart from a link to my blog and the previous post <grin>...So let do something else.  Lets install some external eagle footprint and schematic symbols libraries.  Two electronic hobbyist component distributors making a big name for themselves (rightly so) are Sparkfun and Adafruit.  I often buy their products and make use of the information on their websites.  Something that they also do which is very cool and kind is they have shared the eagle footprint libraries for the components they use when designing their PCBS - they also use eagle!  Lets download the Sparkfun Eagle library and the Adafruit eagle library:

SparkFun Eagle Libraries github link

Adafruit Eagle Library github link

Now open a file browser and navigate the folder where your projects are stored, mine was:


Create a folder within this directory called 'ext_lbr' or something similar.  I used 'ext_lbr' because it's my shorthand for external libraries.  You could use anything you liked however make a note of the path and directory because we will need it...

C:\Users\Alex\Documents\eagle\ext_lbr - the path to your folder will be different...because your username probably won't be "Alex"

Copy the two zip files downloaded and extract their contents into this folder.  Only the files with the extension .lbr are needed.

Now return to eagle and click on the 'Project' Screen, then select the options menu followed by 'directories':

A new window will open displaying the current paths which Eagle associates with external files such as libraries, user language programs, design rule checks etc.  Enter the location of the folder we just created for external libraries or browse to it and click ok.  If you are going to type in the location remember to add a semi-colon to what is already present:

If you are going to type in the location remember to add a semi-colon to what is already present:

Click on OK and then return to the schematic editor window.  Save your work and then exit eagle and reload it...and then reload the light dark detector project.  We have now added some extra component libraries to Eagle.  What we now need to do is tell our schematic editor that we have added some new libraries and use them:

In the Schematic Editor click on the library menu and then click on 'Use':

Navigate to the 'ext_lbr' folder and select all of the files inside and click 'open':

 and if we now perform another search for *light we should get a few hits.  It takes a few moments to 'parse' the new libraries:

Here is what should appear:

There should now be several results present....navigate to the Sparkfun-Sensors folder and click on 'PHOTOCELL'.  Then select PHOTOCELLPTH and click OK.  The through hole version of an LDR will be added.  For completeness a CdS cell is another term used to describe an LDR - CdS stands for cadmium selenide which is the material that has the property of changing electrical resistance in the presence or absence of light...

Next assign a value to the LDR by clicking on the add value button as before.  A message will be displayed saying that the part has no definable value and do you want to define one...say yes although it is up to you...I prefer to add a component value so I typed '10k LDR':

Click OK and then click on the add parts icon again on the toolbar on the left side of the schematic editor and search for 'BC548'.  It should be found without too much difficulty....add two of these components and then press the escape key to return to the add part window.  This adds the symbol and package for a BC548 transistor using the TO-92 footprint.  

Now search for 'LED'.  Again plenty of results should appear, navigate to the Adafruit library and LED folder and then select the 5mm LED package and symbol and click 'OK'.  Place an LED on the schematic drawing and press escape...

Like with the transistors this adds the schematic symbol for a 5mm LED and the associated footprint.

Next for completeness we need to add a battery symbol.  So lets search for a battery symbol:

I selected an AA battery although it doesn't really matter, choose whichever symbol suits you.  I intend using a battery holder for my circuit and I'm only adding this symbol for completeness. Return to the schematic editor window by pressing the escape key and then assign a value to the battery (6V) and then click 'Ok'.

We now have all of the schematic symbols present with their associated values and are now ready to lay out the schematic and draw the connection lines.  Click on the 'Move' Icon from the toolbar on the left side of the screen:

Now click on each component and arrange them similarly to the sketch.  Most electronics engineers use the convention for schematic diagrams of inputs on the left and outputs on the right but there is no hard and fast rules on this.  Space each component apart so they can be clearly identified.  Place the battery and LDR (input) on the left side of the sheet and the LED (output) on the right side of the sheet.

Finally we need to add the connection lines or 'Nets'.  The normal convention is to use straight lines to connect each component.  Click on the 'Nets' Icon on the toolbar on the left side of the schematic editor:

Next click on one of the 'legs' of the battery symbol and a straight green line will appear.  Move the mouse pointer up vertically until a line of satisfactory length is present and then click the left mouse button.  You can then change the direction of the line from vertical to horizontal:

Extend the line and click the left mouse button as required until the resistor labelled R3 (330 Ohms) on the right of the diagram is connected to the battery.  You could connect to any of the resistors but I like to do the first component to the last component first so that it's then easy to connect the rest of the components.  There are no rules long as all of the components are connected together as per the sketch our circuit and our PCB will work correctly.

Next connect R3 to LED1 and then LED1 to the top connection of transistor Q2.  Finally in a square sort of connection connect Q2 to the bottom connection of BAT1.  There should now be a green path of connections around the components:

You may also have noticed that I moved the Q1 transistor and the LDR and R1 to match the positioning shown in the sketch...

Next its time to connect all of the rest of the components as indicated in the sketch.  Click on the 'Nets' icon and connect everything up.  Once finished you should have a completed diagram which is similar to the sketch and the picture below:

At some point when making connections you will have been asked whether you wanted to 'Join Nets' together.  The correct answer is yes...its the software checking you meant to make a certain connection.

Finally before we create a PCB layout drawing file we should really ensure all of our connections drawn are correct electrically and we haven't missed anything out.  Click on the electrical rules check icon on the toolbar on the left side of the schematic editor window:

A window will appear in the bottom right corner of the schematic editor below is what mine looked like:

Any yellow exclamation mark symbols show a warning; the electrical rules checker is telling me that I connected the positive and negative terminals up to two specific 'Nets' and that the FRAME1 symbol used has no value associated with it and that the LED1 symbol used has no value associated with it.  At this point you as the user can choose to do something about these error messages or ignore them by 'approving' them.  I would ignore error messages at your peril and warning messages should also be checked and either 'fixed' or at least 'processed'.

The first warning relates to the battery positive connection being connected to the other components via the 'net' N$1.  If your schematic diagram matches the diagram above it is supposed to be connected.  Therefore we can approve that warning to remove it.  Click on the warning to and then the approve button to 'approve' it:

Click on the second warning and approve that also as it is similar to the first warning and relates to the battery negative terminal connection.

The next two warnings relate to the fact that the FRAME1 symbol and LED1 symbol have no value associated with them.  It isn't really necessary to add a value to the FRAME1 Symbol because it isn't an electronic component.  You could do if you wished to but I normally just approve this warning. The same can also be said the for LED1 warning although in this case I would add a value so that at least the schematic points to the size of LED we are going to use.  Right click on the LED1 symbol to add a value and then click processed on the ERC errors window.  Now close the ERC window. Now is an excellent time to save all of your hard work and to print out a copy of the schematic diagram!

Finally after all that we get to create a PCB - click on the 'Switch to board' ICON in the top middle toolbar of the schematic editor, you can also click on the file menu and navigate to 'Switch to Board':

The following dialogue box message will be displayed:

Click on the 'Yes' button and the PCB editor screen will be displayed.  At this point I like to save the files and print a copy of the schematic.  Keep hold of the printed copy as we will be referring to it later.  It's much easier to lay out a PCB with the schematic handy.  As this post has become really long I'm going to go through the PCB layout in the next post.

That's all for now - Langster!

No comments :

Post a comment