Chapter 2
Your First Board: A “Learn to Solder” Badge

For our first PCB project, we’ll start with a staple of many Maker Faires: a “Learn to Solder” badge. This is the simplest of circuits: two cycling RGB LEDs and a battery clip (see Table 2-1). Your goal of this project is to get comfortable navigating EAGLE’s toolbox and layers. You’ll also see how to create custom silkscreen graphics and nonrectangular outlines.

Table 2-1: Blinky badge bill of materials

PartSourcePrice ($)
(2) Cycling RGB LEDsMicrotivity IL603.20
Through-hole CR1220 battery clipDigi-Key 3000k-nd.42

To make this kit in a workshop setting, you’ll also need some tie tack pins.

Figure 2-1 shows what the finished product will look like.

c02f001.tif

Figure 2-1: A successfully soldered blinky badge board. These RGB LEDs have a forward voltage of about 3V and slowly cycle through different colors.

Start with the Schematic

The Schematic Editor is where we connect all the components in the circuit with networks of signals. Chapter 3 has a more robust example of creating a schematic; this first project will have a very simple schematic. You’ll be using many of the tools in the schematic toolbar shown in Figure 2-2.

c02f002.tif

Figure 2-2: The Schematic Editor and the Board Editor share many of the same tools, with a few differences.

EAGLE separates CAD drawings into color-coded (and numbered) functional layers. In the Schematic Editor, part outlines are on the Symbols (94) layer, labels on the Names/Values (95/96) layers, and nets or signals on the Nets (91) layer. You can show or hide the layers using the View Layer Settings menu. The current layer will show in the toolbar, so check that often to make sure you’re drawing into the right layer.

To start, open the Schematic Editor by selecting File New  Schematic. The first tool you’ll use is the Add tool, which allows you to add a symbol to the schematic area from one of EAGLE’s device libraries. Chapter 4 shows how to create your own device libraries, but for this first project you will work with the Jumpstart library that you installed in Chapter 1.

Use the Add tool to select the“CR1220TH” and“LED5MM” parts, which you can place anywhere on the schematic, as shown in Figure 2-3. One thing you’ll notice is that the naming of devices and packages is nonstandardized, so you may have to pick your way through a bunch of jargon when trying to find parts by different manufacturers. With EAGLE 8.7, Autodesk has put a lot of effort into library management (see “Libraries” in Chapter 1), but you may still want to spend some time looking through the libraries to get your bearings.

c02f003.tif

Figure 2-3: Place the three components somewhere on the schematic layer. Use the Zoom To Fit tool to change your workspace to match your part layout.

In EAGLE, parts are connected using the Net tool, the green drawing tool near the bottom of the toolbox. Each signal net that you draw has a unique name, and nets have the special property that anything with the same name will be considered connected to the net whether or not they are visually connected by a line. This allows for much cleaner schematics, but also means that you need to be disciplined and organized about naming your nets (see Chapter 3). Start connecting the battery and the LEDs using the Net tool as shown in Figure 2-3.

In Chapter 3 you’ll make a much more involved schematic and be more explicit about labeling voltages and ground signals, as well as use the built-in Electrical Rule Check to proof your schematic. For this first project, you’re all done with the schematic if it looks like the one in Figure 2-3; time to move on to laying out the board!

Laying Out the Board

Switch to the Board Layout tool using File Switch To Board. Your parts will initially appear to the side of your work area. Select the Move tool and grab each part by its origin crosshair to move it onto the white work area. The default white work area is about 6×4 in the educational version; resize it using the Move tool to shrink the boundary lines to about 1.5 square (Figure 2-4), and then move the parts to the workspace (Figure 2-5).

c02f004.tif

Figure 2-4: Connect the positive side of the battery clip to the anode (positive) side of the LEDs (top), and then the negative sides to the cathodes (bottom).

c02f005.tif

Figure 2-5: Move the parts to the workspace. Note that in the educational version of EAGLE you cannot place objects outside the work area once you have picked them up.

You’ll notice the yellow lines connecting the various pads of the circuit; these are airwires that show the connections that were made in the schematic tool. These airwires are a map for routing the connections between the various parts.

One of the first things you should do when routing a board is check the grid. Anything you draw or place will snap to the grid; the grid can be your best friend, or it can be frustrating if parts get “off grid.” The default grid is 100 mils (100 thousandths of an inch = .1), which is standard spacing on wireless breadboards or headers but is too coarse for most routing. Select View Grid and set the grid to 50 mils (.05) to start.

You can use the Move tool to manually position parts, or you can use the Info tool to set a part’s position by typing in a value. For this project our parts need to match up with a silkscreen layer perfectly, so we will use the Info tool to type in exact x- and y-coordinates. For each part, type in the coordinates shown in Table 2-2 and click OK.

Figure 2-2: Coordinates for the parts in the project

PartPosition X (in.)Position Y (in.)
LED1.32.78
LED2.92.80
BATT.68.29

There are many ways of routing traces in a circuit, and EAGLE also has an Autorouter tool that applies some machine learning to more complicated routing problems. For the circuits in this book, we will manually route the traces.

Select the Route tool from the bottom of the first section of the toolbox. A toolbar will appear that allows you to control various routing behaviors, as shown in Figure 2-6.

c02f006.tif

Figure 2-6: The Routing toolbar selects the layer and trace width, and also provides various constraints and helper functions for making routes that follow your design rules.

Start by connecting the LED cathodes and the negative pad of the battery on the bottom layer (blue traces), with a 16 mil (.016) trace (Figure 2-7). Note that the pad/negative side of the battery clip is on the bottom (blue) layer in the library. The green pads are plated-through so they appear on both the top and bottom layers.

c02f007.tif

Figure 2-7: Routing the bottom copper traces (left) and top copper (right)

Sixteen mils is a good starting point for general-purpose traces; you’ll usually be able to fit in between pads without changing layers, though sometimes you may need to go down to 10 mils or so. Most general-purpose PCB houses guarantee a lower limit of 6 mil traces for bulk PCB etching.

Adding a Custom Silkscreen and Outline

If you don’t change any of the default settings, the Dimension, tPlace, tNames, and tValues layers will be included on the silkscreen layer. To see what the silkscreen layer looks like, go to the Layers menu and deselect all layers except those four. You’ll also be able to preview the silkscreen layer when you go to make your final manufacturing files.

When adding text to the board, you should keep some general guidelines in mind. PCB manufacturers use different resolution meshes in their silkscreens and generally use a screen that’s just fine enough to get the job done. If you have very fine lines they may not reproduce well; a general rule of thumb for text is that the smallest size should be 32 mil or so, and the thinnest line of a letterform should be around 5 mil. To achieve this, zoom in on your finest letterforms and use the Ratio property to adjust the text to a proper weight. A 15 percent ratio at 32 mil is a good minimum guideline.

In this first project, we’ll use the Text tool only to add some polarity indicators on the LEDs; everything else will be a custom image. You can use this technique to put a logo on your board, or you can design your entire silkscreen layer in a graphics program to use whatever typefaces and graphics you want.

To make a custom silkscreen bitmap, get a PNG version of your board layout to draw on top of. The following steps show one way to accomplish this, which assumes you’re using the Inkscape vector drawing tool. The important part is to get a PNG image of your board that is the same dimensions as the EAGLE representation:

  1. Select only the Pads, Vias, Dimension, and tPlace layers from the Layers menu.
  2. Choose File Export Image.
  3. Fill in a resolution of 920 pixels per inch. Inkscape imports images at 92dpi by default. We’re going to be scaling it down to 10 percent of the original size to get a nice, sharp image.
  4. Open your vector drawing program (Inkscape in this case) and import the board PNG.
  5. In Inkscape, select Object Transform Scale and scale the imported PNG to 10 percent of its size.

Now that you have a nice, clean image of the board as a background, draw the silkscreen image using the vector tools. For this project you can use the files that are included in the GitHub repository if you want to skip the drawing step. In Inkscape, select just the black vector objects (not the original board PNG) and select Export. Export the PNG at a high resolution (400dpi is good for most PCB manufacturers).

Next, convert that PNG to a black-and-white BMP image. If you exported it from Inkscape, you’ll need to flatten the image as well to remove the transparent background. In a raster image editing program like the GIMP, open the file and then perform these steps:

  1. Select Image Flatten Image.
  2. Select Image Mode Indexed Use Black & White (1-Bit) Palette.
  3. Select File Export Windows BMP Image (.bmp) (Figure 2-8).
    c02f008.tif

    Figure 2-8: The dialog box for the Import Bitmap command

Next, return to EAGLE and import the bitmap onto a layer of your board. Select File Import Bitmap. This runs an EAGLE plugin (or user-defined program [UDP]) that is also available under the UDP menu.

Specify the color you wish to import (black), select DPI as the format, and enter 400 under Dots Per Inch. Use the default layer 200, though you can import bitmaps to any layer you want, even the top and bottom copper or stopmask layers.

The script will import the bitmap onto the layer you specified, and it will translate the image into hundreds of horizontal lines. You won’t be able to edit it directly, and all the lines must be moved as a group. It’s a little clunky, but here’s how to move the whole silkscreen image:

  1. In the Layers menu, select only the 200 bmp layer.
  2. Use the Selection tool to grab the whole image.
  3. Select the Move tool.
  4. Right-click on one of the lines in the image and select Move Group.
  5. Turn the other layers back on now that the image is selected.

If you placed the LEDs and the battery clip in the exact positions mentioned earlier, the silkscreen should import exactly aligned with the parts. When you go to make the final Gerber files in the next section, be sure you assign layer 200 to the silkscreen section of the CAM job.

Finally, to make a custom outline for the PCB, you can draw into the Dimension layer. The outline must be a watertight rectangle or polygon; EAGLE 8.7 introduced a special layer that is generated during the CAM process called the Board Outline. The outline is calculated based on the shapes on the Dimension layer. Any outline will define the shape of the board, and any closed polygons inside the bounds of the shape will be interpreted as cutouts.

Making Gerber Files for Manufacturing

The files you send to the PCB manufacturer are in the Gerber file format, a standard CAM file format for PCBs. Gerber files are created using the CAM Processor, which is available by selecting the Manufacturing tab to the right side of the Board Layout tool window. When you first open the Manufacturing tool, you’ll see a rough preview of what your board will look like if you run the default template for the CAM tools, as in Figure 2-9.

c02f009.tif

Figure 2-98: Drawing an outline into the Dimension layer with the Polygon tool. Note that the outline needs to be watertight, so you can’t import a bitmap to define the outline.

To create the CAM files, open the CAM Processor from the File menu. Note that this tool is context-sensitive whether you’re in the schematic or board view, so make sure you’re in the board view. Open the excellon.cam job to create the drill files (with extensions .dri and .drd). You only need the DRD file; the DRI is just metadata.

Next, generate the Gerber files by opening the template_2layer. cam job as in Figure 2-10. The only section you should need to double-check at this point is the Silkscreen tab (Figure 2-11); if you’ve added a bitmap layer (or don’t want a layer on the silkscreen), be sure to assign the correct layers on that tab.

c02f010.tif

Figure 2-10: The CAM Processor

c02f011.tif

Figure 2-11: Removing tPlace and tNames from the Silkscreen Top and adding 200bmp, the custom bitmap layer

To preview your files you’ll need a Gerber viewer tool. Gerbv (Figure 2-12) is a good open source option if you’re on a Unix-based system, or you can use ViewMate on Windows. If you’re on a Mac, Gerbv is a little tricky to get up and running, so you should try to use a package manager like MacPorts to install it. The easiest solution to previewing Gerber files is to use the free online tool from CircuitPeople.

Import the layers into your Gerber viewer (Gerbv is shown here). I usually reorganize them from top to bottom to make it easier to proof:

  1. .drd
  2. .plc
  3. .stc
  4. .cmp
  5. .sts
  6. .sol
    c02f012.tif

    Figure 2-12: The Gerbv tool, part of the open source gEDA suite of tools

Turn each layer on and off and inspect; if you tweak the layout, rerun the CAM Processor.

Bundle them up and send them out. A great service for small runs is OSH Park, which grew out of the DorkbotPDX service and merged with SparkFun’s BatchPCB service. The interface is well designed and service is quick and consistent, with a free shipping option. Your board will be bundled with dozens of others and will come back with a distinctive purple soldermask. If you need more than a dozen boards, it is more economical to go with another service. There are many competitive options (and more popping up in the United States); I’ve had good luck with the affordable PCBCart service.

Going Further

A great way to extend this project would be to add a switch. The battery lasts about four days, but it would be nice if you could turn it off. If the switch is a through-hole part, you’ll have to think about how it affects the front-side design. If it is surface mount, you’ll have to think through how you’ll teach kids to solder it easily.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset