(upbeat electronic music)
- I know that over the last few episodes,
I kept talking about associating footprints
with schematic symbols.
Well, that day is finally here.
All that hard work will pay off
as we finally get to tell KiCad
which part uses which footprint.
In this episode, we'll first annotate our schematic
to generate a RefDes for each component.
Then, we'll run CvPcb to associate a footprint
with each schematic symbol.
From there, we'll generate a net list,
which is just a file that tells KiCad
which component terminals are connected
to which other component terminals.
Open the schematic for your 555 badge project.
If you take a look at the names of the components,
you'll see that the reference designators
all have a letter and a question mark.
The letter just tells you what kind of component it is,
R for resistor, C for capacitor,
U for integrated circuit, and so on.
Each of these needs to have a number,
so you can uniquely identify each component
on the schematic as well as on the layout.
Luckily, we don't have to do this by hand.
On the top bar, you'll set a set of five buttons
in the second to last section.
The idea is that when you're ready to move
from schematic to layout, you'll want to press
these five buttons in order from left to right
to prepare your netlist and bill of materials.
So, click the first button, Annotate schematic components.
This tool will go through and replace
all the question marks with numbers,
so that you can identify your parts.
If this is your first time running this tool,
you can leave everything as default and click annotate.
However, if you need to redo any of the annotations,
you might want to click reset existing annotation
to clear your previous annotation job.
Also, note that by default, the annotation tool
numbers components top to bottom
while moving left to right on the schematic.
You are free to change this if you want it to perform
the numbering left to right first.
Click Annotate, and click OK.
Take a look at your components.
All of the question marks should be replaced by numbers.
Now, when I talk about resistor R2,
you'll know which one I'm referring to.
This also helps KiCad keep track of components
when we go to lay out our board.
Next is the electrical rules checker.
You are welcome to open it and play around with it,
but note that it's going to throw a bunch of errors
because we didn't take the time
to assign the correct pin types,
so just ignore this tool for now.
Click on the run CvPcb to open the CvPcb program.
We finally get to associate footprints
with schematic symbols.
The middle pane shows the RefDes
for each part and its value, if it has one.
To the right of the value is the footprint
associated with the part.
Each part needs to have a footprint, as that footprint
is what will be on the actual board layout.
Some parts might already have footprints by default,
but it's worthwhile to go through each part
and make sure it has the correct footprint.
Take a look at BAT1, the battery holder.
For me, it already has a battery holder footprint assigned,
however if you click on it, you'll see
that the only available footprint
is the 7555 we made on the last episode.
That's because KiCad only has our custom library loaded.
Almost all PCB layout programs rely on a set of libraries,
and keeping these libraries in order can be quite a feat.
In fact, in some companies, keeping these libraries
in order is a full-time job.
For our purposes, we just need to find the correct libraries
to get the parts that we need.
Click Preferences, Footprint Libraries.
The PCB library tool should look very familiar.
It's just like the one we used
to create a custom library when we made our footprint.
On a new installation of KiCad,
you may have libraries loaded
into the global library section.
These are the default KiCad libraries
and will give you most of the footprints you need.
However, we still need to load the Digi-Key libraries
for the battery holder and switch footprints.
If you don't see any global libraries
or accidentally deleted them like I did,
then click Append with Wizard, select Github repository,
and make sure https://github.com/KiCad is filled out.
If you're curious, GitHub is a website
that allows users to store project files for free.
Usually, these are code files for programming projects,
but you can store other things in here, too,
like board layout files.
It uses the Git version control system,
which can be daunting at first to use,
but is very powerful, especially if you have
multiple people working on a project.
KiCad has their own set of repositories,
and we can download their libraries for our use.
Leave Save a local copy selected, and make sure
you choose an appropriate place to download the libraries.
Go to your libraries directory,
which is Documents/KiCad/Libraries for me.
If you just choose the Libraries folder,
KiCad will bury your Digi-Key libraries
in lots of .pretty folders, which will make it hard to find.
So we'll keep our libraries separated by source.
Make a KiCad folder next to the Digi-Key folder,
select the KiCad directory, and click Select Folder.
Click Next.
The import tool will search through the KiCad repositories
and give you a list of the footprint libraries it finds.
So yes, make sure you have an internet connection
for this part.
You can tell that these are footprint libraries
due to the .pretty suffix.
Click select all as we want to import all of them,
and click next.
KiCad will scan the libraries to make sure
they do contain legitimate footprint data.
Click Next.
Because these are the KiCad default libraries,
I like to save them to the global library configuration,
so that they're seen by all my projects.
Click Finish.
Wait a minute while the libraries are downloaded
and saved to your computer.
We also want to include the Digi-Key footprint library,
so click Append with Wizard.
Make sure Files on my computer is selected, and click Next.
Find the digikey.pretty folder,
which should be in your libraries directory
under digikey-kicad-library-master.
Select it and click Next.
KiCad should verify that it's a good library, so click Next.
Since the Digi-Key library is well curated,
I like to be able to use it in all my projects,
so keep To global library configuration selected,
and click Finish.
You should see the default KiCad libraries
and the Digi-Key library all listed
under the Global Libraries tab.
If you select the Project Specific Libraries tab,
you should see the custom 555_Badge library
we made in the previous episode.
Click OK, and you should see the left pane populate
with all the available libraries.
Now, we go down the list of parts in our schematic
and associate a footprint with each one from a library.
Click on BAT1.
On the right pane, you should see all the footprints
that you can associate with the battery holder.
If you really wanted to, you could tell KiCad
that you wanted to have
a transistor three terminal footprint
show up for the battery holder.
That's a terrible idea, but you could do it.
To help filter these possible footprints down,
we can click on one or more
of the filter buttons on the top bar.
The first is to filter footprints based
on the keywords found in the schematic symbol.
In theory, it would only show you things
with words like battery or holder,
but because this part doesn't have those words filled out,
then you still see all the components.
However, if you click on the C1 part,
you can see that now you're only shown
a list of capacitor footprints
because they contain the word capacitor
regardless of which library it comes from.
The next filter button is pin count.
Click on that, and now you'll only see footprints
with the same number of pins as the part selected.
Because our battery has two pins, you'll be presented
with only footprints that have two pads.
Finally, click on the last button
which allows you to select a library in the left pane
to view only footprints from that library.
If you click the Battery_Holders library,
you can see all the battery holder footprints with two pads.
Click on one, such as the 2430 CoinCell holder,
and click on the View selected footprint button.
You'll see a footprint that looks
like it should hold a coin cell battery.
Hooray, except that this isn't the right size coin cell.
We want a CR2032,
as that's a common three volt coin cell battery.
Sadly, it doesn't seem like the KiCad libraries
have what we need.
In the left pane, scroll down and click
on the digikey-footprints library.
On the right, you'll see Battery_Holder_Coin_2032_BS-7.
Click on that and open up the footprint viewer.
This looks promising, so close out of the viewer.
The BS-7 is coin cell holder capable of holding a CR2032
and Digi-Key has a lot in stock.
This looks like it's the right part.
Double click on the BS-7 footprint
to associate it with the battery symbol.
You should see the footprint now listed
next to the BS-7 part in the middle pane.
Next, we have the capacitor C1.
We don't necessarily want to filter by library,
so click on the library filter button to deselect it.
All the possible capacitor footprints
should be shown on the right pane.
This is where we need to do some more part research.
Search for capacitor on Digi-Key,
and select Aluminum Electrolytic Capacitors
as that's what we'll need to use for these larger caps.
We know we want a 10 microfarad capacitor
and a through hole mounting type, so select those filters.
Select In Stock and press Apply Filters.
Sort by descending Quantity Available.
Almost any of these will work for us,
so pick something that's cheap
with a minimum order quantity of one.
I chose the ECA-1HM100 because it seemed thinner
than the rest and it's on $0.18.
On the product page, make a note
of the two millimeter lead spacing
and five millimeter component body diameter.
That's what we'll need to pick the right footprint.
When it comes to through hole parts with two pins,
there are generally two types: radial and axial.
Radial means that the pins extend
from the radius of the cylinder.
Usually it means they're on one side.
Axial means that the pins extend
from the main axis of the cylinder.
It looks like you poked one piece of metal
through the component body.
Most through hole electrolytic capacitors are radial,
and most through hole resistors are axial.
On the right side, scroll down
to find the through hole capacitors,
which is give by the THT acronym.
Look for radial, and find the one
that has a diameter of five millimeters
and a pin spacing of two millimeters
which are given by the D and P respectively.
Select it and view it.
This looks to be something that will hold our capacitor,
so double click on the footprint to assign it to C1.
Repeat these process for the 100 microfarad capacitor.
I chose the 35ZLH because well, it seemed small.
Notice this has a 2.5 millimeter pin spacing
and 6.3 millimeter diameter.
Choose the radial through hole capacitor
with D 6.3 millimeter and P 2.5 millimeter.
We've got a few choices for the LEDs,
but we want the smaller three millimeter variety
so that they don't take up a lot of space on the badge.
Make sure the footprint looks okay,
and double click to assign it.
If you look at the package type
for the 2N3904 transistor, you'll see
that it's known as a TO-92-3.
Lucky for us, Digi-Key has a TO-92-3 footprint,
so we'll use that.
Most common 1/4 watt resistors
are about six millimeters long,
which we'll need to know for selecting our footprint.
Find the group of through hole axial resistors
with a length of about six millimeters.
Vertical means that the resistor
will be sticking out away from the board.
We don't want that, as we want
the resistor to rest flat on our board,
so look at the remaining three horizontal footprints.
The question now is how close together
do we want the through holes, as we can bend
the resistor leads to fit through any of these.
We want to keep our parts pretty tight on our board,
so let's pick the one where the pads are close
to the component body, 7.62 millimeters.
Choose this same footprint for all the resistors.
Note that you can hold shift to select multiple parts,
and then double click on the footprint
to assign it to all those parts.
If you remember, we used a Digi-Key part for the switch,
so it's probably a good idea to look
through the Digi-Key libraries for a footprint to match it.
Filter by libraries,
and select the Digi-Key footprint library.
Find the switch slide EG1218.
It looks like Digi-Key made that one to match our part.
Double click to assign it.
Finally, we get to our custom part, the 7555.
Scroll up in the left pane,
and select our 555_Badge library.
There should be only one footprint available,
so double click to assign it, and that's it.
Click File, Save Edits to save our part associations,
and close out of CvPcb.
Back in Eeschema, we click the next button
in the row, Generate netlist.
We could generate a netlist from our schematic
for a number of other PCB layouts tools,
like Orcad and CadStar, but we want to stay in KiCad,
so leave the default Pcbnew tab selected.
Click Generate.
It'll ask you where you want to save your netlist file,
so keep it in your 555_Badge project directory,
and click Save.
The final button is used to generate a bill of materials,
or BOM, which lists out all the components you need to buy.
Generating a BOM after you create the schematic
and associate footprints is usually a good move.
However, we'll wait to make our list of parts after layout.
Save your schematic, and exit out of Eeschema.
There's a lot of debate about how much of a pain
this manual process of associating parts
with footprints is in KiCad.
Many older programs used to use this method
of manually associating parts before you went to layout.
However, many newer programs actually allow you
to automatically associate footprints
with parts during part creation.
It is a little tedious, however,
it does mean you have to carefully think about
which parts go with which footprints
when you're making the schematic,
or right before your layout step.
Next time, we'll begin the actual layout process
by importing the netlist into Pcbnew.
See you then, and don't forget to subscribe to this channel
if you want all the fun news and updates from Digi-Key.
(upbeat electronic music)