Exporting Gerbers From Eagle

By Mattyc

Eagle is a PCB design package developed by CadSoft and an excellent tool for hobbyists and professionals alike.  Their standard licenses, although a little limited (max board size = 160mmx100mm), are far more affordable than other commercial packages such as Altium Designer.  They also offer a feature-limited free version which is only for non-profit uses.  This has lead to a mass of hobbyists and makers choosing to use Eagle to design their printed circuit boards.  

Gerber files are what your PCB fabricator uses to manufacture your PCBs.  They describe the circuit board you've designed in your PCB design package.  Each gerber file describes a different layer from your PCB design software.  In this article I'm going to describe how to export these gerber files from Eagle.  In specific we'll export the gerbers for a board with two copper layers and two silkscreen layers.

1. Open the Board File

Open your board design file in Eagle (File->Open->Board...).
Open Board

2. Run DRC

A Design Rule Check is an automated check run by Eagle which determines whether any design constraints are being violated in your design.  For example, your PCB manufacturer may specify that the minimum width of a trace they can manufacture is 6mil.  You will set up a number of design rules in Eagle which specify the manufacturer's requirements.  One such rule will specify that the minimum trace width is 6mil.  When the DRC tool in Eagle is run, if any trace has a width of less than 6mil, you'll get an error message and be notified that you must change the width of the offending trace.  Other design rules checked may include minimum trace spacing, minimum hole size and component to board edge clearance.
Usually, the design rules must be input manually based on your manufacturers specifications.  This isn't difficult but is beyond the scope of this tutorial.  Your manufacturer may have their design rules described in a .dru file available for download which can be imported into Eagle.  
If you're ordering a board from Breadboard Killer you can download our Eagle design rules file from here (right-click->save as...).
To load the design rules file from your manufacturer click "Tools->DRC..." and then click the "Load..." button.  Open the manufacturer's .dru file and then click the "Check" button to run the DRC check.
If you have errors, then the DRC Errors window will appear and list the problems with your design.  If it doesn't show up click "Tools->Errors..." to view the DRC Errors window.  If there are errors in the window go through and fix each one.  If a listed error is not an issue, click on the item and then click "Approve" at the bottom of the DRC Errors window to move the item to the Approved section.  Be careful though, if you ignore an error that violates an important design rule there may be physical problems such as short circuits when you get your board back from the manufacturer.  Once you've fixed or approved all of the errors, it's time to export the manufacturing files.
Tip: If you're getting trace clearance and width errors even though they are within the constraints from your .dru file, check the net class specific constraints.  Click "Edit->Net classes..." and make sure the values for each net class are the same as in your .dru file (Width and Clearance values should be 6mil for Breadboard Killer boards).

3. Export the Manufacturing Files

Eagle needs to know what gerber files to output and what layer information to put in each file.  This file contains that information and can be opened in Eagle.  First, save the file linked above (Right Click->Save As...).  Then, in the board designer in Eagle click "File->CAM Processor...".  In the CAM Processor window, click "File->Open->Job...".  Navigate to the .cam file you downloaded above (gerb274x_2layer_2side_silk.cam) and open it.  Click "Process Job" and the gerber files will be generated. 
That's all the gerber files generated but we need one more file before we can submit our design to the manufacturer.  That file is an Excellon or NC drill file which describes where all of the drilled holes are on the board.  To export an NC Drill file, go back to the CAM Processor window in Eagle and click "File->Open->Job...".  Navigate to the "cam" folder within your Eagle program directory (eg. "C:\Program Files (x86)\EAGLE-6.6.0\cam") and open the file called "excellon.cam".  Important: Change the device in the output section from EXECLLON to EXCELLON_24.  This will ensure your drill files are scaled the same as your gerbers.  Finally, click "Process Job" to generate the NC Drill file.
If you've followed the steps above correctly the following files should have been created in the same folder as your board file (.brd).
  1. A top copper layer with a file extension of .cmp (stands for component side).
  2. A bottom copper layer with a file extension of .sol (stands for solder side).
  3. A top soldermask layer with an extension of .stc (stands for solder stop component side).
  4. A bottom soldermask layer with an extension of .sts (stands for solder stop solder side).
  5. A top silkscreen or overlay layer with an extension of .plc (stands for place layer component side).
  6. A bottom silkscreen or overlay layer with an extension of .pls (stands for place layer solder side).
  7. A board outline file with an extension of .oln.
  8. A excellon drill file with an extension of .drd.
  9. A Drill Rack file with an extension of .drl.


4. Check the Gerbers

Once the gerbers have been generated it's best to check them yourself with a gerber viewer to make sure the process went smoothly.  A good free gerber is gerbv which can be downloaded from here.
Once you've downloaded and installed it, open gerbv and click "File->Open layer(s)..." then select the first 8 files listed above (exclude the .dri file).
The files are opened in the gerbv viewer.  Make sure they all line up properly and that there are no obvious errors.  You can turn layers on or off with the check boxes in the Layers payne on the left.  The example in the animation above shows successfully created gerbers with no errors.

5. Zip the files

It's best to supply your manufacturer with a single file rather than nine.  Use a tool such as WinRAR to zip the nine files listed above and send this archive to your PCB manufacturer.  They will usually do a few checks themselves to make sure your board is able to be manufactured but it's best not to rely on them for this.

6. Get your Boards (the fun part!)

Receive your boards from the manufacturer and proceed to build it up and find the bugs you've inevidibly missed.