User Tools

Site Tools


Table of Contents

Translations of this page are also available in the following languages: Français, Русский.

Footprint issues

I have a question relating to footprints

See the PCB footprints page.

About PCB layout and routing

  • This page contains gEDA/PCB Specific information about laying out circuit boards.
  • Also see the gEDA/PCB Glossary of Terms.


Where can I read about the basics of using pcb?

The pcb manual contains a concise description of the user interface in the section "Getting Started".

Is there a way to save the file as an older version?

As new features are added to the file format, older versions of pcb might choke on portions of the layout using the bright new features. To prevent this kind of misbehavior, the pcb file contains a note on the minimum version string for the binary. Older versions of pcb refuse to load a layout saved by a newer pcb binary. This was the case for the addition of holes in polygons in 2010. You need a pcb that was compiled from source later than June 2010 to open these layouts.

Unfortunately, there is no way to save the layout in a way that allows older versions of pcb to read the file. However, if don't use the holes in polygon features, you can just hand-edit the file version header back to 20070407 and open the file with the older pcb binary.

I found a bug! What can I do about it?

  1. Start by reading the pcb bug reporting page.
  2. Check, what it needs to reproduce the bug.
  3. Ask on the geda-user mailing list if there is a work around, or has been dealt with in the bleeding edge version of pcb. Note that you must subscribe to the geda-user e-mail list before you can post to this list.
  4. Check, weather the issue is already in the bug tracking system of pcb. If not, file a bug report. Make sure to give every information necessary to reproduce the bug and add the version of pcb that contains the bug.
  5. Finally, as with all open source projects, you may flex your programming muscles and try to squish the bug yourself. Please file a patch of the changes you had to make to the bug tracking system. The patch will be gladly accepted to improve the next release of pcb.

How can I set the manufacturing rules to use (i.e. drill diameters, trace width/space specs)?

This topic is covered in the manual.

Non-obvious aspects of the GUI

Auto-pan bugs me. What can I do about it?

The auto pan feature was removed in September 2011. So install of a more current version might help.

If you use an older version of PCB, you can do this:

  • You can tell, whether the screen will auto-pan by looking for little squares at the end of the cross hair cursor.
  • Auto-pan can be toggled during move with a right mouse button click.
  • Auto-pan speed can be set in $HOME/.pcb/preferences

The delete key sometimes refuses to delete

Probably you try to delete a selected object. In pcb the Delete button does not act on the selection, but on the object currently under the mouse. Consequently nothing will be deleted if an object is selected and the mouse hovers at some other place. Bottom line: Just position the mouse over an object and press the Delete button. No need to select the object.

However, you can delete the current selection with the Backspace key.

I try to move an object, but pcb won't let me!

Most probably the object is locked. Locked objects won't highlight. To see, whether it indeed is, Select all connected objects from the Select menu. Locked footprints are shown with a little L at their diamond shaped insertion mark. Use the lock tool to unlock the object in question. Note, that the lock tool always toggles the lock state of the object you click at. Afterward, an object report pops up that contains the lock state in the last line.

If you want to remove all locks, you may consider to remove all instances of the string lock in the *.pcb file with your favorite ascii editor.

A different reason for numb objects is “Only Names” in the settings menu. When checked, the selection tool will exclusively act on text. This is useful with crammed layouts. There is a complementary setting “Lock Names”, too.

Component placement

How do I rotate a selection (i.e. of more than one item)?

  1. Select the items
  2. BufferCut selection to buffer
  3. BufferRotate buffer 90 deg CCW (or CW)
  4. Click anywhere on the board and the selection is pasted on the design again.

Note: Square pads may not clear polygons correctly. Rectangular pads are ok, though. This is a known issue caused by the difficulty to know the reference direction of a square pad.

How do I rotate objects by an arbitrary angle?

  1. Cut the object into the paste buffer.
  2. Type “:FreeRotateBuffer(45)”. The : key will open the command line. Replace “45” with the angle you want to rotate by.
  3. Paste the object back to your board.

Note: For internal reasons, FreeRotateBuffer does not work with exact squares. As workaround use two or more polygons that add to give a square.

How do I move objects by an arbitrary distance?

  1. Let the mouse hover over the object to be moved.
  2. Type “:MoveObject(x,y,unit)”. The : key will open the command line. Replace “x” and “y” with the desired coordinates and “unit” with either “mm”, or “mil”.
  3. Type Enter.

If both coordinates are prefixed with a “+”, or “-” the move is relative to the current position. Else the object is moved to absolute coordinates.

How do I move objects to an absolute location?

Use the command “MoveObject()” as described above.

How do I change the size of a graphical object (such as text, silkscreen lines, etc)?

  • Mouse over the object and hit S. This will increase the size of the object you are mousing over.
  • Mouse over the object and hit Shift+S. This will decrease the size of the object you are mousing over.

You can alter the increase/decrease quantum using the FilePreferences…Increments menu. (Note, this setting is currently broken)

How do I put components on both faces in PCB?

There are two ways to do it:

  • Pressing the Tab key will alternate the active side between the component and solder sides. When you place components, they will go on the active side.
  • If you are viewing one side of the board, place a component there and (with the cursor over it) press the B key (which means, send the component to the Back side) the component go to the other side of the board.

I can't move the components on the other side of the board!

The mouse is only sensitive to components on the active side of the board. This prevents ambiguities with components placed on both, top and bottom. By default, top side is active and the bottom side is the “far side” whose components are ignored by the mouse. You can swap the roles of the sides to make components on the far side accessible. The key-accels Tab, Shift+Tab, Ctrl+Tab and Ctrl+Shift+Tab will do the trick. These accels combine the swap with different vertical and horizontal flips. Specifically:

  • Tab : swap sides and mirror along horizontal axis. This is like flipping a real board upside-down.
  • Shift+Tab: swap sides and mirror along vertical axis. This mimics flipping a real board like a page in a book.
  • Ctrl+Tab: swap sides and mirror along both axis. That is, do an inversion. This cannot be done with a real board …
  • Ctrl+Shift+Tab : No mirroring, just swap front side and far side. This is like an x-ray view.

How do I know, which side a component sits on?

If the component is on the currently far side of the layout, its silk layer is drawn in grey. If unsure, deactivate the far side with the “far side” button, at the bottom of the layer button row. This should remove the silk of all far side components from the view.

How do I define a silkscreen layer for the other side of the board?

Although only one silk layer button is visible in the GUI, silkscreen for both sides is automatically configured. In default view the silk layer button refers to silkscreen on the component side of the board. To place text or lines on solder silk you have to flip the board with the Tab key (or Shift+Tab if you prefer a left-right flip). This is like physically turning the board to the other side. It turns the solder layer on top, and component layer on bottom. Objects on component silk layer will be greyed out. If you draw to silk, lines will always go to the current top silk layer, which is solder now. The same happens to components and their silk screen. Flip the board again to return to default view.

Why text I add to the solder side not reversed?

Add it while the board is flipped (Tab). Just selecting the solder side is insufficient. New text always reads correctly from the side you're looking at.

Is it possible to use an arbitrary grid spacing?

Yes. You can use the command setvalue(grid,value,unit). To do this:

  1. Type “:SetValue(grid,=x,unit)”. The : key will open the command line. Replace “x” with the desired grid spacing and “unit” with either “mm”, or “mil”.
  2. Type Enter.

How do I set the origin in pcb?

The absolute origin is always in the upper left corner of the accessible area. This cannot be set to some other place. However, coordinates of objects can also be given relative to the current grid. In the GTK2 version of pcb coordinates are shown in the upper right corner of the main window. The right pair is the absolute position, while the left pair reflects the position relative to an arbitrary marker. This marker is set to the current position of the mouse by the key sequence Ctrl+M. You may want to set the marker to a grid point or a specific pin.

How do I measure distances and dimensions of components?

Use Ctrl+M to set the origin and read the distance of the mouse pointer relative to this point on the upper right of the pcb window. Some objects like vias and tracks yield useful information in object reports. Access the report of the object currently under the mouse pointer with Ctrl+R.

How do I hide rats of specific nets?

In the netlist window, doubleclick on the specific rat name, then press O on your board window. Your rats are hidden for that net. In the Netlist window an asterisk appears in from of the rat name. To reverse: follow the same procedure.


How do I route a connection from solder to component side and back?

While using the line tool, use the number keys on top of the keyboard to switch layers. A via will be placed automatically at the endpoint of the last complete segment.

How do I change the routing style?

There is a set of predefined sizes for routing. The sets bear suggestive names (Signal, Power, Fat and Skinny). Hit the button “Route Style” to configure the sizes of the current set to your needs. You can set the names and the default values of these parameter sets in a config file ( ~/.pcb/settings for the GTK-HID, or ~/.Xdefaults for the Lesstif-HID). Example for such a setting:

route-styles = Signal,1000,3600,2000,1000:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600

Be sure, to remove any route-style line in ~/.pcb/preferences . Else, the line in settings will be ignored.

The line tool knows about different modes to deal with transversal connections. The status line on the bottom of the page tells, which mode is in effect:

  1. 45° plus vertical/horizontal (status line: “\_”)
  2. vertical plus 45° (status line: “_/”)
  3. either vertical or 45° (status line: “45”)
  4. arbitrary angle (status line: “all”)

The way to access these modes differs among the GUI versions. The current GTK snapshot (v20060288) defaults to “_/” but can be temporarily turned to “\_” with the Shift key. You can switch to 45° mode with the slash key /. For arbitrary angles, press the period key ., or choose 'All-direction' lines in the Setting menu.

Routing Issues

I got stuck! How do I go back?

The universal undo key U works even while in the middle of track layout actions. It will remove the last segment but keep the line tool attached to the mouse. So you can immediately go on routing and find a better way.

How do I move one set of layer tracks to a different layer?

  1. Select the tracks. It’s easiest to do this if you shut off everything but that layer first (i.e. silk, pins, other layers, etc).
  2. Now set the current layer to be the new layer. Yes, the layer might get displayed; not a problem as you’ve already selected the tracks you want.
  3. Press Shift+M to move all the selected tracks to the current layer.

How do I achieve open vias clear of soldermask

In pcb vias are covered by soldermask by default. You can achieve open vias by setting their clearance value to a proper value. This can be done individually for every object, or collectively for selections of objects.

For individual vias:

  1. Turn on the soldermask layer. This will make the K key refer to the soldermask clearance instead of polygon clearance.
  2. Position the mouse above the via (mouse cursor will change in recent versions of pcb)
  3. Type K several times until soldermask clearance exceeds the diameter of the via pad. Every strike of the key will increase the clearance by 2 mil. The first strike will let the pad of the via pop through the soldermask color. Yet, the actual clearance is only 2 mil at this point. You can decrease the clearance by using the Shift+K key.

For groups of vias:

  1. Turn on the solder mask layer.
  2. select the all the vias you want to clear from soldermask. You may switch off all the other layers to conveniently collect exclusively the vias.
  3. Type Ctrl+K key several times. Shift+Ctrl+K will decrease the clearance of all selected objects.

The command interface provides more control over the actual size of the clearance. Type : to get the command line window, then type:

ChangeClearSize(SelectedVias, <delta>)

where <delta> is a size given in 1/100 of a mil. Thus the number 3000 corresponds to 30 mil. Simple integers for <delta> will set the clearance to this value. If the value is preceded by a minus “-” or a plus “+” the clearance will be decreased or increased. This also works with SelectedPins, SelectedPads, SelectedLines, SelectedArcs or even SelectedObjects.

How do I change the soldermask clearance around a hole/pad?

By default holes and pads will be cleared by an amount given in the corresponding footprint file. Sometimes this clearance might not be what your design needs. You can change the clearance on the fly for individual holes and pads just like vias. See the paragraph above for the details. If pad clearance is not compatible with the demands of your pcb-fab you may consider to make local copies of the footprint files and change the clearance accordingly.

How do I change the size of my tracks?

There are a number of ways to change the size of already laid down tracks:

  1. Use S and Shift+S to increase and decrease the size of the track currently under the mouse cursor.
  2. Choose SelectChange size of selected objectsLines -10 mil from the Select menu. The actual amount of change can be set in FilePreferences…Sizes. This only acts on the tracks. So the selection may contain components, text, vias and the like.
  3. Select the tracks to be changed and type :ChangeSize(SelectedLines,+4,mils). The : key gets you to the command line and ChangeSize() is the command version of the previously described action. Replace “+4” by the amount you want to increase the track size. Use the minus sign to decrease the track size. If you omit the sign the command sets the track size to the value given.

How do I drive a via to connect a track to a ground plane on a different layer?

  1. Set the GND plane layer as the active layer.
  2. Select the “via” tool.
  3. Place the via where you want it to live (left click to place).
  4. Now select the “thermal” tool.
  5. Left click on the via you just placed.
  6. Now change the active layer to your desired routing layer.
  7. Select the “line” tool.
  8. Route the track on the active layer to or from the via as usual.

What is the easiest way to create a "thermal via"?

A “thermal via” is not a via with a thermal relief. Rather, it's a via with no thermal relief punched into polygons on both sides of the board. These vias get filled with solder to help create a large thermal mass to be used as a heat sink. For more info, see Freescale App-Note AN4005.

Here are some suggestions:

  • Draw a rectangle to comfortably surround the vias. Then, mouse over the rectangle and hit S. This will flood the thermal reliefs on the vias. If you want to ever de-solder the part from the back, make sure the pad on the opposite side has the solder resist cleared.
  • Just put a normal thermal relief on the via and then shift click on it to cycle through to the one with no relief.

I want to draw a track between two segments on the same net, but PCB won't let me! Why?

You are likely drawing tracks with auto-DRC on. To connect the two segments, here are some suggestions:

  • DRC enforcement uses the ratsnest to determine where a track is allowed to go. Thus, you must have the ratsnest drawn in order to make connections in auto-DRC mode. Otherwise you will not be allowed to connect (or approach) any copper that is not already connected to your net. (If the rat visibility bothers you, you can hide the rats layer – but the rats must exist).
  • You should also refresh the rats regularly when drawing. Hit O to redraw/re-optimize the rats. Make sure a rat is visibly connecting the two pieces of metal you want to connect.
  • It is also possible that you will experience this situation when drawing tracks between pins in a connector. In this case, it is possible that your track width violates the clearance requirements of the pin field. Try decreasing the pin-to-metal clearance, or use a narrower track width.
  • Sometimes this route-blocking behaviour can come about from an error in your netlist. Don't end refdes's with lower case letters - they're reserved for gates within devices. End with upper case or a digit; the lowercase letters are simply ignored.

PCB won't let me connect to copper that is not connected to anything!

This is a known weakness of the Auto-enforce-DRC mode. In this mode, the line tool will only allow you to connect to copper with the same net as the place where the track started.

There are two ways to connect to unconnected copper, anyway: Obviously, you can temporarily deactivate Auto enforce DRC clearance in the Settings menu. A second way uses the fact that auto-DRC relies on the found flag:

  1. enter the “line” mode (F2).
  2. hover the mouse cursor over the unconnected copper.
  3. press F to mark it as “found”.
  4. start the line from somewhere else. Both should now be marked with the “found” color and should be connectable.

I want to draw two vias very close to each other, but PCB won't let me!

Unfortunately, older versions of PCB not only prevent you from placing overlapping vias but drop them on load. In December 2010 this overly cautious behavior was fixed. If you really need overlapping vias, you have to install a version of pcb younger than that.

The 2011 version of PCB still won't allow you to place vias so close that their holes overlap. However, it won't complain if you managed to work-around this restriction. E.g. place tiny vias and increase their size afterwards.

PCB seems to munge my components names and complains that it can't find proper nets for the pins! How come?

Most likely you named them such that PCB believes they are one part. Lower case letters at the end of a refdes are ignored. Thus, the components U2foo and U2bar both look like U2 to pcb. When building the rat nests pcb is will look for nets to U2 that, of course don't exist. Lower case letters are meant to differentiate slots of a multi-component. E.g. the four opamp symbols of a quad operational amplifier.
Bottom line: Don't use lower case letters at the end of a refdes, unless you know what you are doing.

How can I set color and thickness of the rats nests?

You can set the color of the rats in FilePreferences…ColorsMain colors

There is currently no GUI way to set the rat width, but you can edit your $HOME/.pcb/preferences file manually. Close all instances of pcb and look for the line that starts with rat-thickness.

Values 0..19 are fixed width in screen pixels. Anything larger means PCB units (i.e. 100 means “1 mil”). On zoom, PCB unit rats will scale accordingly.

Where is that last remaining rat?

Sometimes remaining rats are hard to see, because they have zero length. This will be the case if a via is missing for some reason. You can make them pop into your eye by setting the rat thickness to some big value e.g. 3000 mil. Rat thickness is set in $HOME/.pcb/preferences.

Beyond tracks and footprints

How do I trace a drawing, a print, or another PCB?

See the page at DJ Delorie's PCB HID website.

This is a great way to trace hand-drawn artwork or another PCB, say one you made in software with a proprietary format, which you'd now like to 'unlock'. Furthermore, you can use the background image as tool for making board revisions or redesigns.

If you don't like to use PCB confined to the area of the board, i.e. if you want margins around your board, then add them in the GIMP. I like to make a 1.00000 inch margin around the board. When you set your PCB size in PCB, you'll want to add the margin area. CTRL-M will help you verify the scaling. Also, the time to correct distortions from your scanner, or from your drawing is before you load it, in the GIMP or the like.

I can't copy component pads in a layout. What gives?

Question: I want to copy a section of my existing layout to another spot.

I can select the existing area. Everything turns pretty blue.

“Buffer” → “Copy Selection To Buffer” seems to succeed (no complaints).

Then I go to paste the copied area… and all that moves are a couple of traces and some vias. The pads I've painstakingly created aren't copied. What gives!?!?!?

Answer: If the silk layer is off, you can't copy elements through the paste buffer. Weird, but that's how it works. Therefore, turn on the silk layer before trying to copy a section of a layout.

How do I fill areas with copper?

Use rectangles and polygon planes. These items will always avoid vias, pads and pins. Tracks are also avoided, if they have the clear polygons flag set (menu: SettingsNew lines, arcs clear polygons). Since version 20070208 of pcb the resulting polygon will be one contiguous piece. Isolated snippets are removed.

How can I assign my polygon to a net?

Polygons are not “assigned” to nets, they're connected to them. Pads are the only carriers of netnames in pcb. This means, you need to design some copper to connect the polygon with a pad. The net of the pad automatically transfers to the polygon.

How can I connect tracks, pads, or vias to my polygon?

There are different ways to adequately connect different types of objects to a polygon:

  • tracks: Set the join flag of the track. You can do this with the J key, while the mouse hovers above the track. Alternatively you can select the lines and apply the command “SetFlag(selected,join)”. For new lines, you can uncheck the New lines, arcs clear polygons in the Settings menu. The polygon will immediately flow into the track.
  • pads: Currently, there is no way to directly connect a polygon to a pad. Draw a track without the join flag from the pad to the polygon. (see above)
  • pins and vias: Choose the thermal tool (“THRM”). Select the layer the polygon sits on. Shift-Click on the via to circle through the available styles of the connection.
  • polygons: Just define them geometrically overlapping.

The polygons are shorting my tracks! What can I do about it?

You didn't have New lines, arcs clear polygons checked in the Settings menu when you layed down the tracks. Enter changejoin(selected) in the command window to toggle this flag for all tracks that are currently selected. The keyboard shortcut to this action is Shift+J. If you want to set or clear the join flag rather than toggle it, you can use the commands SetFlag(selected, join) and ClrFlag(selected, join). See the SetFlag description in the pcb manual for more details on these commands.

How do I change polygon clearance?

In pcb, the polygon itself has no built-in clearance. It is the tracks, pads and pins that bear this property. This means, you can adjust the clearance individually:

Make sure, the soldermask layer is not active. Else the following will apply to the soldermask rather than to the polygon. Press K to increase the clearance of the object under the cursor. Use Ctrl+K to increase the clearance of selected objects. Add the Shift modifier to decrease the clearance. To change a whole track press F to find all segments that are connected to the object under the cursor and apply the action select(connection).

The amount of the increment can be configured in the dialog FilePreferences…Increments. (Note, this setting is currently ignored)

The above only applies to one object at a time. You can manipulate the clearance of all selected objects with the action ChangeClearSize(Selected,<amount>,<unit>). The parameter <amount> should be a number. A prefixed sign means increment, or decrement. A prefixed = sets the clearance to the following value. The parameter can be mil or mm. If not specified the units will default to the internal unit of 0.01 mil.

In addition, there is a special action that acts only on objects with clearance below a given minimum: MinClearGap(Selected,<amount>,<unit>).

How do I hide the polygons while I edit the layout?

Put the polygons (and rectangles) on a separate layer. Use the Preferences… dialog to make sure, this layer is not in the same group as the tracks. Disable the layer by a click on the corresponding layer button in the main window. After you are finished with the changes, use the Preferences… dialog to let the polygon layer join the layer of the tracks. You will have to save and reload the layout to trigger recalculation of polygons so they are adapted to your edits. Alternatively a restart will recalculate the polygons too.

Polygons are making the GUI sluggish. What I can do about it?

Parts of the polygon that are not connected to some net are automatically eliminated. This effectively removes dead copper. While this is desirable for the actual board, it requires calculation of quite extensive algorithms. So it is not necessarily a bug, but a price to be paid for a powerful feature. Still, there is a couple of things you can do to improve the situation:

  • Temporarily hide the polygons. (see above)
  • Choose Thin draw poly from the Settings menu to display only the outlines of the polygons and disable dead copper removal. In recent versions of gschem, i.e. later than September 2007, you can select through the polygons.
  • Make sure, you don't have redundant polygons defined, which multiply overlay the same area. These polygons won't display because they shade each other. But they demand calculation resources. The best way to check for redundant polygons is to edit the source of your layout with an ascii editor.

After I defined those ground planes, pcb takes ages to load. How come?

Polygon calculation is potentially an expensive operation in terms of processor cycles. Unless your layout is pretty complex, you most likely have redundant polygons defined. Look into the source of your layout to find and delete unnecessary polygons. If this does not apply, see above for possible measures to ameliorate the situation.

How do I edit polygons?

There are four basic ways to edit polygon outlines. You can move and delete vertices and you can insert vertices using two techniques. Polygons can be edited equally well in “thin line draw” mode (SettingsThin draw poly) or in normal mode. Moving a vertex is easily accomplished by un-selecting your polygon and then clicking and dragging that vertex to a new location. To delete a vertex, a corner in your polygon, put your crosshairs over the point and hit Delete on the keyboard. To insert a vertex, you’ll use the insert tool (Insert keystroke). Start by clicking the edge you want to split with a new point. Click and drag a new point into the polygon. A variation on this technique is 1) click to select, followed by 2) click to place new vertex.

(NOTE: Inserting points into polygon will generally work ONLY with “all direction lines” enabled (Settings'All direction' lines). This is because PCB has a powerful 45/90 degree constraints system. If you try to insert new vertices into a polygon that don’t fall onto lines of proper 45 and 90 degree constraints, PCB disallows the action!)

How do I place vias that connect to a polygon for full thermal dissipation or full shielding integrity?

Often it’s useful to have vias connect completely to a polygon (a field of copper) for heat transfer – the apparent problem is that PCB polygons have only a single “clear pins/vias” flag for the entire polygon (toggled by the S key). Our goal is to only connect some of the pins/vias to the polygon, but to connect them better than a thermal does. Here are a few ways to do this:

One way, you’ll make an object that’s almost just like a thermal in that it goes between your via and the polygon – the difference is that you’ll actually create an annulus to completely fill the space between the hole and polygon (which because it’s clearance is turned on, is not connected to the pin). This annulus is four arc segments. You can copy these four items to the buffer to create a “zero-clearance thermal tool”. The drawback of this trick is that when you change via size, you’ll also have to modify the size of these filler parts.

The arcs allow you to use this fill trick in tight places by only placing, say two of the four arcs.

Another trick is to make a zero-length line. Take a single line segment and move the end-point on top of the start-point. Now you have a “single point line” (a circle) with the diameter equal to the line thickness. Move to different layers (M key) as you see fit. Place this object centered on your via to connect it to a polygon.

Power-users may want to keep a small custom library of these parts by saving them as elements. It’s also handy to put these “parts” in one of your PCB buffers so they’re at your fingertips.

You can also add another polygon on-top of the polygon to which you want to connect you vias. You’ll un-set the “clear pins/vias” flag and the vias will be connected to the larger polygon underneath.

Can polygons be un-masked? (Can a polygon be made bare-copper with no solder mask?)

Currently, there is no way to directly make polygons clear solder mask. The usual workaround is to work with pads.

  1. Draw a track in the middle of the desired no solder mask area. Every track will become a pad.
  2. Select the tracks
  3. Do Convert selection to element from the Select menu
  4. Activate the solder mask layer. The solder mask should keep clear of the tracks
  5. Increase the clearance of the pads to match the desired bare copper area. To do this, press K while the mouse cursor hovers above the pads.
  6. Optionally press Q to set the square flag of the pads.

While the pad width is limited to 250 mil, clearance can be arbitrary.

How can I increase the size of all pins?

This is a two step process. First select the objects you want to manipulate. Then act on the selection:

  1. select all components. You may shut off all layers except silk so the select tool doesn't catch tracks.
  2. from the menu choose SelectChange size of selected objectsPins +10 mil

You may rip off the sub menu at the dashed line to make it stay on the screen for convenient repeated application.

Alternatively, issue the ChangeSize action with the command tool:

  • Type : to open the command line.
  • In the command line type:
ChangeSize(SelectedPins, SIZE)

Replace SIZE with the desired size, given in 1/100 mil. 1mm = 3937. If SIZE is prefixed by “-” the size is decreased. If the prefix is “+”, the size is increased. If there is no sign, it is interpreted as an absolute value. Refer to the pcb manual for the syntax of the ChangeSize action.

How do I place mounting holes?

Use a footprint for the mounting hole or place a via.

If the pads surrounding the mounting hole need to be electrically connected then you should show the connection in your schematic. Add a symbol for the mounting hole and change its footprint attribute.

My preference is to create PCB footprints for the various types of mounting hardware. I have a variety of silkscreens for various hardware combinations (hex nut, hex nut with washer, etc.) The silkscreen provides a convenient placement reference during PCB layout.

For footprint examples see

Why is it possible to make a thermal for pin, but not for a pad?

The reason is that pins usually have sufficient spacing that the plane surrounding them remains intact on all sides and pads usually are so tightly spaced that they do not. Because of this you must manually draw the thermal “fingers” to connect the pad to the ground plane. Be sure that you have the settings such that new lines connect to planes when you draw them. If you need to make several such thermals, spend a little time making the first one just the way you want then copy the fingers to the buffer and paste it where you want the others.

Can PCB be used to make single layer boards?

It's all just names when you're doing single sided. There's no such thing as a single sided board in pcb - just a double sided board with nothing on one side.

Design for two-sided, but with all the traces on the solder side. If you use the autorouter, turn off all but the bottom layer. This will make the autorouter stick to that layer. If you need wire jumpers, you have two options to let pcb know there is a valid connection: You can draw tracks on top layer similar to a two layer layout. Alternatively you can Create a “jumper” symbol in the schematic and put that in places where you need a jumper. This is likely to be a major pain, but you can enforce dimensions of the jumpers this way if you care.

Single sided boards do not have plated holes, so pad diameter for pins must be greater, usually two to three times the drill size. Some footprints in the default library have very small pads which will be too weak if used for single sided board. Tweak them to your needs and place them in a local library.

When you dump your gerbers, delete the component side one and rename the plated-holes one to unplated-holes. Voila! A single sided board.

What resources exist to process PCB files using scripts?

One of PCB's great features is that it uses an easily understood ASCII file format. Therefore, many people use scripts (commonly Perl) to process their boards in various ways. You can use these scripts either as they are, or modify them to suit your own goals. Here are some links to available scripts:

  1. John Luciani has a large number of scripts available on his website. Included in his collection are scripts for generating footprints, as well as
  2. David Rowe has scripts for updating elements as well as adding/subtracting PCB files from each other on his website. (404 - Not found error)
  3. Stuart Brorson wrote a simple script which generates footprints for two terminal SMT passives. A gzipped tarball is available here .
  4. The website has gathered a collection of footprints, symbols, scripts, and other materials from many different gEDA contributors. The website is organized by contributor, so if you take the time to browse around there, you may find exactly what you are looking for!

How do I import external vector graphics?

There is a third party open source utility called pstoedit that converts postscript data to pcb format. It is included in most major Linux distributions. You can use your favorite vector graphics utility to produce a logo or any kind of fancy layout. Export as eps if you can and make sure that your logo fits into the bounding box (check with a postscript viewer such as ggv). If there is no eps export available, you can produce postscript by printing to a file. In this case you may add a bounding box with ps2epsi. Call pstoedit with the option “-f pcb” to produce a valid pcb file that contains the graphics as tracks on layer 1. Load this file to pcb. The graphics will sit somewhere on the lower left of the view port. You may have to zoom out to get it on the screen.

Import of external vector graphics is useful if an irregular shape of the pcb is required. Use the cut buffer to copy the shape to your actual design.

Is there a way to import a DXF drawing from mechanical CAD applications?

There is no import filter to directly load a DXF file to pcb. However, the open source application qcad can open DXF files and export them as postscript. The tool pstoedit can turn this postscript file into a format readable by pcb (see above).

What is the best way to do weird footprints?

Sometimes footprints call for shapes that are difficult to achieve with the restricted graphics GUI of pcb. It may be easier to start with the vector drawing application inkscape and convert to pcb. In inkscape:

  • draw the weird shape with lines. Lines don't have to be straight.
  • save as eps (uncheck “make bounding box around page”)

Convert to pcb format:

  • pstoedit -f pcb > footprint.pcb

In pcb do:

  • FileLoad layout data to paste-buffer
  • edit to your needs (lines only, no polygons)
  • select the bunch of lines
  • copy to buffer ( ctrl-c )
  • BufferConvert buffer to element
  • BufferSave buffer elements to file

In a text editor:

  • add the same pin number to all the lines with search and replace
  • save as *.fp at a place where pcb is looking for footprint libraries

How Do I attach a name to my layout?

You can set the name of the current pcb with menu EditEdit name oflayout. This sets the title attribute of the layout. This attribute is used for the export actions. It does not interfere with the file name.

Is there a way to do multiple instances of a subcircuits?

The GUI provides no way to do similar subcircuits automatically. You can copy groups of tracks and vias. However, you have to place the footprints manually. Deactivate Auto enforce DRC clearance in the Settings menu during placement. Else pcb won't let you connect the footprints with the copied tracks and vias.

John Luciani wrote a pair of perl scripts that can do better than that. The script sch-matrix places multiple copies of a basic block on the sheet. It increments the numbers and positions of the symbols as needed. The layout script pcb-matrix arranges multiple copies of a sample layout in a matrix way. The result is a matching pair of schematic and layout with a subcircuit repeated multiple times. See Johns website for the details and a download of the scripts.

The pair of scripts was written a few years ago and is not used regularly. They may need to be updated when used with recent versions of pcb. Contribution of bug reports and/or patches are welcome.

Can I overlay a bitmap in the background?

There is a special option to put a bitmap graphic in the background of the canvas. The image can be in jpg, png, or ppm format. Use gimp, or any other image manipulation program to make the image look hazy so it does not interfere too much with the actual layout colors. Call PCB like this:

$ pcb --bg-image background.png layout.pcb

The image will be scaled to the size of the canvas. See the howto page by DJ Delorie for a screenshot of pcb with background image.

Auto Router

How do I make the most of the auto router?

  1. Turn off visibility of any layers you don't want the router using.
  2. Turn off via visibility if you don't want it to introduce any new vias.
  3. Use only plain rectangles for power/ground planes that you want the router to use. (Use the rectangle tool rather than the polygon tool!)
  4. Make at least one connection from any plane you want the router to use to the net you want it to connect to.
  5. Draw continuous lines on all routing layers to outline keep-out zones.
  6. Use routing styles in the netlist to have per-net routing styles.
  7. Set the current routing style for any nets not having a defined route style in the netlist.
  8. Disable any nets that you don't want the autorouter to route – double-click them in the netlist window to add/remove the “*”.
  9. Create a fresh rat's nest. (press the O key)
  10. Select Show autorouter trials in the Settings menu if you want to watch what's happening.
  11. Choose Auto-route all rats in the Connects menu.

Note on disabled nets: If you will be manually routing these later not using planes, it is usually better to let the autorouter route them then rip them up yourself afterwards. If you plan to use a ground/power plane manually, consider making it from one or more pure rectangles and letting the autorouter have a go at it.

If you really want to muck with the router because you have a special design, e.g. all through-hole components you can mess with layer directional costs by editing the autoroute.c source file and changing the directional costs in lines 929-940 and try again. Even more mucking about with costs is possible in lines 4540-4569, but it's probably not such a good idea unless you really just want to experiment.

How do I force the autorouter to only put traces on a particular layer?

Just unselect the layers you don’t want (usually green and blue) by clicking on the name of the layer, then press autoroute.

How do I make autorouter leave particular nets alone?

Open up the netlist window. It has options for including or excluding nets from the ratlist. If you use the GTK-HID double-click a route to disable it. Make sure, only the nets you want are enabled. Optimize the rats with key O. Do Auto-route all rats.

How do I force the autorouter to route only within my pcb outline?

You can have the autorouter work only within a given area by drawing a copper polygon conforming to your board’s boundary and placing it in each layer you’re trying to autoroute. You can also use this trick to autoroute only with small areas. Of course, if you accidentally have a net touching the polygon, all routes will get shorted to that net.

How do I route power and ground planes with the autorouter?

Connect the polygon that will become your power planes to a net and the autorouter will figure it all out. You may need some trick polygon clearances to get power routing and routing within a board outline.

The layout produced by the autorouter is inefficient!

This is a technological limitation of the current auto router. It is gridless and uses geometric rectangles only.

The layout produced by the autorouter is ugly!

Have you tried the various clean-up tools under ConnectsOptimize routed tracks?

Gerber files, prints and other I/O issues

Is is possible to produce output without GUI intervention?

Yes, you can tell pcb on the command line to do an export. All the parameters set in the print dialog can be used in the command line too. Some simple examples:

Gerber files:

pcb -x gerber --gerberfile BOARD BOARD.pcb

Encapsulated Postscript:

pcb -x eps --eps-file BOARD.eps

Multi page formated Postscript print:

pcb -x ps --psfile BOARD.pcb

PNG format:

pcb -x png --dpi 300 --only-visible --outfile BOARD.png BOARD.pcb

Different output procedures allow for different options. See the output of pcb --help for details.

How can I print specific layers only?

In the GUI:

  • deactivate all layers you don't want to print
  • choose FileExport layout…eps
  • check as-shown

From the command line:

pcb -x eps \
  --layer-stack "outline,top,silk" \
  --as-shown \
  --eps-file "foobar.eps" BOARD.pcb

The layer-stack string can contain a comma separated list of the layers used in the GUI. You have to give the option “--as-shown”. Else, a default layer stack file will be used. In addition there are a number of tokens that are technically no layers like “pins”, or “invisible”. If you put an unknown token in the layer-stack string, pcb responds with a list of known layer names.

How can I print the bottom side of the board?

From the command line: Add “solderside” to the layer-stack string of the print command. Example:

  pcb -x eps --layer-stack "silk,solderside" \
     --as-shown \
     --eps-file "/tmp/foobar.eps" BOARD.pcb

How do I make a board outline to go with my gerbers to the board maker?

PCB interprets the lines in a layer called ‘outline’ as the absolute edge of the pcb. If no such layer is present, you can either rename a layer (EditEdit name ofactive layer). Or you can add a layer from scratch (FilePreferences…LayersAdd) and rename it accordingly. Note, that the name of this layer is case sensitive.

You can enter your outline thru PCB’s GUI. You just draw the desired outline with the line tool or the arc too. Most fabs will cut the board at the center of the lines. You can generate boards of any shape this way. Arcs, polygons and text in the outline layer also enter the gerber file.

It’s also possible to edit the native .pcb file format of your layout. I usually use layer 8 for outlines:

Layer(8 "outline")
	Line[x1 y1 x2 y2 1000 2000 0x00000000]
	Line[x2 y2 x3 y3 1000 2000 0x00000000]
	Line[x3 y3 x4 y4 1000 2000 0x00000000]
	Line[x4 y4 x1 y1 1000 2000 0x00000000]
	Line[<more points go here for non-square boards> 1000 2000 0x00000000]

PCB will produce a gerber file called $NAME.outline.gbr that exclusively contains the objects in the outline layer.

How do I make sure, that the design contains only certain hole sizes?

Some fabs provide lists of standard drill sizes and charge extra if the design contains additional sizes. You can put this list in a “vendor resource file”. This file may also exceptions and specify if the nearest diameter should be chosen, or rounded up to the next size in the list. See the section Vendor-drill-mapping in the pcb manual for the syntax of this file.

Load the file to pcb with FileLoad vendor resource file. Alternatively, you can use with the command :LoadVendor(drillfile). Substitute “drillfile” with the name of your file.

On load, pcb will substitute drill sizes so that the layout conforms to the list. If you want to apply an already loaded vendor resource file again, you can do Apply vendor drill mapping from the Connects menu.

How many pads are in my layout?

Some board houses ask for the number of SMD pads to help them with their quote. You can use gerbv to extract this pad count from your layout.

  1. export the layout to gerbers
  2. open the file $NAME.frontpaste.gbr with gerbv
  3. choose Gerber codes report from the Analyze menu
  4. The tab “Aperture usage” gives the number of SMD pads.

I'm done with my layout. How should I check my design?

  • Run a check of design rules either through the command interface (“DRC()”) or from the menu (ConnectsDesign Rule Checker). You can set the rules in the Sizes section of the Preferences… dialog. Results of the check are shown in the log window.

Besides running the DRC checker, it is essential to check your Gerber files. The gEDA Suite includes the program “gerbv” for this task. Here are some things to check/verify:

  • Check that all trace widths are the correct size. Also make sure your trace widths and metal-metal separations are above the minimum specified by your PCB vendor.
  • Check that all hole diameters are called out at the correct size.
  • Check that metal annular rings around holes/vias are large enough. The annular ring is the distance between the hole’s edge and the outer diameter of the metallization. The annular ring must be large enough to accommodate drill location + layer registration + other manufacturing inaccuracy. This information should be available from your PCB fabrication house; they normally publish the minimum annular ring requirements in their manufacturing rules document.
  • Check that your antipads (clearance around holes/vias) are large enough. This information should be available from your PCB fabrication house; ask them for their manufacturing rules document.
  • Verify that no soldermask or silkscreen overlays a copper pad or through-hole.
  • On plane layers, verify that at least some vias connect to it (yes, I have seen a board where the entire ground plane was floating – not done in pcb btw)
  • On plane layers, verify that at least some vias don’t connect to it.
  • Do a visual sanity check of all layers. Nothing detailed, just does it look approximately like you think it should.
  • Sign it and date it. At least put a version number on it, so if you have to rev the board, you can tell the good from the bad.
  • Are all layers negative/positive as they should be? Note that some fab houses want positive layers only. PCB will automatically create negative Gerbers on outer layer planes with no tracks. If you want an all-plane layer to be output as a positive layer, draw a single track somewhere in an unused part of the plane. This will trigger PCB to render that layer as a positive layer.

Exporting Other Formats: Raster and PS Files

What is xy-max in the PNG export dialog box?

It limits the size of the image to NxN pixels, but maintains the aspect ratio. For example, if you set it to 400, a 6000×8000 mil board would yield a 300×400 image, but a 6000×4500 board yields a 400×300 image.


I don't like that old-style black background. How can I get a light canvas?

In GTK-HID there is a Preferences… dialog in the File menu. The Colors tab presents a convenient way to set all the colors pcb uses via the standard GTK color chooser. The colors are saved to $HOME/.pcb/preferences on shut down of the application. With Lesstif-HID there is no preference dialog. Colors can be set in $HOME/.pcb/settings

How do I set the default values of the postscript dialog?

You can set the default options of the postscript printing dialog as command line parameters when invoking pcb. Type pcb --help for a list of available options. These options can also be set in a file $HOME/.pcb/settings. A settings file for a4 paper, no alignment marks, multi page output would contain:

media = A4
align-marks = 0
multi-file = 1

How do I customize the mouse behavior?

There is no GUI way to modify the mouse behavior. However, you can adapt it to your needs without recompiling. This is how:

  1. locate the file gpcb-menu.res on your box. For lesstif there is a similar file called pcb-menu.res
  2. copy the file to $HOME/.pcb
  3. edit to your needs, save
  4. on start-up, pcb will read this localised copy. This will overwrite whatever settings were made by the system gpcb-menu.res

How do I temporarily change keyboard shortcuts?

The GTK version of pcb includes a neat way to change shortcuts on the fly:

  • go to the menu and let the mouse hover over the item to be configured. Don't press any mouse button.
  • type whatever shortcut you'd like to assign to the item under the mouse.
  • the shortcut will be working immediately. Conflicts with other shortcuts will be resolved by removing the shortcut of the conflicting definition.

This setting will be reset at the next session of pcb.

How do I permanently change keyboard shortcuts?

Default keyboard shortcuts are defined in files called gpcb-menu.res if you use the default GTK interface. On start-up pcb reads the configuration from a system path, e.g. /usr/local/share or /usr/share/. For permanent change of keyboard shortcuts you can copy the system file to $HOME/.pcb/gpcb-menu.res and edit to your needs. Settings in this file will overwrite the system configuration.

The lesstif interface reads pcb-menu.res files instead.

Can I customize the menu?

The menu is defined in gpcb-menu.res for the GTK-UI. You can place a localized copy in $HOME/.pcb/. See the notes above on configuration of keyboard shortcuts and mouse behavior.

You didn't answer my question. What other resources exist for PCB information?

You can get fast responses from the geda-user email list. If you haven’t found an answer to your question about PCB on this page, or in the other documentation, then post to the list! Note that you must subscribe to the geda-user e-mail list before you can post to the list. The gEDA e-mail lists, and their archives, are at:

geda/pcb_tips.txt · Last modified: 2018/06/03 09:58 by bert