Custom Keyboard PCB Design – Feedback before Production - Page 1
Forum section: electronics / projects

author: Stighiz
author_rank: Contributor
timestamp: May 29, 2025, 10:23:32 pm
content: Hi everyone,I'm designing a custom keyboard and I’ve created the PCB using KiCad. I’m planning to send it to production as soon as possible, but before doing that I’d really appreciate if some experienced eyes could review my work.I’ve uploaded all the relevant files: schematic, PCB layout and the resulting 3D model.I’m mainly looking for general feedback on the PCB layout, potential electrical or design issues, suggestions for improving trace routing or component placement, and anything else that could cause problems once the board goes into production (or hopefully, confirmation that the board should function correctly as it is once manufactured).This is my first keyboard PCB, so any advice or correction is very welcome!Thanks in advance <3PS: I’m aware that the GPIO assignments might not be the most logical or optimized. There are specific reasons behind those choices, which I won’t go into here, but I thought it was worth mentioning##################################################################################################################################################Update: if you're wondering what all your suggestions led to, or if you're brave enough to see what I’ve done with your advice, the revised version is now up on GitHub:https://github.com/Stighiz/Keyboard-for-production.git.

author: Someone
author_rank: Super Contributor
timestamp: May 29, 2025, 10:45:01 pm
content: Quote from: Stighiz on May 29, 2025, 10:23:32 pmAs is seen with many "first time" designs, why are you using a minimum track width and via size? Yes, the fab can do this but why are you choosing it?

author: Benta
author_rank: Super Contributor
timestamp: May 29, 2025, 11:01:18 pm
content: Yep, using "anorexic" tracks and via is unnecessary and impairs reliability. It seems some eCAD packages encourage it, dunno why.

author: Someone
author_rank: Super Contributor
timestamp: May 30, 2025, 12:44:35 am
content: Quote from: Stighiz on May 30, 2025, 12:21:16 amWhere did those defaults come from? You need to join up thespecificmanufacturers process (of which manufacturers usually offer a range of price points) with your design rules/constraints.

author: PGPG
author_rank: Frequent Contributor
timestamp: May 30, 2025, 10:03:10 am
content: Quote from: Stighiz on May 29, 2025, 10:23:32 pmI moved from THT to SMD in 90s. Soldering SMD elements is even easier than THT as you don't need to revert PCB all the time.I would use here SMD diodes, but as keys are THT than it is not critical.Quote from: Stighiz on May 30, 2025, 12:21:16 amI use mostly SMD elements assuming 0603 being a standard case. I use 0.25mm tracks as default and 0.8/0.4 vias as default.At PCB like your I would probably been using 0.5mm or even 1mm tracks. It looks you have planty of room.

author: tooki
author_rank: Super Contributor
timestamp: May 30, 2025, 10:33:02 am
content: I’ve had a keyboard fail because the thin tracks broke at the pad because of board flexing. (Single-sided PCB so they had to use thin tracks to make everything fit.) I would go with big, fat traces since you’ve got the room.Definitely use bigger pads, too. It’ll be MUCH easier to solder than with the vanishingly thin eyelets you have there now, especially on the ESP32. Use long pads if you want to retain the spacing between pads.Mounting holes?Test points?

author: tooki
author_rank: Super Contributor
timestamp: May 30, 2025, 11:08:02 am
content: With a bit of re-routing, you can also completely do away with vias. (I know, that isn’t a goal as such when you don’t pay for vias, but it is elegant!)Also, avoid the 90 degree angles. Decide on a minimum miter and use it consistently.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 30, 2025, 12:02:52 pm
content: I would also recommend using dual Schottky diodes in SOT23-3, common cathode ones in this case. S1 and S2 would share one, S3 and S4 one, and so on. At the end of the row, you can use only one of the two anodes, either connecting the same input to both anodes or leave the other flapping in the wind. For example, BAS70-05, BAS40-05, BAT54C would work well here. They are easy enough to solder by hand, but are tiny. And cheap.Because I myself tend to have stupid accidents like shorting pins accidentally to ground by poking with a screwdriver, I like to protect against my own uncle bumbleduckery by adding current-limiting resistors on the outputs. The value does not matter much, as long as it is high resistance enough that connecting the other end to VCC or GND does not burn the GPIO pin; 1k to 10k should work here. Assuming battery powered keyboard, I'd use 10k here, in 0603 or 0805 SMD footprint.You have two different options to read the keypresses on ESP32-S2.One is to havecol0..col11as outputs, at most one high at a time, withrow0..row2as inputs with pulldown enabled. A keypress will show up as logic high on the inputs. In this case, I would use twelve resistors, one for eachcol.The other is to havecol0..col11as inputs with pullups enabled, androw0..row2as outputs, at most one low at a time. A keypress will show up as logic low on the inputs. In this case, I would use three resistors, one for eachrow.

author: Stighiz
author_rank: Contributor
timestamp: May 30, 2025, 01:36:30 pm
content: Quote from: Someone on May 30, 2025, 12:44:35 amI just routed the tracks and placed the vias using KiCad’s default settings, so I assume those values came from KiCad itself.Thank you so much for pointing that out, that’s super helpful to know, and I’ll definitely look into the manufacturer’s specs as you said before finalizing the design

author: Stighiz
author_rank: Contributor
timestamp: May 30, 2025, 01:57:28 pm
content: Quote from: tooki on May 30, 2025, 10:33:02 amThanks so much for sharing your experience. I’ll definitely follow your advice regarding the wider traces and longer pads, especially around the ESP32.I actually forgot to add the mounting holes, thanks for it, and as for test points… I hadn’t even considered them...

author: Stighiz
author_rank: Contributor
timestamp: May 30, 2025, 02:04:59 pm
content: Quote from: PGPG on May 30, 2025, 10:03:10 amThanks for the tip! I’ll definitely keep that in mind for future projects, but for this one I already have the parts provided and pre-selected.QuoteThanks a lot, that’s really helpful!

author: Stighiz
author_rank: Contributor
timestamp: May 30, 2025, 02:09:18 pm
content: Quote from: tooki on May 30, 2025, 11:08:02 amYou’re absolutely right about avoiding the 90-degree angles, thanks for bringing that to my attention. Also, thank you for providing the improved routing; that was very kind of you. You cleared up a doubt I had because I was worried about running traces directly over the ESP space, but you confirmed that it’s not an issue.

author: Stighiz
author_rank: Contributor
timestamp: May 30, 2025, 02:18:24 pm
content: Quote from: Nominal Animal on May 30, 2025, 12:02:52 pmThank you very much for taking the time. I really like your idea about using the dual Schottky diodes, it sounds like a great approach and I will definitely keep in mind for the future, but as I mentioned in another reply, my parts are already pre-selected for this project :'(QuoteI will definitely follow your advice about adding current-limiting resistors. My configuration is the second one you described, with columns as inputs with pullups and rows as outputs.

author: tooki
author_rank: Super Contributor
timestamp: May 30, 2025, 03:14:20 pm
content: Quote from: Stighiz on May 30, 2025, 02:09:18 pmIt’s certainly fine on a socketed dev board like that. The dev board sits a good cm off your PCB, which should be fine for WiFi/BT radio performance.It actuallydoesbecome an issue when you use the bare ESP32 modules (that is, the little sub-board with the metal can, which you then solder onto your PCB), because you need to leave proper copper clearances for the antennas. Otherwise you risk severely impacting the radio performance. (Thedocumentationtells you exactly what to do.)If you were planning to solder the ESP32 dev board directly onto your PCB, and you need the WiFi/BT to work, I would make sure to remove the copper fill from underneath it. Don’t worry about the traces unless you need every bit of radio performance possible, in which case you’d probably move the entire thing to a different position. See the documentation link above.Or just use an ESP32 variant with the external antenna connector, and add an external antenna, of which there are gazillions of options.I’ve done this for several projects: when using a solid metal enclosure, I just use an external whip antenna. For another project which has plastic end plates on an otherwise metal enclosure, I used a self-adhesive patch antenna on the inside of the plastic.

author: tooki
author_rank: Super Contributor
timestamp: May 30, 2025, 03:36:22 pm
content: Quote from: Stighiz on May 30, 2025, 01:57:28 pmSince you’re using through hole parts, test points aren’t super critical.Except for one, which I strongly recommend adding: a place to connect ground. Make a ~2.2mm plated through-hole or via that you can stick your black multimeter probe into, and make a 5-6mm plated hole close to the edge of the board (around 2mm clearance works) that you can clip your oscilloscope ground clip onto. (I finally did this on a recent PCB of mine and it makes probing so much easier, since you have an extra hand free!!)Also, add the date and board version number somewhere. If you ever make an updated version, you’ll be happy to be able to easily tell them apart. You can also add the name of the board or project, and/or the filename of the PCB file. Whatever’s useful.If you’re planning to make multiple copies of the board, label a spot for a serial number, whether you have the PCB maker print those for you (JLCPCB now does this for free!) at the factory, or you add them later with a marker or label.

author: Stighiz
author_rank: Contributor
timestamp: June 01, 2025, 04:11:37 pm
content: Quote from: tooki on May 30, 2025, 03:14:20 pmThanks a lot for the advice, that’s really helpful <3.Right now I’m not using the antenna since I’m communicating via USB, but I’d like to make the board wireless in the future, so it makes sense to isolate the antenna area from the start.Would you agree that the antenna isn’t actually shown in the footprint? From what I can tell, it’s likely located just below the bottom edge of the footprint (roughly where the “U1” silkscreen label is) .If that’s the case, I currently have signal traces running underneath that area, which I now realize might interfere with wireless performance. So I’m thinking of re-routing those traces elsewhere, maybe to the area above the microcontroller instead.Does that make sense to you?Here’s the link to the footprint I used:https://www.snapeda.com/parts/ESP32-S3-DEVKITC-1-N8R8/Espressif%20Systems/view-part/Thanks again for your time and availability!

author: tooki
author_rank: Super Contributor
timestamp: June 01, 2025, 11:17:04 pm
content: Quote from: Stighiz on June 01, 2025, 04:11:37 pmI would only bother if the entire design is wireless-ready, including power supply. In particular, if you want it to be battery-powered, then I would strongly suggest using a third-party dev board that has an onboard LiIon charger chip already. (I recently used the OlimexESP32-S3-DevKit-Lipoand DFRobotBeetle ESP32 C3, both of which have a charger chip. In the latter case, I modified it to disconnect the LDO enable pin from the 5V supply, and instead connected that to a button and one of the GPIOs to give it the ability to shut down under software control. Pressing the button turns it on, and then the very first lines of setup code set the GPIO to an output and set it to H to hold the enable line high. When it's time to turn off, the software turns the GPIO to L and the LDO turns off.)Quote from: Stighiz on June 01, 2025, 04:11:37 pmCorrect, it's not shown. That's why I draw my own or modify an existing one for the ESP32 dev boards. It's also why I add the 3D model to the footprint, so that I can REALLY see how it fits together.See attached the screenshots of a board I laid out exactly 3 years ago to the day (according to the date on the board) and the footprint. (It's for the older ESP32-DEVKITC-1.) On the board, I just raised the 3D model off the board to simulate having a socket. Today, I would actually just import the 3D model of the socket, too, so that the height is actually precise.(When I first started doing PCB layouts, I thought 3D models were just a cute luxury. I quickly learned that was completely wrong: the models are extraordinarily helpful, both for seeing how a board comes together, as well as being a great check of whether the footprint is actually correct by being able to see how pins fit onto the pads. I now religiously add 3D models. If the vendor doesn't have a model, I at least draw a sort of "block model" of it using simple extruded rectangles and cylinders that capture the key geometry.)Snap Magic has lovely 3D models of both the ESP32-S3-DEVKITC-1-N8R8 and ESP32-S3-DEVKITC-1U-N8R8.Quote from: Stighiz on June 01, 2025, 04:11:37 pmYes, that's correct, based on the locations of the double 3.3V and GND pins on opposite corners. The antenna sticks out towards the bottom of your board. The USB ports are at the top.Quote from: Stighiz on June 01, 2025, 04:11:37 pmAs I mentioned earlier, it depends on how the board is mounted. Are you using sockets (which I HIGHLY recommend at this stage, if you have the space)? If so, I would not bother. It's a bit off the board, so probably fine anyway, but if you did run into trouble, it'd be trivial to swap out the regular ESP32-S3-DEVKITC-1-N8R8 board for the ESP32-S3-DEVKITC-1U-N8R8 version with the external antenna connector.If you are soldering the dev kit directly into your PCB, meaning that you just have around 2-3mm space between them, then I would just remove the ground pour from that area and leave the traces. Maybe even more important would be to make a board cutout around the USB ports, because if you don't, you won't be able to fit in most USB plugs.

author: Stighiz
author_rank: Contributor
timestamp: June 08, 2025, 04:23:45 pm
content: Quote from: tooki on June 01, 2025, 11:17:04 pmThanks, that’ll be really useful for a future wireless V2!QuoteI used to think 3D models were kind of a luxury too, but your answer really opened my eyes. I looked into how to use them and ended up applying them across the whole design. It cleared up a lot of doubts (like getting the ESP32 orientation right) and made the final layout way easier to visualize. Super helpful!QuoteRegarding the antenna isolation, I’ve thought it over and decided not to implement it for now. I think it really only makes sense if the entire design is already wireless-ready, especially with a battery-powered setup. Since I’m currently using USB for both communication and power, I’m not using the antenna at all and therefore not too concerned about potential interference at this stage. That said, wireless functionality is something I’m planning to include in a future version. As someone suggested earlier, I might opt for a development board with an integrated charger when I get to that point.Would you agree with this approach for now?

author: tooki
author_rank: Super Contributor
timestamp: June 09, 2025, 03:26:35 pm
content: Yeah, that was me.That was my point: either optimize fully for a wireless, battery version now, or don’t optimize for that at all. Because a board that’s only half compatible with a wireless, battery version is just a wired version.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 09, 2025, 04:49:31 pm
content: I also recommend using one of the OlimexESP32 boardswith a LiPo charging circuitry and a connector for aLiPo battery. Many of them are OSHW-certified (i.e. open hardware, with schematics etc. available), and although Olimex' support is limited, they have a track record on this for over a quarter of a century; I definitely consider them as reliable and of good reputation as SparkFun and Adafruit for example. Plus, the prices are quite affordable, theESP32-S3-DevKit-LiPoselling for under 8€ apiece (not including VAT or shipping).In fact, I have considered making a wireless 12-button gamepad/keyboard out of one, with the board and such on the "back", with just the buttons and a connector for a small display on the "front". I do have old designs based onCH551Gand SparkFun/ArduinoPro Micro(ATmega32U4), both with a small OLED display so that I can change at run time which keypresses each button produces, but they are fully wired, getting their power via USB. (I really should add a CLC filter on the OLED 3.3V supply, or even use a separate regulator for the 3.3V, because OLEDs are electrically switchy-noisy.) For a new one, I'd prefer a full-color IPS panel with SPI bus;BuyDisplayhas a nice selection with datasheets on each, and sells them on both eBay and AliExpress. Most of the time, the display would be off, only active when selecting operation modes (HID keyboard keypresses and key mapping, or HID gamepad mode).

author: Stighiz
author_rank: Contributor
timestamp: June 11, 2025, 03:15:21 pm
content: Quote from: Nominal Animal on June 09, 2025, 04:49:31 pmThanks, that sounds like a really interesting project. I appreciate you sharing the technical details, I’ll definitely keep your suggestions in mind for the v2 of my keyboard (wireless version)

author: mariush
author_rank: Super Contributor
timestamp: June 11, 2025, 03:34:10 pm
content: You have enough IO and space on the PCB that you could route each button to an individual IO pin.Or you could use a chip like TM1637 or TM1638 for the key scanning functionality without having to use diodes. You don't have to use the led driver part of these chips but could be a nice feature to use the led drivers for backlight (have leds under each key if you want)TM1637 (2 x 8 keys scanner + 6 digit x 8 segment led driver) :https://www.lcsc.com/product-detail/Digital-Tube-Drivers_TM-Shenzhen-Titan-Micro-Elec-TM1637_C2962580.html?s_z=n_tm1637TM1638 (3 x 8 keys scanner + 8 digit x 10 segment led driver) :https://www.lcsc.com/product-detail/Digital-Tube-Drivers_TM-Shenzhen-Titan-Micro-Elec-TM1638_C19187.html?s_z=n_tm1638AiP1612 (2 x 10 keys scanner + 4-7 digit x 10-14 segment led driver) :https://lcsc.com/product-detail/Digital-Tube-Drivers_Wuxi-I-core-Elec-AiP1612_C190477.html

author: Stighiz
author_rank: Contributor
timestamp: June 11, 2025, 03:53:47 pm
content: Quote from: Stighiz on May 29, 2025, 10:23:32 pmHi everyone,Just wanted to say a big thank you to all of you for the feedback and suggestions you gave me on my steno keyboard PCB project. You've all been incredibly helpful and kind, and I really appreciate the time you took to look at my design.Thanks to your input, I was able to make a lot of improvements and corrections and it really made a difference.If you're wondering what all your suggestions led to, or if you're brave enough to see what I’ve done with your advice, the revised version is now up on GitHub:https://github.com/Stighiz/Keyboard-for-production.git. There you’ll find all the project files as well as some simple screenshots for a quick look.Have a look if you’re curious and let me know if, in your expert opinion, it finally looks ready for production!Thanks again, this was one of the most constructive and supportive exchanges I've had on a forum <3

author: Stighiz
author_rank: Contributor
timestamp: June 11, 2025, 04:14:37 pm
content: Quote from: mariush on June 11, 2025, 03:34:10 pmThanks a lot for your advice, I love the idea about LED backlighting! For v2, which I plan to make wireless and more refined, I’ll either use Schottky diodes or your chip idea for key scanning, both sound great and I can’t wait to try them out.This is actually a university project that I didn’t expect to get so passionate about, but now I really enjoy working on it and want to keep improving it. For now, I’m leaving v1 as a simple prototype because of tight universty deadlines, but I’m excited to come back with a better v2 in the future

author: Stighiz
author_rank: Contributor
timestamp: June 12, 2025, 02:09:37 pm
content: Quote from: tooki on June 09, 2025, 03:26:35 pmMy doubts and I, we love u <3