6. Electronics Design¶
As the title suggests, this week revolved around the processes used to design a PCB (printed circuit board). For that I used KiCAD, a cross platform and open source electronics design automation suite.
As of writing this KiCAD 9.0 has just been released and while I will be using the latest version, there could be some minor differences causing confusion when looking up tutorials, as they are not up to date.
You can download the most recent version for Windows right here or find a list of previous releases here.
As per usual I once again teamed up with Anna, Kerstin and Lars, the other students from HRW FabLab, to take a closer look at a microcontroller using an oscilloscope as well as a multimeter.
You can find our group work page right here.
Designing a PCB in KiCAD¶
After installing KiCAD head over to this link where you will find instructions on how to install the necessary footprint and symbol libraries for all the most common electronics components found in a FabLab.
Since this repository is constantly being updated, I cloned it with git.
This way I can just use git pull
every time I want to work with these libraries to have the most up to date footprints and symbols.
Once downloaded all I had to do was link the libraries in KiCAD according to the instructions and I was good to go.
You will be asked how you want to configure the global symbol library table, simply select the recommended setting and click on OK
This is my first time using KiCAD so I followed the official getting started guide pretty closely.
- create a new project and make sure that the
Create a new folder for the project
checkbox is ticked
- double click the schematic file that has been created to open up the schematic editor7
- in the top left corner head to
File
and selectPage Settings
to set up the schematic sheet
-
press
A
on your keyboard to open the symbol library -
I searched for
xiao
because I plan on building my PCB around a Seeed Studio XIAO RP2040 development board
- upon clicking
OK
the board’s symbol was glued to my cursor and placeable by left clicking
-
note that the
Add Symbols
command stays active after placing a symbol so you can simply click again to reopen the library or pressESC
to close the command -
since I later want the RP2040 to communicate with other PCBs via I2C I plan on including a 4 pin header for GND, VCC, SDA and SCL
-
I also want to add a rotary encoder with an integrated switch and an LED with a suitable resistor
-
for the rotary encoder I went with the PEC11L-4115F-S0020 from Bourns
-
to get the footprint and 3D model of this part I visited Mouser Electronics
-
I installed the files the same way I did with the libraries in the beginning
-
by pressing
P
I opened thePlace Power Symbols
menu and added the 3.3V and GND symbols
- select the
Draw Wires
command in the right hand icon bar or pressW
on your keyboard to connect your components
-
any unused pins have to be marked with those little crosses
-
to do this press
Q
or select thePlace No Connect Flags
symbol on the right -
see how some of the connections have been made “wirelessly”?
-
instead of drawing a whole plate of wire spaghetti you can simply draw a wire of arbitrary length from I.e. an I/O pin and put a label on its end (
L
on your keyboard) -
then go to where the wire would have ended, draw another wire of arbitrary length from there and give it the same label
-
once you are happy with your schematic head to the
Tools
dropdown in the top left and selectUpdate PCB from Schematic
- the PCB editor should open and show you something like this
-
in here your task is to rearrange the components and route the tracks in a way that none of them overlap
-
make sure that there are no 90° bends in your tracks as those can cause issues during production
-
after a bit of puzzling this is what I ended up with
- click on the
3D Viewer
icon at the top
-
there are some things I want to change, for one I feel like I am wasting quite a lot of space and the board could definitely use some mounting holes
-
also according to the datasheet the rotary encoder circuit needs to be modified to get proper readings
- back to the schematic we go…
- and another puzzle session later…
-
a quick design rules check (which you can find to the right of the 3D Viewer icon) told me that I still haven’t defined an outline for the PCB so let’s go ahead and do that
-
in the
Layers
list on the right side selectEdge.Cuts
and draw a rectangle around the components
- once you have left the rectangle tool you can double click the outline to further customize it
-
I did another design rule check and found out that I still had some undefined connections which I changed real quick and went on to create some mounting holes
-
mounting holes are also defined in the
Edge.Cuts
layer, simply draw circles into the corners and adjust their radius and position
- a look at the 3D view lets me know that there definitely is still room for improvement but I’ll leave it as is for now
- you can find the KiCAD PCB and schematic files down below