So we're back with some more advanced PCB stuff, I highly recommend watching my previous Kicad videos before this if you haven't already. Keyboard Matrixes: ruclips.net/video/7LyziNdFlew/видео.html Kicad for Keyboards: ruclips.net/video/8WXpGTIbxlQ/видео.html
Fiiiine I'll open up my stupid KiCAD so I can make another stupid keyboard so I can throw my stupid money at my stupid screen! You made me do this Joe! Great video, learned a ton!
Good stuff. Some notes: Decoupling caps should be as “manufacturably” close to the VDD pins as possible, bulk cap is more forgiving. Typically you would do Via, bulk cap , decoupling cap then vdd pin. Also take into account your power planes and reference planes depending on how many layers you have . It is better to have a solid ground layers and use copper pours for power connections for better impedance but at the expense off potential increased capacitance. USB is harder to impedance match on 2 layers because of the distance of the ground plane to the diff pairs for 90 Ohms but if the distance is really short and not close to other tracks, you can usually get away with it. Low speed GPIO won’t be as susceptible to crosstalk but it is usually better to fan out your tracks after leaving the ICs pads.
Thanks for the feedback, I've had a few people reach out about some design choices here and I'm nearly ready to release V2. It should follow better practices and be more reliable: github.com/joe-scotto/scottokeebs/pull/18
This is priceless... I have been looking for a straightforward tutorial about making integrated mcu boards for a while now, mainly because I wanted to slim down my pcbs and keyboards (for wrist placement and health). Can't wait for the rp2040 tutorial as I've grown quite fond of those. Thank you for the video... much appreciated!
Great video, few things: 1. You probably want to provide a more powerful voltage stabilizer. Some people might want to add LEDs, and other perioherals which might draw extra power that the current one wont be able to provide. I recommend an LM317M. Its super widely available, been produced for ages, and can supply up to 500mA. 2. Its not bad to spread the decoupling caps out for the STM32 a little bit, this will improve solderability of the board in case something goes wrong and you have to fix it by hand. 3. Watch out for acid traps. While most modern PCB manufacturers arent affected, it is still considered good etiquette to avoid them. 4. The BOOT0 pin on the STM32 does nothing but select wether to jump to the standard bootloader or application code. This feature is seldom used on most boards, however if you don't plan on using an external debugger, this will suffice. 5. The STM32F072 is not the most common chip. A much more common and widely available one is an STM32F103, there are also a lot of clones, making this chip available basically everywhere. 6. Good etiquette is also naming the global labels that youre using on an STM32 to the respective rows and columns on the switch matrix
Awesome video! Ive recently got into keyboards and started looking into kicad to make a personal custom design. Would love to see a video including RGB into the design, great work
When the MCU is switching (doing logic), it causes sudden current draws. The caps are there to provide a source of current, so the voltage can stay stable (drawing too much current causes noise)
you should do a guide on kicad footprint and symbol library guide. covering import and exporting. good places to find footprints. you have good guides and i would love to have one of these guides done by you.
I would love to see a video about what it takes to make a split keyboard e.g. what needs to change when you have two controllers, two halves connected via USB-C, etc.
Some interesting comments. Awesome video I was thinking of designing a keyboard myself and doing research on that matter. I was watching from a perspective of someone who designs PCB for a living. Feedback from me (explaining some concepts in as simple words as I can but there is much more depth to it then stated here): 1. Decoupling Capacitors are important and they act as a power well or reserve when the MCU needs a boots in power so placement is crucial (i.e. its performing some tasks and the needed current rises above what it typically needs so the decoupling caps provide it with a small boost until the power supply catches up), also it acts as a filter for noise and damper (think of the power you getting from the power supply in this case USB, its not a perfectly straight line. There are ripples within the voltage levels and the caps damp these ripples to create a smoother voltage level per say.) You need a decoupling capacitor per power input into the MCU so in your case I think 5 from what I can see in your MCU symbol assuming its correct. 2. Use thicker traces for power, provided multiple benefits. 3. You dont need to use a via the way you did when routing the differential pair from the USB C end. You can move the VBUS trace further back and then route one of the pairs behind it creating a better continuous trace without the need for a via. 4. Return paths for your traces. It seems like you are using a 2 layer board which could cause issues in regards to return paths if its not done properly and introduce a lot of noise into your system. One example i can see is your Data line from USB C it has a voltage trace running above/underneath it and the data line has no unbroken return path under it introducing a possibility of noise into that trace
Thank you for the feedback, I actually ended up releasing a V2 that overwrites what I show in the video. The main fixes were for the ESD/Fuse routing and decoupling caps. I also swapped to a 4 layer PCB for better ground/EMI isolation. It still uses the same concept as shown here with just 4 traces between modules but overall should be much more robust. It's on the repo now :)
@@joe_scotto Pretty awesome V2, just had a look at it. I am curious as to why you don't have a ground pour over top and bottom layer? Normally you would keep those in order to reduce manufacturing cost and have balanced copper across the board. Also helps with EMI issues, stitch the ground together for it. Curious hence I ask Just another note, not sure if you implemented it but did you do differential pair routing at 90 Ohms? if the traces are not too long it should not effect it too much but your one is a distance away and its good habit to implement it regardless. I know JLCPCB have a calculator that helps with the calculation, in your case its co-planner differential pair
Hello, nice video. I have a single comment regarding the ESD protection, the input and the output of the ESD should not be the same net, and as such should not be directly connected. That negates the protection. Example from what I know: D+, D- from usb c conector are a differential pair that goes to the protection And then you should create another differential pair (DM and DP) that goes from the protection to the MCU. Hope this helped
Hi Joe, not sure if I'm the only one who got the eyes caught by the colors used for schematic, they are super awesome, make reading the schematic very easy. Can you please share how you did that? Is some sort of theme ? And btw, the content is super awesome, useful and engaging.
Could you please create a tutorial like this for a board that would use a JST connector, rather than the receptacle? I'm specifically trying to figure out how to make a 60% pcb with a daughterboard through a JST connector (trying to avoid molex for durability issues). I've looked up guides online, and some are referring to using Conn_01x02_Pin or Conn_01x04_Pin. Though a lot of the discussions on forums get really technical and it's kind of hard for a beginner to understand. Oh and I'm also curious as to how you can put multiple layouts on a single pcb (e.g. having a 6.25U spacebar and 7U spacebar cutouts for a pcb). I'm still looking into this, and will probably find something in a forum, but it'd be helpful to have some sort of tutorial from you as well! Side note, thanks so much for putting these out here. It's super helpful for learning Kican and working towards my goal of designing my first board.
The JST is fairly simple, you put the JST female on the keyboard PCB and route it directly to the chip (D+, D-, VBUS, GND). It will be Conn_01x04 in whatever version of JST you want. Then you make a daughterboard that houses all the USB-C stuff as I showed in the video. Then also just put a female JST on there and it should just work. Multiple layouts is as simple as it would seem, you just overlap the footprints and then use QMK to change it. You would just route them together so whichever one you use becomes the one that makes the connection with the switch. Feel free to join my Discord server and ask questions there :) scottokeebs.com/discord
Decoupling capacitors placement IS IMPORTANT, a bad placement or just ignore them and don't set them nearby your MCU can cause lots of noise. Your keyboard is just gonna be an easy target for EMI and the voltage supply to the MCU is gonna fluctuate.
This was very informative as always, Thanks :) Any chance you can make another video about how to program a board like this? By 'program' I mean how do you load the compiled firmware from a PC to the newly assembled PCB? (PCB with an STM32 MCU) More specifically: Do you connect a USB cable to program it? With what programming software? Does it depend on the bootloader? What bootloader does the MCU come with? I was able to find many tutorials on how to do it with an arduino but I'm having a hard time answering these questions when I'm comes to designing a PCB with a standalone MCU.
The STM32 I use here just works basically. When you get the board, you hold the boot button when plugging it in and you’ll be able to flash with QMK toolbox.
I'm curious about how you chose the fuse. I cannot find the power draw of the STM32, so did you just go "Meh, 500mA is good enough ?" or did you have some other information like measured power draw of other similar keyboards ?
Very informative, unfortunately this MCU is not easily available in my country, if looking for an alternative what parameters should I be checking for it to work as a kb usb controller.
Hey you are awesome magic inspiration to us , thank you. good videos. but hey if you Left some area of the pcb circuits be shown when you flash your face to the screen, (dont change the full view away from teh circuit design ) then we feel more fun be cause we can still think the circuit design math and parts we can somewhat see. those electronics moveing math is magic fire to us. you let us joy fun to produce more results, and also i give you very good tip. god bless your work
So we're back with some more advanced PCB stuff, I highly recommend watching my previous Kicad videos before this if you haven't already.
Keyboard Matrixes: ruclips.net/video/7LyziNdFlew/видео.html
Kicad for Keyboards: ruclips.net/video/8WXpGTIbxlQ/видео.html
Fiiiine I'll open up my stupid KiCAD so I can make another stupid keyboard so I can throw my stupid money at my stupid screen! You made me do this Joe!
Great video, learned a ton!
Finallllyyyy!!! I have been waiting for this for so long. Thanks joe!
Good stuff. Some notes:
Decoupling caps should be as “manufacturably” close to the VDD pins as possible, bulk cap is more forgiving. Typically you would do Via, bulk cap , decoupling cap then vdd pin. Also take into account your power planes and reference planes depending on how many layers you have . It is better to have a solid ground layers and use copper pours for power connections for better impedance but at the expense off potential increased capacitance.
USB is harder to impedance match on 2 layers because of the distance of the ground plane to the diff pairs for 90 Ohms but if the distance is really short and not close to other tracks, you can usually get away with it.
Low speed GPIO won’t be as susceptible to crosstalk but it is usually better to fan out your tracks after leaving the ICs pads.
Thanks for the feedback, I've had a few people reach out about some design choices here and I'm nearly ready to release V2. It should follow better practices and be more reliable: github.com/joe-scotto/scottokeebs/pull/18
Can't wait to see your rp2040 module.
This is priceless... I have been looking for a straightforward tutorial about making integrated mcu boards for a while now, mainly because I wanted to slim down my pcbs and keyboards (for wrist placement and health). Can't wait for the rp2040 tutorial as I've grown quite fond of those.
Thank you for the video... much appreciated!
If I am not mistaken the resistors on CC1 and CC2 are to be able to use USB-C to USB-C cables, otherwise you can only use USB-A to USB-C.
This is awesome work. I'm really looking forward to your RP2040 module version.
An absolute masterpiece of a guide. Thanks a ton for putting this out.
Great video, few things:
1. You probably want to provide a more powerful voltage stabilizer. Some people might want to add LEDs, and other perioherals which might draw extra power that the current one wont be able to provide. I recommend an LM317M. Its super widely available, been produced for ages, and can supply up to 500mA.
2. Its not bad to spread the decoupling caps out for the STM32 a little bit, this will improve solderability of the board in case something goes wrong and you have to fix it by hand.
3. Watch out for acid traps. While most modern PCB manufacturers arent affected, it is still considered good etiquette to avoid them.
4. The BOOT0 pin on the STM32 does nothing but select wether to jump to the standard bootloader or application code. This feature is seldom used on most boards, however if you don't plan on using an external debugger, this will suffice.
5. The STM32F072 is not the most common chip. A much more common and widely available one is an STM32F103, there are also a lot of clones, making this chip available basically everywhere.
6. Good etiquette is also naming the global labels that youre using on an STM32 to the respective rows and columns on the switch matrix
A note about the usb c port shield conn, only master devices should have it connected to gnd. Slave devices should leave it floating/NC
Awesome video! Ive recently got into keyboards and started looking into kicad to make a personal custom design. Would love to see a video including RGB into the design, great work
When the MCU is switching (doing logic), it causes sudden current draws. The caps are there to provide a source of current, so the voltage can stay stable (drawing too much current causes noise)
you should do a guide on kicad footprint and symbol library guide. covering import and exporting. good places to find footprints. you have good guides and i would love to have one of these guides done by you.
fantastic stuff super super helpful. mant thanks for sharing this.
looking forward to rp2040 and atmega 32u4 chip based design as well.
this video is awesome, it really helped me out
Wait this theme is so nice
I would love to see a video about what it takes to make a split keyboard e.g. what needs to change when you have two controllers, two halves connected via USB-C, etc.
Some interesting comments. Awesome video I was thinking of designing a keyboard myself and doing research on that matter. I was watching from a perspective of someone who designs PCB for a living. Feedback from me (explaining some concepts in as simple words as I can but there is much more depth to it then stated here):
1. Decoupling Capacitors are important and they act as a power well or reserve when the MCU needs a boots in power so placement is crucial (i.e. its performing some tasks and the needed current rises above what it typically needs so the decoupling caps provide it with a small boost until the power supply catches up), also it acts as a filter for noise and damper (think of the power you getting from the power supply in this case USB, its not a perfectly straight line. There are ripples within the voltage levels and the caps damp these ripples to create a smoother voltage level per say.) You need a decoupling capacitor per power input into the MCU so in your case I think 5 from what I can see in your MCU symbol assuming its correct.
2. Use thicker traces for power, provided multiple benefits.
3. You dont need to use a via the way you did when routing the differential pair from the USB C end. You can move the VBUS trace further back and then route one of the pairs behind it creating a better continuous trace without the need for a via.
4. Return paths for your traces. It seems like you are using a 2 layer board which could cause issues in regards to return paths if its not done properly and introduce a lot of noise into your system. One example i can see is your Data line from USB C it has a voltage trace running above/underneath it and the data line has no unbroken return path under it introducing a possibility of noise into that trace
Thank you for the feedback, I actually ended up releasing a V2 that overwrites what I show in the video. The main fixes were for the ESD/Fuse routing and decoupling caps. I also swapped to a 4 layer PCB for better ground/EMI isolation. It still uses the same concept as shown here with just 4 traces between modules but overall should be much more robust. It's on the repo now :)
@@joe_scotto Pretty awesome V2, just had a look at it. I am curious as to why you don't have a ground pour over top and bottom layer? Normally you would keep those in order to reduce manufacturing cost and have balanced copper across the board. Also helps with EMI issues, stitch the ground together for it. Curious hence I ask
Just another note, not sure if you implemented it but did you do differential pair routing at 90 Ohms? if the traces are not too long it should not effect it too much but your one is a distance away and its good habit to implement it regardless. I know JLCPCB have a calculator that helps with the calculation, in your case its co-planner differential pair
Can you upload a video about how flash qmk with this stm 32 ❤
Hello, nice video. I have a single comment regarding the ESD protection, the input and the output of the ESD should not be the same net, and as such should not be directly connected. That negates the protection.
Example from what I know:
D+, D- from usb c conector are a differential pair that goes to the protection
And then you should create another differential pair (DM and DP) that goes from the protection to the MCU.
Hope this helped
Yup, updated on V2 :)
Yesssss! Finally!!!
I needed this when i actually prefered pcbs but it could be useful later 😅😅😅
Awesome video!!! Could you make a tutorial with hall effect switches and larger MCU not using a keyboard matrix? 🖤
Hi Joe, not sure if I'm the only one who got the eyes caught by the colors used for schematic, they are super awesome, make reading the schematic very easy. Can you please share how you did that? Is some sort of theme ? And btw, the content is super awesome, useful and engaging.
Search up "Dracula Kicad Theme"
Nice.. can you make a detailed tutorial about making a case and plate?
Could you please create a tutorial like this for a board that would use a JST connector, rather than the receptacle? I'm specifically trying to figure out how to make a 60% pcb with a daughterboard through a JST connector (trying to avoid molex for durability issues). I've looked up guides online, and some are referring to using Conn_01x02_Pin or Conn_01x04_Pin. Though a lot of the discussions on forums get really technical and it's kind of hard for a beginner to understand.
Oh and I'm also curious as to how you can put multiple layouts on a single pcb (e.g. having a 6.25U spacebar and 7U spacebar cutouts for a pcb). I'm still looking into this, and will probably find something in a forum, but it'd be helpful to have some sort of tutorial from you as well!
Side note, thanks so much for putting these out here. It's super helpful for learning Kican and working towards my goal of designing my first board.
The JST is fairly simple, you put the JST female on the keyboard PCB and route it directly to the chip (D+, D-, VBUS, GND). It will be Conn_01x04 in whatever version of JST you want. Then you make a daughterboard that houses all the USB-C stuff as I showed in the video. Then also just put a female JST on there and it should just work.
Multiple layouts is as simple as it would seem, you just overlap the footprints and then use QMK to change it. You would just route them together so whichever one you use becomes the one that makes the connection with the switch.
Feel free to join my Discord server and ask questions there :)
scottokeebs.com/discord
Decoupling capacitors placement IS IMPORTANT, a bad placement or just ignore them and don't set them nearby your MCU can cause lots of noise. Your keyboard is just gonna be an easy target for EMI and the voltage supply to the MCU is gonna fluctuate.
Yes, fixing this in V2. Video coming out in a few days.
This was very informative as always, Thanks :)
Any chance you can make another video about how to program a board like this?
By 'program' I mean how do you load the compiled firmware from a PC to the newly assembled PCB? (PCB with an STM32 MCU)
More specifically: Do you connect a USB cable to program it? With what programming software? Does it depend on the bootloader? What bootloader does the MCU come with?
I was able to find many tutorials on how to do it with an arduino but I'm having a hard time answering these questions when I'm comes to designing a PCB with a standalone MCU.
The STM32 I use here just works basically. When you get the board, you hold the boot button when plugging it in and you’ll be able to flash with QMK toolbox.
I'm curious about how you chose the fuse. I cannot find the power draw of the STM32, so did you just go "Meh, 500mA is good enough ?" or did you have some other information like measured power draw of other similar keyboards ?
Typical USB spec is 500ma and 5v.
Very informative, unfortunately this MCU is not easily available in my country, if looking for an alternative what parameters should I be checking for it to work as a kb usb controller.
Enough pin ports, frequency, USB communication, programming tools.
Any STM32 or PIC24 can handle this task.
The stm32f411re could be a good option.
Thank you very much! May I ask you which Pinout can be used for serial communication between split keyboard?
Thx :)
Hey you are awesome magic inspiration to us , thank you. good videos. but hey if you Left some area of the pcb circuits be shown when you flash your face to the screen, (dont change the full view away from teh circuit design ) then we feel more fun be cause we can still think the circuit design math and parts we can somewhat see. those electronics moveing math is magic fire to us. you let us joy fun to produce more results, and also i give you very good tip. god bless your work
For not being an electrical engineer, you sound a lot like an electrical engineer. :)
No. He has misinformation about some things
Hey uh using KICAD (8.0) when i tried using scottokeeb footprints it didn't show anything could you uh explain to me how to fix it?
Don’t search for them, manually scroll in the selection window to find the library. It’s another bug in Kicad 8+ where search doesn’t show everything.
i see you have fallen down the 3d printer rabbit hole as well
i'm fink people need mirror keyboard to working like bodybuilder asymmetry of brain. i fink about two keyboard in one