You are on page 1of 7

Division of Engineering and Product Design

XE421 Electronic Engineering CAD/CAE


Design of Printed Circuit Boards

All electronics engineers at some stage need to design a professional board on which to mount
components, a PCB. These can be single layer, dual layer or even multilayer with plated through
holes to connect the different layers. We are going to design a single layer PCB.

The PCB can be made here in the university by a router technique, which is a small CNC milling
machine which mechanically cuts the tracks in copper clad board under computer control.
A wet etching process produces better results, e.g. the service from the PCB Train at Newbury
Electronics: http://www.pcbtrain.co.uk/

This is capable of fabricating boards with plated through holes, multi-layer, solder resist and silk
screening. You can research how this is done http://en.wikipedia.org/wiki/Printed_circuit_board

We are going to use an open source PCB layout tool called FreePCB. You can download and install
it from http://www.freepcb.com/ (follow Downloads and install version 1200). It is quite capable of
producing circuits of the above quality. It is so good once you have used it you will want to use it
again and again!

Set up the Folder and File

When FreePCB is first opened you have to select File -> New and give the new project a name, and
the path where to save it. Generate a folder for your project. Put the path of your personal storage
area or your memory stick, e.g. D:\Projects is a valid path. It will ask if you want to create the folder –
click yes. Check your memory stick and your folder and file should be visible.

Set up the PCB Size and Number of Layers

Now set up the PCB size. The easiest way is to start from the small white cross which represents
coordinates (0,0). Get the hang of the mouse zoom so you can set this near the bottom left of the
screen.

Click Add -> Board Outline and set a board of size 2.5 inches horizontal x 2.5 inches vertical (board
size 2500 x 2500 mil). Note the units are given in mil, which is thousandths of an inch. Make the
bottom left corner correspond with the origin so you can easily read the size in the grid numbers (in
mil) at the bottom of the screen.

Note if you did not set the origin you can use Tool -> Set Origin to define it as the bottom left corner of
your board.

Deselect the top copper layer in the layers list on the top left of the window so that only the bottom
copper layer is active. We are making a single sided PCB using only the bottom layer. Select
between the layers by pressing “1” or “2”.
Get into the habit of saving your work at intervals when you are happy with the progress. FreePCB
automatically generates a backup file for you.

The Circuit to Make

At this point all we have is a rectangular area of known size and a single layer defined. We need to
start adding components but first we need to know what circuit to make! We are going to make a
small audio amplifier capable of driving a small loudspeaker. The circuit is shown below (which was
drawn in LTspice – note use of the European resistor symbol !):

TL071
Small
outline

Adding Components

FreePCB has a comprehensive built-in library, and it is even possible to edit existing footprints or
generate new ones with the Footprint Editor. Most of the time that is not necessary.

In the library, sm stands for surface mount and th for through hole. We want th components since the
component body sits on the non-copper side with leads passing through the board to be soldered to
the copper bottom layer. Surface mount components have no leads. U1 is a surface mount
component. The view in FreePCB (and most other packages) shows a plan view looking down on the
top side.
When selecting a component from the library it is important to get its physical size correct and the size
of the solder pad correct. It is also important the the hole associated with the pad is the right diameter
to accommodate the component wire. The following footprints are suitable: (Add -> Part)

Resistors: RC05 (th_resistor.fpl) Add the component label in the reference box (R1, R2 or R3)

Capacitors: C1, C2, C3 – check the physical size of the components available ! Check the physical
size outline and the lead spacing (pitch) – the latter is most important otherwise the component will
not fit. The physical outline is more important with a densely populated board, which this is not. The
hole size will probably be OK and seldom needs checking (usually only with components with very
thick leads or pins). Note that C2 & C3 are polarised types so they have to be inserted the correct
way round. From memory a suitable footprint with the correct pitch is not available for C1 so one will
have to be created with the footprint editor (see later) to match the parts available.

U1: SOP-8 (sm_sop.fpl). This is a surface mount (small outline) component which must be mounted
on the track side of the PCB. Make sure you consider its mirror image if you are viewing the top side
of the board !

Q1, Q2: TO92 (th_transistor.fpl)

Apart from the components themselves, it is necessary to get power and signals on and off the board.
This could be done by soldering wires directly onto the PCB (yuk!) but it is better to use connectors.
Our connectors have a 0.1” pitch (spacing between holes) and we need three connectors:

2 pin for signal in

2 pin for signal out

3 pin for power

Get these from 4SIP100 (th_sip.fpl). You will have to edit the footprint and save the result for 2 and 3
pin connectors. Do this by highlighting then right-clicking over the component and “edit footprint” to
open the footprint editor. Delete the end round pad and the square box. Set the placement to 50
mil. Add you own square box with “Add Polyline” (F3). Set the polyline thickness to 7 mil. Then
save the footprint as 3SIL100 in your own user created library ready for next time. Close the footprint
editor and return to the schematic changing the footprint when requested. You should now have a 3
pin connector instead of a 4 pin connector.

Repeat for 2SIL100 for the 2 pin connectors.

NOTE! The hole size for the SIL connectors is 28 mil = 0.7 mm. Check with Colin if this is too small
for the connects available (ask for the Molex click type which are polarised). If it is (likely) you will
have to open the footprint editor, highlight each pad in turn, edit properties, and set the hole size to 40
mil (1 mm). You might also wish to increase the pad size to 75 mil otherwise there will not be
sufficient copper area to which to solder.
Connecting and Routing

For now, this is done manually. You will need the pinouts fo the transistors and the TL071 – these
are shown below – note the actual op amp used is the TL071 but it has the same pinout as the
741:

To connect up you will need to make the connections and then route the track. Inevitably parts will
need to be moved, rotated etc, and with a single sided board you might have tracks that cross. Try to
minimise these by re-routing, if not it is possible to install a jumper. This is basically a resistor given
the designation “LKn” (where n is the number) and either a special 0 Ohm link is installed or just a
piece of wire. Good PCBs have few links. Links can be minimised by the use of multi-layers, but
this circuit is so simple that is not required.

Connecting and routing makes extensive use of the function keys. To connect two pins together,
highlight one pin, press F4 and link to the other pin to be connected. If it asks for a net just call it
N00001. Pins are connected by segments, but they do not become tracks until they have been
routed. Nets are groups of pins connected together. A complete circuit consists of many nets defined
by a netlist.

Now two pins are connected, but they must be routed to form a track. Before doing this set the
default track width (Project -> Options) to 20 mils as the preset value of 10 mils is rather too thin.
Make sure that you select the correct layer – you want to route tracks on the bottom layer. To turn the
connection into a track, highlight the segment (it changes colour from purple to white) and again press
F4. The track can be laid at any angle, horizontal, vertical, or 45o. Use the mouse key to decide
where to have the track bends. You can unroute traces and segments, notice how the operation of
the function keys change during the stages of connecting and routing (see the bottom, left of the
screen). If you want to add an extra bend to a track, or add a spur (perhaps to make an additional
connection), you need to add a vertex, F3. Pressing F3 again allows you to connect to the vertex
with a trace to go to other pins, which can then be routed to a track.
Experiment to get the hang of it, and connect up the circuit. You can move components with F4, but
it will unroute some tracks (it will probably leave the pins connected by “rubber banding” the
segments). Make sure all components and tracks are within the edge of your board as defined by the
border. Try to make the layout of your PCB look nice by having sensible layout of parts and tracks
that run parallel to each other.

NOTE! You should route your tracks on the BOTTOM FACE by selecting the appropriate squares at
the top left of the screen. If you find that you have routed on the top face then you will need to
change layer. If by some chance you find there is no bottom layer then you can add it by modifying
your project file to add a layer and assign the current top layer to the new bottom layer. Make a
backup of your project file just in case. Then open it with a text editor and find the section that starts
with "n_copper_layers=1". Change it so it looks like this (without the "<----" stuff):

n_copper_layers: 2 <--------- CHANGE 1 to 2


layer_info: "selection" 0 255 255 255 1
layer_info: "background" 1 0 0 0 1
layer_info: "visible grid" 2 255 255 255 1
layer_info: "highlight" 3 255 255 255 1
layer_info: "DRC error" 4 255 128 64 1
layer_info: "board outline" 5 0 0 255 1
layer_info: "rat line" 6 255 0 255 1
layer_info: "top silk" 7 255 255 0 1
layer_info: "bottom silk" 8 255 192 192 1
layer_info: "top sm cutout" 9 160 160 160 1
layer_info: "bot sm cutout" 10 95 95 95 1
layer_info: "thru pad" 11 0 0 255 1
layer_info: "top copper" 13 0 255 0 1 <---------- CHANGE 12 to 13
layer_info: "bottom copper" 12 255 0 0 1 <-----------ADD THIS LINE

Now save and reload the file into FreePCB, et viola ! (Note the first number is the order, the next
three numbers the colour, and the last whether it is active). Yes, FreePCB projects are text files …
When you have finished you can add text to your board if you want, such as the function, author, date.
Use Add -> Text. You can edit the style to your personal taste. If you really want you can write text
in the copper layer which will then come out when CNC routed !

Generating and Viewing the CAD Files

Once the design is complete, save it. It is now necessary to generate the files suitable for the PCB
manufacturer. These correspond to a standard format and are known as gerber files. You need to
give these to Colin on a memory stick so that he can produce your board.

There are different files for each copper layer (we only have the top layer), the holes, the solder resist
(we do not have facilities to produce this) and the silk screen (unfortunately we also cannot produce
this).

Under Files you will see “Generate CAM files”. Once the gerber files have been created you are
strongly advised to view them to see if there are any errors. An open source gerber file viewer is
gerbv http://gerbv.sourceforge.net/

This stage often allows the designer to spot errors since specific information is presented in each file.
Review all the files carefully before copying them to Colin.

The Rewarding Part !


Get your PCB made on our router, assemble and solder it, and finally test it ! See the technician in
charge of PCBs for use of the pick and place machine for mounting the surface mount chip. You will
need to make up input and output connector leads but it should be quite capable of reproducing music
from an mp3 player or iphone. There should be more than sufficient gain (what is the voltage gain of
this amplifier ?). Be careful not to blow up Q1 & Q2 by short circuiting the output – if you do destroy
parts you will need to carefully desolder them and replace them with new ones.

Now you know how to use FreePCB to make your own printed circuit boards. I hope you enjoy using
it – it is capable of laying out quite sophisticated circuits.

You might also like