 Hello and welcome to the show it's me John Park and I am broadcasting live from the planet Mars today we moved my workshop there that was exciting I can't believe that we landed on Mars right right just a couple minutes ago I didn't know when that was gonna happen figured I might have been part way through through this show but wow that's exciting I was telling my friend I feel pumped and I didn't even really have anything to do with it how y'all feeling so over in the discord chat let me let me see some pictures if any come through I know they're gonna be starting to show some pictures of the the descent over over the red planet so that's pretty exciting all right so let's see you may have noticed I don't know if you check out this blog post that goes out before this show but I mentioned that today is going to be a very special episode because I'm going to do a build from scratch show you a design and a build and I'll cooking style a little bit but I'm gonna show you what it looks like to use fritzing the design software electronic design software to build a mechanical keyboard that will be controlled with a Raspberry Pi Pico microcontroller and circuit Python using the hid library so that we can build ourselves a keyboard so I'm actually gonna spend most of the time on that today I'm gonna skip some some of my usual segments so that we have enough time to get through a bunch of stuff I hope that's okay with you but I have learned a bunch of things you may know fritzing from the breadboard diagrams that a lot of us use in our learn guides but you can also use it for schematics and take that all the way to PCB design printed circuit board design and fabrication it'll generate the type of files you can use to make your own board if you want to etch it or if you want to mill it out if you have a little PCB mill or send standardized files to a PCB house which is what I'm gonna end up doing so not all of this is is cooking show style I'm only at the design phase but I'm gonna show you some circuit board printouts that I've done just on paper so that I can sort of verify that things should work as much as possible size wise dimensions but then I'll be ordering probably from Osh Park I'll be getting a set of three PCBs I'll show you what that process looks like and then we'll follow up when I get that in and put it together and hopefully it all works or I come up with some Bodge wire solutions so that's what we're gonna do pretty much most of the show today there are a couple of our usual housekeeping types of things that will do I'm just checking my notes that's why you'll hear me going um what are we doing here's my notes all right what am I what am I doing okay let's first of all I'll mention I usually mention we have a jobs board if you're looking for work or if you're looking to hire someone this is at jobs dot Adafruit.com and if you had here you can check out some open positions that might be freelance might be in person might be remote could be part-time contracts full-time all varieties it's free to post if you're looking to hire someone it's free to use if you're looking to get a job so go check it out at jobs dot Adafruit.com it is free and will always remain free you heard it right here oh that's true I think that's true all right next up I have a show on Tuesdays that you may have heard of it's called JP's product pick of the week in it I pick a product and I go over some of the details of the product as well as do a little demo it's about 15 minutes long but sometimes 15 minutes is more than someone has and they just want to see the roughly 59 second and 23 frame version of it so here it is the one-minute recap the INA 219 high-side DC voltage and current sensor in STEM a QT format so I'm gonna run this DC motor then we can look at the voltage and current as we run the motor power supply goes to the V in so it can measure the current voltage and then that runs to the rest of my circuit and now you can see it's drawing about 170 or so milliamps I'm gonna put a finger on this motor and as it struggles current is quite a bit higher it's almost double we're running about 300 milliamps and if I stop it entirely you'll see we're drawing about half an amp that's my product pick of the week it is the INA 219 DC high-side current and voltage sensor in STEM a QT format yes that's it so go check it out I think that's still in stock it's full price now but during the show it's half price so you'll usually want to tune in during that time on Tuesdays one o'clock Pacific time four o'clock Eastern time to see what's the product pick of the week and how do you get one for a great giant huge discount that's that's the that's the flavor of that all right hey ever forget to bring water to your live stream and then just decide to see how the water that's just sitting here in your workshop is doing not bad not too dusty that's good that's a gamble sometimes that doesn't work out well all right let's see let's get into this thing right so first of all what are we talking about here I'm gonna grab one of these here picos and I'm gonna grab so that's the Pico microcontroller right there it's a raspberry pi designed board with a raspberry pi designed chip the RP 2040 has dual Cortex M0 cores in it it has a lot of really tremendous features but it's also only four dollars so I don't feel bad using it for something that's dead simple the reason that this is a good fit for doing a keyboard so this is going to be a USB keyboard like a key pad that you might have a little 10 key key pad off to the side I'm actually going to build it I think with 21 keys and I'll talk about that number in a second because I my friend Steve who's watching has a 21 key keyboard that he made that's a sort of like a music keyboard a MIDI type of thing mine is not that it just turned out that 21 worked to be a good number for the design that I came up with but one of the reasons it's easy to do on the Pico is if you look at this little Pico pinout that we have right here you'll notice there are a lot of these pins that are labeled in yellow those are the general purpose input output or GPIO pins and there are I believe 27 usable ones there's there's a there's one GP 15 that's a little tricky to use because of its involvement currently with the USB reset function so I won't touch that one but we've actually got essentially 27 general purpose IO switches or input output pins that we can use and so if you take the board here and I'm going to just plug a wire into one of the ground switches there's a few grounds around there right now this is going to act like a USB keyboard I've actually coded it it's not plugged in but I've coded it so that when I press that it's going to press a USB key I think this is the letter K gets pressed when I touch that one I'll show you the code in a minute so if we consider the fact that it has that many GPIO pins it means that we can connect up some of these key switches that's what's inside of a mechanical keyboard keyboard that you type with on your computer it has this type of switch in it generally this is the most popular style and design called Cherry MX switch there are others I don't want to start a holy war there but this is similar what I'm going to use I'm actually going to use the black ones they're a little stiffer and it'll work well for my needs but you'll see on the bottom of that thing it's just in fact let me go to a why am I showing it up there let me go to this this view hey look I've got a nice big camera view so you can see here this key switch has two pins if you press this down when you type you've just closed that circuit and so running any of these GPIO pins to ground which is little square pads here will in effect press the button and I'm going to show you let's let's take a look real quick at some of the code here I'll come back hey so this is just some generic example code that we use for doing HID stuff you find my Adam session so you can see here I've just adapted a tiny bit for use on the Pico I'll be writing something a little more fully featured that will make it easier to establish a key mapping of these 21 keys that I'm gonna have but you can see here the essence of this is that we bring in digital IO which allows us to use input output on the pins output being things like you want to light up an LED input meaning we're gonna press a button and bringing in USB HID and the Adafruit HID keyboard and key code libraries and this makes it very easy to press the USB keys that are on a keyboard from from within code next thing I do I like to do this is set up the little LED that's on the Pico in fact let me plug this in for you for a second how about this type of view here here and here oh close I almost got it there we go so you'll see there's a little LED here that I like to have that turn on when I give it power just so I know that something's happening and I also have it I'm not gonna press it now because I'll screw something up but if I did short that that first or second pin right now it's gonna blink once or twice when I press it again just as a little bit of feedback for me so that's why I have this set up here where it says deaf blink number of times so this is a function that I call the blink function so if I type in blink parentheses one it's gonna blink that one time and this is how it does it by just setting the LED's value false pause a little tiny fraction of a second and then turn turn it on so it always stays on you'll see it blink off when I blink alright the next thing we do is we bring in the keyboard we create the keyboard device on USB HID and then this was in our sample code there were a couple of just two buttons and one was essentially alt tab switching between apps so it was called the swap and this one was called the search and it's it's the control K which I think brings up the search in a in a web browser so these can be changed the GP0 is the first pin here on the Pico and GP1 is the next one so considering this key map here you'll go through and decide who's connected to what which is what we're gonna be doing when we get to the the PCB design part of this and then we have a little this is what runs the bulk of the program is just waiting for those keys to get pressed and when they do get pressed it sends the keyboard command either a single key so down here I've changed this one to just send the letter K key code K if I wanted that to be a capital K would be key code dot shift comma key code K so that holds the shift and the key code we can also do things like repeats and set do different things when we release press and release so there's there's some sophistication to what we can do but this is the basic example of this so let me now let's let's talk about how you can design your own keyboard because this is something that if you've ever looked into the mechanical keyboard world that's not not just buying them but the hobby of collecting them and lubing your switches it's not as dirty as it sounds buying custom keycaps fancy resin keycaps for your escape key and so on there's a whole world of this hobby of mechanical keyboards and one facet of it is making your own custom keyboards that aren't just a typical layout so there's sort of 101 key layout there's 80 percent 70 60 40 percent there's ortho linears so there's a lot in in the keyboard world some things that you may be familiar with in fact let me dangerously unplug my camera switcher right now this is a similar type of thing that I made from a PCB that Andy Clymer designed and it's a a trinket under there and a little diode matrix for these six keys and it sends out USB HAD I use that for switching my cameras in in the program I'm using while I'm doing this show and another example is this one I've shown before that our friend of Adafruit Steve Noriko made this is a beta or prototype of a MIDI keyboard that can be used like the black and white keys on a piano keyboard but it can also be a sequencer and again these are mechanical key switches in a PCB with some some keycaps on them this one's fancy because it has under lighting RGB under lighting so you can indicate things based on the lighting and here's a project another one from Steve that's gonna be I think it's a itsy-bitsy based itsy-bitsy M0 based keyboards macro keyboard that'll have 10 key switches on it and we're gonna we're gonna care about these these little patterns of these footprints of the keys in a second when we get into the design so you can of course just use any button or switch that you want but we're gonna do this specifically with key switches in mind so what I'll do is let's pop over to fritzing so fritzing is the design software that we use to create bring my camera back up that we use to create the schematics that you see in most tutorials so you can see it's got this very user-friendly design of the familiar breadboards and we can drag wires between things to create connections so I'm gonna actually not use a breadboard in this case but what I'm gonna do is I'm gonna wire it up to a Cherry MX key switch so first of all in fritzing you'll need a object for this Pico and that is available on the Raspberry Pi site one nuance of it is that I was searching around for fritzing elements or fritzing objects for the Pico and found a discussion in fact let me let me pull this up here over on the fritzing there we go over on the fritzing forums and someone said looking for Raspberry Pi Pico part there's a discussion here van Epp who I believe is one of the maintainers of fritzing started building one and there's a long discussion here about doing the cast-alated pads as surface mount versus through-hole van Epp and in the end creates a both so there's an option to use if you look back at our down cam here you can see this has these cast-alated pads which means it's fairly easy to let me grab a proto board here to show you an example it's fairly easy to solder this like a surface mount component so let's say this is a PCB that we wanted to use you can have pads instead of holes so this is not a great example but we have pads here you can heat the solder to connect without putting header pins down which allows it to be a simpler design and it's a little bit easier to design the total board with this in mind it's also lower profile so you can keep things small and you can also do like cutouts and sandwich them in and make them flat with the boards there's a lot of cool stuff you can do with that so in this thread and I'll eventually be putting together a guide on how to design your own keyboard from scratch inside of fritzing because a lot of people will do this inside of Eagle and key cad or chi-cat or however you say it and absolutely those are fantastic they're also much more sophisticated and have a steeper learning curve and a lot of people I think start and stop inside of fritzing just with the breadboarding section of it but what I wanted to do is take it all the way through to the end where you can get your board manufactured so this link I'll put up in the end here we end up with a couple of links to some boards and I think one of these ends up becoming the the official one that Raspberry Pi is using that Alistair Allen has posted up there so that's a little bit of the story behind that part the cherry MX switch I think it's just default in fritzing so if we go back to fritzing here and head up to the search you can type in just cherry or I think key switch and it comes up with this object here it doesn't have a pretty breadboard view but it has everything we need in the schematic view in the PCB view to do what we're gonna do so if we were I'm laughing because in the discord now a Weisenheimer has said it's pronounced cheekad thank you Todd the schematic view here if I switch over to this shows us the object the Raspberry Pi Pico object and the switch object and all of their pins and so what I'm gonna do I I just happen to know that the pin two on the switch is gonna go to ground and the pin four is gonna go to the digital IO pin and I'll verify that only let me cheat for a second look at my other one because there's there's a lot of pins on this that aren't used or used if you're doing things like lighting up LEDs some key switches have those integrated so let me double check where's my other fritzing here yes that's that's that's the pattern we're gonna use so just to start this off the simplest one this would be the Pico with one key switch we will run from pin two to ground and on this Pico all of the pins that are squared off at the end are ground which is really helpful since there isn't a silkscreen indicator on the top of the board it's really helpful to know that those are squared off especially when you're in here and then let's say we're gonna just connect that to pin one GPIO zero and what I'll do is make some curvy lines there just so that it gets out of the way and I'll color code these how about yellow for this signal and black for ground okay and by the way I got to be mindful of the time because Scott is gonna do a deep dive at 205 so I gotta be out here at two so someone yell at me if I'm going long so now if we look at the schematic for this what we see is the switch has all of these pins available but the two that I picked there or the the pin to ground and pin for for the signal and what you can do here is you can start to lay this out in in a way that makes it a little easier to look at especially when we end up getting a whole mess of switches on there you can also get some more more sophisticated and create little sort of remote networks a little little net labels that allow you to separate things visibly even though they're still connected under the hood but for this I'm gonna leave everything visible so that's easier to follow and so again I'll not even bring in ground elements which you often do I'm just gonna leave this directly connected and what I'll do is I'll take this net line that's dotted and I will sort of stamp it into existence by dragging anywhere on the line that'll also add a bend point which can be useful for arranging things so you can see everywhere click on here I can move one of these little lines around here so there's also some grid snapping that's not gonna be perfect because this part isn't isn't the size of the grid but I'll live with that so what this means now since I don't see any dotted lines and down at the bottom of fritzing let me see can you see that yeah down at the bottom you'll see in red here it says routing completed so there are no connections that we specified over in breadboard view that have not now been taken care of inside of the schematic view and you can also auto route that which would work fine for a simple example like this but as you get more objects you tend to want to route them by hand yourself so now what we'll do is we'll head over to PCB view and so you can see here the cool thing is that there's a breadboard view a schematic view and a PCB footprint available for both of these parts and what I'll do is I'm gonna start physically arranging them the way I want them in the real world so first thing I'll do is I'm gonna rotate this Pico 90 degrees and I'm just gonna make sure that the USB connector is flush with the top or even protruding a little bit from the top and that's just to prevent a cable from bumping in you'll also notice there are labels associated with objects and sometimes those don't say what you want and sometimes they're not oriented the way you want and you can fix all that so what I'll do is let me see I'm missing some elements I'm gonna open up the inspector and layers over here on the right so if I look at the inspector for this part it says this is the version 4 of the raspberry pi.org Pico they're calling it mod 1 not sure why but I'm gonna call it Pico and if I rename it in the inspector that renames it here also the little element can be rotated separately from the object itself so I'm gonna rotate that 90 degrees and maybe we'll put that somewhere on the breadboard or on the PCB that we'll see so now you'll see what we have is this is a gray this gray background is the board itself and we can drag its corners around to change its dimensions unfortunately inside of fritzing we can't give it an irregular shape or round the corners or anything like that that you might be familiar with in other CAD software there are there are hacks there workarounds we can go in and edit SVG files but we're gonna live with the square or rectangle and that'll actually work fine for what I'm doing and now what I can do is I can move the key switch footprint where I want it so let's say we're making a little three key switch tiny little keypad maybe this is all we need maybe three of those one on top of the other would work and again same thing this has a footprint it also has this silk screen object that is the name of the switch which will get silk screened onto the circuit board and I should mention if I look at this example here so this this is what's my camera switcher that's the circuit board that my camera switcher uses if I put this under the overhead here for a second you can see this here is the silk screen this outline of the part and the name Andy climber a fruit trinket M zero all that is what the silk screen is gonna end up being this was done on a fancy black matte finish board which is cool but you can see it's nice to have these outlines printed these are really elaborate key switch footprints because they accommodate a whole bunch of different standards so there are different manufacturers of key switches that have different positions of the pins on the bottom so this mess here is to accommodate that as well as rotary encoders so this is this is more elaborate than we're gonna get another thing you'll notice is that this board has a diode per switch because this works as a row and column matrix and the diodes are necessary to prevent key press ghosting we are actually not gonna need any diodes on ours because the Pico is is so full of GPIO has so many available pins that for this project we don't need them of course you could and that would be more efficient and would leave those pins available for all kinds of other things but I'm gonna I'm gonna keep it simple oh Adam over in the discords of the they made a cherry breakout board last year very cool breaking out all those bunch of little pins you see on there so you can plug them into a breadboard very cool so if I come back to fritzing let's now once again you can see we're faced with the dotted lines which these are called the the rats nest wires and these have not yet been connected so it's telling me essentially I specified in breadboard and schematic view that I wanted to make connections they have not yet been made with copper traces which is which is what we'll get so circuit board starts as a piece of fiberglass board with copper cladding on typically two sides and then it gets milled away cut away etched away anywhere you don't want copper traces so a very simple way to deal with this is just like we did before if I go and touch or drag a rat's nest line it will create for us a trace however you'll notice there's a couple issues going on here for one thing it doesn't care that I just bridged this hole which I may not there's a there's a connector there which I may not want to bridge so it'll let you do whatever you tell it to do so maybe want to move this up and and out of the way a bit and same thing you can see it was crossing this pad right here which was going to be bad it means we would have bridged that GPIO pin with I think the 5 volt pin on the on the pico let me consult my chart over the V bus so voltage bus so that would have been bad so we don't want that and there's also a few things happening here that I didn't really check on that I want to discuss oh look I can get rid of this this bend point here and just run this straight over here and that is what side are we actually putting our traces on what I'll do is I'll actually undo a couple there we go so I'm gonna get rid of that one and I'll show you down at the bottom and I'll say if you're used to Eagle which I use it a little bit and have made a few boards on it so I kind of learn it and then forget it and learn it a few times a year but especially if you're an expert in Eagle you of course stick with Eagle it's amazing but one thing I've noticed is that this thing fritzing is really user-friendly and has distilled down to the essence of what you want to do making it pretty obvious and pretty easy to do things if you're doing not super sophisticated stuff it doesn't have crazy auto routing and pushing and things like that so right now what layer am I drawing my traces on it's actually just this big these big buttons down at the bottom there's a couple of these you use a lot which is the view am I looking above or am I looking below and that flips your camera view to underneath the board you can see it's mirrored or it's backwards because we're under there so I'll go back to the top of the board so this is this is the hey what side am I looking at and then there's the which side am I drawing on and so I can draw on the bottom layer I can draw on the top layer I can draw them both I'm not sure how you specify then I guess it's if you pick a point so the first one I created there I think that's gonna connect to a drill hole because it's it's the Pico sitting on top of the circuit board but it has made essentially a via to poke through the board and then connect underneath sort of automatically which is really nice and now if I want to create the other trace on the top of the board for whatever reason usually it's because you're avoiding shorting and crossing things so what I'll do is I'll switch I'm now on the top layer and if I grab this GPIO one pad and drag that on to the switch and now I'll move some things out of the way again like I did before just so fits nicely not bad I actually probably shouldn't do it up here because there's some parts from the USB that the USB micro switch that could potentially scratch away your solder mask and create a short so it's not a super smart place to put that but I just want to show for example that that's how easy it is to pick which layer you're placing things on and at this point let's say that I love it I'm done I want to go ahead and have this manufactured so there are there are a couple things you can do at this point one is have it check some design rules to see if your board is actually proper if it can be manufactured so in fritzing there's a menu you're not seeing me go to this but I'm going to go up to a menu under routing that says design rules check it says your sketch is ready for production there are no connections or traces that overlap or are too close together so you didn't see that pop up I think because it's a separate window so it was happy with me if I do this if I move my trace let's see if it catches that errors and then run that again design rules check yeah so it lit that up red and said this is bad this is an area that's overlapping that you don't want so this is a step that you'll you'll typically do in order to to make sure things are good and safe and copacetic so what I want to do now is actually jump ahead to the design I did where I added in the full set of switches but before I do that let's let's take a look I'm going to head over to the overhead view and I'll show you kind of what my design in my head looked like and then I started rearranging some some keycaps to kind of lay it out so let's go to the bench cam here and let me see if my one camera overheated over here so I'm going to try to power that back up and see if it's happy and I will open the back of it to let some air through one second I'm just focusing that should be good you'll let me know alright let me bring that up in the corner about main view there sure that'll work okay so let me zoom this way in here was my I'll grab a different pico here was my original or what I landed on anyway sorry that view is kind of dark there is that in focus that is not there we go that's better brighten it up too so this was what I came up with I've got these really cool sort of retro keycaps and they fit really nice together on a grid rather than staggered like you know this type of arrangement here so I wanted to create something that I can use as a shortcut for video editing of buttons so I've got my shuttle control that I can hit play and rewind and so on but there are edit controls like in insert point out points cutting maybe I'm switching between color layers RGB this is just a mock-up any key can go on these I also have this one I've got some blanks on here there's also a two two key wide blank that I can place on top of two keycaps and just pretend it's a single button or I can swap that out for for two so this is pretty versatile versatile I also liked that it was the same height as the pico and that seems like enough to do a lot it makes it a little different from a ten key or a three by three or a four by four so so this feels good it's a it's a good size for your hand I think for for getting a few keys without moving around too much while you're while you're editing something it could be used for Photoshop could be used for 3d software could be used for music software so I feel like that's kind of a cool arrangement so that's what I wanted to do so what I came up with over in fritzing if I jump back here let's see give me a moment where's the other fritzing there it is okay so now it gets a little crowded in the breadboard view but all I've done is duplicate that same sort of idea so I have the MX switch I have the grounds all running to each other off of three points on the on the pico they could all just be on a single sort of daisy chain and I don't mind that this is a bit of a mess because I'm actually not using this to share how something is built I'm just using it to lay things out so I can go into the schematic view and make sure everything is lined up properly and then go in and build the PCB you'll also notice I added this is something I'm doing on pico projects now I added a reset button so pin I believe 30 on the board right here is called run on the Raspberry Pi chart it might say that on the back of the board does it you can't see it it's so small yeah you hear me complaining about the size or not having the pin out on the top but I can't read it anyway it's so small but Phil B put that as reset which I appreciate on his little pin out chart you can download that on the pico page on Adafruit and that just gives me a button to press when I want to reset the board which which you do sometimes you have to double click it to go to boot loader sometimes you just want to hit reset so I am so sorry about that I think that that was batteries dying and I'm so sorry I just blew everyone's ears away with that I wish that this system were smarter about what it does when when the transmitter has battery problem looks like the receiver is still good so that that shouldn't happen again I'm so sorry about that alright we're back so anyway I was saying I like to set up this little reset button so that's the one addition to this if we head over to the schematic view I tried to at least give myself enough space so that things are not on top of each other but this is usually the type of case where you would end up adding little net labels and connecting things I can show you what those look like in a second let me open up this here let's go scrolling up and go to core there's where I need down to these little guys little net labels this allows you to call it's like a virtual plug a little wireless plug between things so you can set your switches over here and plug them into through midair to the to the the neighboring net label that has the same network name so you could do that to meet and things up here and that's something that people are pretty familiar with if they're using other CAD software and using making more sophisticated circuits but here we can get away with this and so I've labeled and numbered my switches essentially one through 21 starting in the upper left and moving my way down and around the board like so and you can see here I have in a few cases to avoid making a mess with all of the ground pins not only am I running them sort of in series among the switches but I've also got little ground network labels that I can connect things to without having to connect them in space and so here let's get to the PCB so same process we had before I'm going to turn off a bunch of layers and bring them on tell you what we're looking at so here is the board let's bring on the silk screen top layer so those are the the Pico the little reset button I have over here a micro switch and the drill hole for the bottom side of that cherry switch so you see it's got that little post that goes into the PCB this is actually a silk screen drawing around that hole and then the hole let's see I think that shows up with let's find it something has it silk screen top I think maybe it'll only show up when it gets cut through some copper so I'll show you that in a second one thing you'll notice when you're designing with this board if you're doing it surface mount flat like I'm doing you have to be aware that there are some traces right on the bottom you see those little programming pins little traces there we don't want those to short anything and that's why the part has this keep out listed here so I actually bring in a part called a keep out and if I let's see if I bring in my copper top layer you'll see it so this this is where I've indicated I don't want any copper to get filled I don't want any traces to go around across that so I think if you use the auto router it would route around that and I manually routed around that myself and then let's see what else so you'll see here now I've got the copper turned on all these pads that come with the footprint have shown up I actually may make a new version of this footprint that is just the two pins I need and the hole just because it's gonna make routing it so much easier and go back and do a very specific one most of the switches I deal with don't have the LED don't I know people get mad at me because they want the options but it would be kind of nice to make a very elegant version of this that doesn't have that oh something got moved how did that happen did I bump something did you see me bump something what is this or did I put an extra switch out here as a demonstration and zoom out yeah this little switch that's not connected to anything just showed up in my PCB view to ruin the party so let me get rid of that Adam asks why not wire the keys as a matrix in order to free up some pins mostly because I just wanted to do it the simplest easiest way possible for a beginner without dealing with the matrix without dealing with that code without dealing with the diodes and to show off the fact that the Pico for $4 just use all the pins like this you know I my time is everyone's time is money so for for me just making the same look it's a $4 board that has 21 pins I'm just gonna wire to them directly there's absolutely nothing wrong with doing it as a matrix it's the smarter way it's the right way it just kind of didn't feel like it so hope that answers the question it maybe I should do that version to be kind of cool to do a matrix one and then that allows you to go create gosh I'm sure you could do a hundred keys if you wanted to if you're using the matrix on this board so and if people don't know a matrix is where there are just a few pins used but they are scanned in columns and rows with timing and so the timing is so fast it feels like it's always checking and it allows you to to run through a whole bunch of keys which is how all keyboards actually do this all right so that is the the copper of the parts the copper of the pads that come in with this surface mount version of the Pico and then what I did is I started to create traces and vias so vias are those holes that allow us to go from something that's on the top of the board through to the bottom and then continue on so you can see I took a bunch of the keys here that are on this side of the board across the top side of the board and then if I show the bottom copper traces those are that orange so it gives you the yellowish for the top and orange for the bottom those are actually they seemingly right on top of each other but that's because some of those are on top of the board some of those on the bottom of the board since we're using the surface mount part we actually use these vias to to go underneath I made by the way I may be underestimating this part it may automatically do that when you make a connection to the bottom so I may I'll definitely check that out and revisit this because I think the part was really smartly made and it may just do that for you and I may have done a bunch of extra work by creating these vias but that's what allows me to shoot from the top to the bottom and across without getting in the way of traces and this is the best I was able to do in a short amount of time of hand tracing this it's not as elegant as some software that lets you like snap to angles and make chamfered edges and things like that chamfered corners but I think is actually manufacturable and will work so what my next step was is to you'll notice I have none of the ground pins connected right now and if I turn on the rats nest layer you'll see this light blue show up those are all the ground pins saying hey we are in dotted lineville we don't have any connections and we should so what I did for that is I created a ground plane so it allows you to specify the top or the bottom or both sides of the board you seed one point so this is this is kind of cool you you pick any of your ground pins on the on the board I'm gonna use it one of the ones on the pico you right click and you say set ground fill seed and so that gives it the idea of what the ground fill network is and then you go up to I think you'll see it here but if I go up to the main menu routing ground fill ground fill top ground fill bottom ground fill both so I'm doing just the bottom layer and I've already done that so I'll show it when I when I add that copper fill on the bottom layer it creates essentially the full original plane of copper with just some parts drilled away or cut away where we need it for traces but all of the ground connections in fact I'm gonna flip to the bottom view and just show you so these this was one of the pins of my key switch it is now connected to ground you can see these other guys are islanded they're not connected to ground but this one is with this little kind of cross shape that gets made there so the copper fill does that for us it means that I'm not doing a whole bunch of extra traces to get around it's just anywhere we need ground we've got it now and nothing nothing got abandoned which was nice and you can see I've also put like a little logo there you can put a BMP you can mirror it if it's gonna be on the bottom that'll be on the silk screen so let's see I've still got enough time so let's let me show you what happens next I switch to the to the bench cam again and that one there so I went ahead and exported I'll show you in a second how you do that exported those files as PDFs and then I printed them I printed the copper layer of the top and I mounted it to some hardboard and the bottom so you can see it's got that big it's almost almost all copper it just drills away where we don't need it and that allows me to again do a sort of reality check I even used a hole punch to start popping things out so I could lay a switch in there sort of flat I still got some other holes that need to come out but that allows you to look and see does everything really fit on there if I take the Pico this is one that has headers on it that I won't really use but if I take the Pico and set it on there does everything seem to line up and that's what I did you can see if I sweep these guys away here that's what I did originally just with the part placement before I had done the traces but then you can go ahead and swap that in for the one that's going to show you the the final board also useful once you start doing mechanical design because there's a typically a layer of either PCB material or metal or plastic or acrylic that will be used to hold the switches in place you can see on Steve's board here there's some acrylic actually this PCB rather there's an acrylic spacer but this PCB that the key switches are snapped into you can see it here too I've taken apart a keyboard and these are the kind of two layers that matter you have the PCB that all those key switches are soldered to and you'll see those look pretty familiar same design and then the top layer all those keys snap into this plate of metal on this one is that metal that's plastic so that step is really helpful you can check a little do a little reality check that everything seems like it is what you thought everything will fit into space properly and now let's jump back to fritzing for a second here so in fritzing you can do this export for PCB so if I click on that we can do a PDF file which is what I printed there you can also use that for etching if you're doing an etch resist chemical process you can use that PDF and print it onto some toner transfer paper you can make an SVG file and you can send out a Gerber so what I did let me open up my finder view what I did was I exported the Gerber and these are the layers that it gave me the contour which is the shape of the board copper bottom copper top a drill template so that's coordinates I think it's like a xml file maybe that shows you um no it's like a almost like a machine code gcode kind of thing that just tells the drill where to go and what size to be to drill out all those holes I took all these files and I zipped them up into a Gerber zip file which is actually what some software CAD software or fabrication houses want to import there's solder masks for top and bottom paste masks if you're doing pick in place there's a file here about that I'm not going to be bothering with that silk bottom silk top so now here's the cool part what I'm going to do is I'll head to uh this browser and I'm going to go to Oshpark so Oshpark is a PCB manufacturer house let's you do quick turnaround uh low volume orders and on here you just click on this browse for files and I'll go to that Gerber zip file that I created oh that's my pdf directory hold on Gerber and get that Gerber zip this will now on the back end they're going to ingest that and pull it apart and figure out what layers things exist on there's some standardized naming I believe this is how it's done but it might be headers too probably is headers and this will now uh they've kind of verified that this can work they they aren't throwing up any warnings to me that I have drills going through traces or anything like that they check for some stuff like that um and they tell me it's going to cost 83 dollars 23 25 cents to get three of them so there's always a three board minimum but that's not bad it turns out it's about 28 dollars for one of these and then you can give them to a friend or sell them if you're making just a few and you only need one uh and now if I hit on continue this is the exciting part because they give you these nice previews of your board so here's what the top will look like I can get this pretty big in view here uh and then you can go through here and verify the design there's the board bottom it looks good to me and it looks real isn't that fun how it starts to look like a real thing uh gives me the drill holes silkscreen on top so there's the top layer traces without the solder mask on top so you can look at those and these are pretty big you can zoom in really close on the png file to look at it and see if it's it's what you hoped and thought it would be and uh here's what the bottom layer looks like so remember I mentioned that copper fill you can see all these little plus signs that's where the uh the ground pins are connected you want to look at little stuff like this to make sure that nothing's touching where it shouldn't it looks good that's probably a via so that's got copper but then it's going to get a drill hole through it um different masks silk bottom silk this one will be mirrored and they tell you that they have a nice little friendly description so they tell you what to expect and what you should be seeing uh but this this one here shows me uh for things like those vias they've got copper but then they've got drill so those should work just fine uh and that's pretty much it at this point you can go down and place your order for these hit order this is not an ad for ash park by the way it's just how i'm probably gonna get these so i can get them uh get them quick and continue this build you can also if you need them really fast you can hit this super swift service this one says it ships in four to seven business four to five business days four to seven calendar days if you go to super swift uh let's see does it say it doesn't say on there but i think that tends to get it uh in half the time or something like that so i've only done that once or twice but reason being you can't do the after dark which is the cool black uh fiberglass substrate i usually do that and that one doesn't have the swift service but uh yeah that'll double the costs and now you're talking about like 50 bucks a board so probably only if you're doing it for your uh live stream and need to get it real quick would you do that or you're you have a client you're impatient uh whatever there's lots of good reasons to do it fast um a lot of other great pcb houses jl pcb pcb way i'm not trying to um play a favorite here i've i think used ash park more than any other place um but i just do these kind of little one-offs so uh that's the process um let me know if you have questions people in the discord chat are talking about the uh viewers that exist out there for gerber viewers uh steve okay you're on he's the one who made that keyboard i keep showing this little guy here he does nice work he has good suggestions uh says that there's a circuitpeople.com as a gerber viewer if you want to inspect your files that's cool uh some talk about diodes from jeff uh you you don't need the diodes if you have the one key per i o thing um so it's simplifying but you can't do a full keyboard yes for sure um oh no yeah so Todd said the fritzing menus weren't showing up as part of the stream so go play with it yourself i think fritzing is five bucks or 20 bucks somewhere in there uh maybe it's still free also i think i paid some money in the last year for it but i i can't remember why uh or what was going on with that i think uh might be free who knows go check it out it's very cheap uh pretty pretty low learning curve um so you can get into it and make yourself maybe just make like a little three button keypad the smaller the board is the cheaper so if you made something that was just twice as wide as the pico and just had three keys on it probably be eight bucks a board or five bucks a board something like that um so i think that's it thank you so much for uh sitting through this very special edition of john park's workshop where we built a thing and uh and we'll continue to build it from scratch uh by the way i'll check out over in the uh youtube chat sorry i didn't check it out before there's um schott schockroff saying hi and scott's got a show right after this at 205 he's going to be doing a deep dive so make sure you you go check that out hugo thank you hugo doll says he thinks it's an eight dollar donation for a download but there are also free avenues like software package managers okay so yeah if you want to get to the nice easy all in one download installer page uh there's a suggested donation there of eight bucks um all right that's going to do it so i will uh see you next time and maybe i'll even have a circuit board ready at that point thank you hugo for saying fritzing.org that's where you want to go to check that out and that's also uh thank you and go check out scott's live stream next that's going to do it for me i'm john park this has been john park's workshop bye bye