(upbeat music)
- Over the last few episodes,
we created a custom schematic symbol,
created the schematic, made a custom footprint,
associated footprints with schematic parts,
and generated a net list.
We're finally moving into the layout stage with pcbnew.
Here we'll import out netlist, arrange our parts,
draw a board outline and make trace connections.
On this episode, we'll look at arranging our parts
which is one of the most important steps you can do
before connecting things with traces.
From the KiCad Project Manager, select Tools, Run Pcbnew.
The first thing I like to do is fill out
the document information section,
so click File, Page settings.
We'll keep the revision the same as the schematic,
so write v01.
For the title write 555 Badge and leave company blank.
On the fourth comment line, write Author, colon, your name.
Write License: CC BY 4.0 in the third line
and creativecommons.org/licenses/by/4.0/ in the second.
Click OK and you should the see the title block
populate with your information.
The next thing I like to do is make sure
I'm working with the right units and grid.
Like I mentioned in a previous episode,
most board houses use the Imperial System,
so it's usually easier to keep the inches button selected.
We'll be changing the grid often during the layout,
but I like to leave it at 50 mils
during the part placement stage.
Then we need to import the netlist we generated
on the last episode.
Click Tools, Netlist.
Make sure that the 555_Badge.net file is correctly listed
and leave everything else at default.
Note that if you make changes in the schematic
and need to reimport your netlist,
you'll likely want to select change footprint
to import any new footprint changes you made
and click delete extra footprints
to remove any unused parts
Click Read Current Netlist.
Once that's done, click Close.
You should see all your parts appear
in the center of the page.
Before we go any further, we should set up some design rules
to prevent us from putting parts
or traces too close together.
This will ensure that the board house
can actually fabricate our board.
To start, head to oshpart.com
There are lots of board manufacturing house out there,
but Oshpart does a great job of making it easy
to order low quantity PCBs for things
like projects and prototypes.
Click on services and click See all services.
We'll be making a two layer board
and this is where you can find information
about their fabrication capabilities.
The six mil trace clearance specification
tells you that you can't have traces
closer than six one thousandths of an inch
away from each other.
Also, all you traces need to be at least six mils wide.
Drill holes need to be 10 mils or larger
and the annular ring should be at least five mils.
You can also see pricing information here
and see that we need to order things in batches of three.
We'll need to know these rules
as we enter them into KiCad
which will help us lay out our board within these specs.
Normally this is all you would need
to set up your design rules.
But Oshpart has gone the extra mile
and giAven us exactly what we need to enter into KiCad.
Click on Support at the top and click See all docs.
Click on KiCad and go to manually set the design rules.
Here you can see what KiCad rules Oshpart recommends.
Don't worry, I'll walk you through them.
It can be helpful to put KiCad
and the Oshpart rules side by side.
Click Dimensions, Pads Mask Clearance.
This determines how much space there should be
between a pad and the start of the solder mask.
Oshpart wants this to be 0.002 inches,
so we'll change it to that.
Click OK and go to Design Rules, Design Rules.
Go to the Global Design Rules tab.
Make sure Do not allow blind/buried vias is selected
and make sure Do not allow micro vias is also selected.
Blind, buried, and micro vias are useful
in multilayer boards
or boards with very tight component spacing.
However Oshpart isn't capable of fabricating them,
so we don't need to worry about them.
All right, since I mentioned vias,
we should talk about what they are.
Let's go back to our PCB cross-section.
A via is almost exactly like a through-hole in the board.
In fact, it's made the same way.
The copper and substrate layers are drilled.
Copper is added using an electroplating process.
However, vias are usually much smaller than through-holes
as they aren't meant to hold pins or wires.
They're purpose is simply to connect traces
or copper between layers.
If you have a trace on the top layer
and you want to connect it to the bottom layer,
you would use a via.
We'll use one or two in our layout.
This is where things can get a little wonky.
The Oshpart KiCad docs show different dimensions
that we looked at on the services page.
The services page is probably the correct one,
but to be safe, let's go with the one
that has larger widths and spacing, which is on this page.
Change the Min track width to 0.006 inches
and change the Min via diameter to 0.027,
which is the total width of the via,
including the drill hole and both sides of the annular ring.
Then change the minimum via drill diameter to 0.013.
Change the uvia to 0.027 and its drill diameter
to 0.013 to make the regular via dimensions.
Uvia stands for micro via
and we need to enter these values
so that KiCad doesn't yell at us.
However, Oshpart will ignore these
since they won't fabricate micro vias anyway.
Go to the Net Classes Editor tab.
We have entered the absolute minimums for spacing
and sizes as per our board house specifications.
In this tab, we can change how big
and how far apart our traces will actually be.
You can make other trace sizes,
but I'll cover that on the next episode.
If you can, it's a good idea to make your traces,
vias, and spacing a little bigger
than the board house's minimum specifications.
When you're working with boards that have a lot of space,
like this one, a clearance and width of 10 mils
is usually a good starting point.
So change clearance to 0.01 and track width to 0.01.
Let's make our vias slightly larger
that the Oshpart minimums,
so change via diameter to 0.03 and via drill to 0.015.
Even though they we won't use them,
change the micro via diameter and micro via drill
to 0.03 and 0.015 as well.
Click OK.
At the top left, you should see your track width
and via dimensions shown.
The next step is to move the parts around
so you can get an idea of how big your board should be.
Hover you mouse over a part and press M.
If asked, pick a footprint to move
and move it out of the way of the squished part puddle.
Just keep moving parts until there are no parts
on top of each other.
Do you see the white lines connecting
the various footprint paths together?
These are called air wires
and are very helpful in figuring out
how parts should be connected with traces.
The entire group of air wires is known as ratsnest,
and that's because the nest of rat
is a messy clutter of straw,
which kinda looks something like this.
You can click the hide ratsnest button
to toggle the air wires on and off.
Now comes the tricky part,
untangling the ratsnest the best you can
by moving parts around.
Each time an air wire cross over another air wire,
you'll likely have to move that trace to a different layer.
You can't just cross them on the same layer,
because you'd create an electrical short
between two nodes that aren't supposed to connect.
The idea is that you want to minimize the number of times
you have to move to another layer.
On very complicated boards, two layers won't be enough,
so you'll you need to use a four layer board
or a six layer board or even more.
But we're going to try to do everything with two layers.
Move the parts around by pressing the M key
and rotate them with the R key when they're on your cursor.
Experiment with different positionings
until you think you've got it down
to the least number of air wire crossings as possible.
Remember, we can't have components touching,
otherwise they might short together.
Most of the parts have a gray bounding box
called a courtyard.
Make sure the bounding box of one component
doesn't cross into the bounding box of another
and you should be good.
When you're pretty happy with the general placement
of the parts, begin squishing them together
making sure not to overlap any courtyards.
For surface mount projects, you will have to remember
to leave some space between parts,
if you think you'll need to get a trace through them.
You can always move parts around later,
but it becomes harder
as you'll likely need to redo traces when you do.
Note that I'm leaving the LEDs out,
as they'll be separate from the rest of the parts.
If you had an idea of the shape of your board,
you could put your parts in that shape
as you were moving them around.
If you want an even tighter layout,
you can right click on a part, select Footprint,
and click Flip.
This moves the part to the other side of the board,
where you can technically position it
underneath other parts.
This does not work well with plated through-hole parts,
as the pins will usually stick through
and poke the part on the other side,
making it hard to solder.
Even for surface mount boards
having parts on both sides is usually more difficult
for a assembly shops to make them
so you'll get charged more.
It's generally good practice
to have parts on one side of the board if you can.
Now, let's make our board outline.
Search for ID badge size,
as we want our board to look like a standard badge.
ID Wholesaler looks good, so click on that.
The CR80 is the most common size.
Let's use that.
Let's modify the dimensions slightly
to make it easier to work with in our program.
Don't worry, the tolerance on the board edge
of most PCBs isn't the best,
so you won't really notice the difference.
We'll got with 2.12 by 3.37 inches.
Back in KiCad, click the add graphic line button
and select the edges cuts layer.
This layer is where our board outline should go
and it'll tell Oshpart where it should cut
to make our board shape.
We can't move the origin of our layout sheet.
It's always stuck at the top left corner,
just outside the border.
So I'm going to pick an arbitrary coordinate
and pretend it's the origin.
Let's say x equals five, y equals.
Hover your mouse over five, five,
press Space to place a temporary marker
so that our relative x, y coordinates
will show zero, zero at that point.
Click to start a line
and click again four more times,
to make something like a rectangle.
Press Escape to end the line.
Hover your mouse over the first vertical line and press E.
Make sure the line starts at five, five.
The end x should be five, since this is a vertical line.
The end y should be 3.73 inches above the start y.
So five minus 3.37 is 1.63.
Remember down is positive in the y direction in Pcbnew.
Most board house, including Oshpart,
like the board outline thickness to be one mil
to avoid any confusion about where the cut should occur.
So change the thickness to 0.001.
Click OK>
Hover over the next line and press E.
Make the starting point five, 1.63
to connect it to the top left corner.
The end y should be 1.63 as this is a horizontal line.
Five plus 2.12 is 7.12 for the end x.
Change the thickness to 0.001 and click OK.
Edit the next vertical line
and change its starting point to 7.12, 1.63
and its end point to 7.12, five.
Change its thickness to one mil and click OK.
Edit the final line and change its starting point
to 7.12, five and its end point to five, five.
Change the thickness to one mil and click OK.
Press Escape to end the line drawing mode.
Click and drag to create a box
around all the components except for the LEDs.
We'll do this to move them all as a group or block.
Leave the block operation selections as default
and click OK.
Move your components to completely
inside the badge at the bottom.
They don't quite look centered
so what we can do is change the grid size
to something smaller like 20 mils.
Highlight the parts again,
making sure you don't include
any of the board outline lines in the group
and move them over until they look more centered.
Check to make sure that no parts
or pads are outside the board outline.
Go back to a 50 mil grid.
On many boards, you may want to add mounting holes
so you can attach it to something with screws.
For our badge, we'll want to add an oval cutout at the top
so we can clip a lanyard to it.
Head back to docs.oshpart.com and click on cuts and slots.
If you read carefully through this section,
you'll see that we should make the cutout
on the board outline layer
and it needs to be bigger than 0.1 by 0.1 inches.
Somewhere near the top of your board,
draw two parallel, horizontal lines
on the edge cuts layer.
Click on the arc too and draw two arcs near the lines.
Based on some measuring and a little bit of trial and error,
I will tell you that the slot should be about
0.4 inches long and about 0.15 inches wide.
So edit the first line.
It should start at 5.86, 1.73
and it should end at 6.26, 1.73.
Make the thickness 0.001 and click OK.
The other line should start at 5.86, 1.88
and end at 6.26, 1.88.
Make this one 0.001 inches thick as well and click OK.
The first arc should be centered about 5.86, 1.805
with a starting point of 5.86, 1.73.
Make the arc angle negative 1,800
and the thickness 0.001.
Click OK.
Make the second arc centered around 6.26, 1.805
and have the starting point be 6.26, 1.73.
Change the arc angle to 1,800 and thickness to 0.001.
Click OK.
You should have a nice oval shape for a cut out.
Move the LEDs to the center of the open area.
I like to rotate them so that
the negative flat edge is facing down.
If you'd like to make them perfectly centered
like I did on my board,
you can move D1 to 5.81, 2.95
and D2 to 6.31, 2.95
and that's it.
Click File, Save to save your work.
Moving components around to minimize cross traces
is a very important step
and it'll make drawing those traces much easier,
which we'll do on the next episode.
Click that subscribe button
if you wanna see more fun videos like this
and see you soon.
(upbeat music)