We designed a custom macro keypad to improve our KiCad workflow. The PCB was designed in KiCad, fitted with rotary encoders, leds and Cherry MX Blue switches all powered by a Teensy board. A custom enclosure was then modelled in RS Design Spark and 3D Printed on our Ultimaker S5. The KiPad groups all the useful PCB layout functions for the left hand, leaving the right hand free to stay on the mouse - no more jumping back and forth to the keyboard. It has everything we need daily: Lay tracks, change layers, visibility settings, grid/track sizes - there's even media controls for those deep-work tunes.

Transcript

The Factory is a new series where we explore PCB assembly and all the side projects that crop up along the way. This episode is all about a hardware solution to PCB software workflow. But if you're curious about how electronics are manufactured at scale, check out the other videos in the Factory playlist.

We've been designing our Core Electronics Originals in KiCad and after a while I began to notice some workflow quirks that started to annoy me a little. The right hand moves back and forth a lot between keyboard and mouse and some of the hotkeys are kind of bonkers. For example, the measure tool is CTRL-SHIFT-M so that's a move off the mouse to perform the command and back to perform the measurement or keep your hand on the mouse and do this thing.

Wouldn't it be nice to have a custom macro keypad with all the common functions like move, rotate, lay tracks, change layers, high contrast mode, a one-button measure tool and some media controls would be nice too. So I'll need knobs for that and maybe grid size and track size. So of course I fired up KiCad and began laying out this custom macro keypad.

Really simple stuff, a matrix keypad, a few rotary encoders, some LEDs and I chose some nice clicky Cherry MX Blue switches to match the keyboard that I use. First up is schematic layout. There's libraries for all these parts and with a little searching I came upon some 3D models which will make modeling the case way easier because you can just sculpt it around the electronics.

A challenge with making usable electronics is fitting it all into a reasonably sized case. The keypad has a Teensy mounted on the rear side of the board so I can fill the front with more cool buttons and knobs. That means that you have pins fromButtons and knobs are coming in from one side of the board, while pins from the Teensy are coming in from the other side. To accommodate the overlap, I modified the Teensy footprint by deleting the unnecessary pins. This allowed me to recover enough space to mount the Teensy under the middle rotary encoder. Since those fins are unused, it will be fine.

After sending the PCB off to the fab house, I started designing the case. I used Design Spark by RS Components, which feels a bit like baby town 3D modeling. It's not parametric, but I found it really intuitive and awesome for getting fast results. It's perfect for sculpting a case around another model.

Once the PCB arrived, I started assembling it. The pleasing press fit of the Cherry switches into the PCB before soldering was one of those visceral experiences that makes projects like this worthwhile. Next, I worked on the LEDs. I'm not really sure what I'll use them for, but they're a bit of a frivolous addition, so it's nice to have options.

After that, I soldered the Teensy to the rear side with its unique pin arrangement. You can see the pins crossing directly under one of the rotary encoder footprints. It was at this point that I realized I messed up. A combination of midnight engineering, deleting Teensy pins without caution, and being too cool to read the DRC carefully all came together in the perfect recipe for trouble. It turns out that I now have a beautiful 4x4 keypad that is completely disconnected from the Teensy. There are no tracks on the PCB that connect the two together.

So, it's time for some damage control. Enamel copper wire, also known as magnet wire, is the oldest and dirtiest trick in the book. You can cut it to length and scrape off or burn off the enamel coating wherever you need to.Just wasted an hour fixing something because you were too lazy to do it properly the first time. The good news is the case is now finished printing so it's time for a fit up.

First the threaded inserts go in. This is my first time using threaded inserts and I'm kind of in love. A bare soldering iron tip worked best for me. I also tried indirect heating using a fastener pre-loaded to the insert but I found that much slower and the greater thermal mass keeps the plastic softer for longer making for some mushy standoffs.

The PCB is held in by standoffs which sit a little below the edge of the case and that allows the back cover to go on nice and flat. I'll spare you the gory details of programming. Suffice to say the Teensy has a great HID keyboard library. Just scan the matrix, look for a key press and send the appropriate keystroke combination. Throw in a few bugs and you're done.

You could create key legends too. Keycad 6 is due for release soon so I dove into the development repo and rummaged around for the button icons used in the software. I imported those into Illustrator and made a few alterations for alternate functions or created artwork where there was none already. You can print this design onto sticker paper and cut the legends out and stick them onto your keys. The layout of my keypad will likely evolve a bit as I get used to it so I'll hold off making my labels for now. I just included that as a neat trick for sourcing artwork.

Of course I've included all the 3D models and code in the links below. The case you saw for most of this video was an earlier draft. I was going for an easy minimum viable case but I just hated it. It was too tall and too pointy. Very uncomfortable. I didn't count this rework asFrivolous because the keypad was practically unusable with such an awful case. This project, like many, was an exercise in restraint. Ruthlessly cutting frivolous features early on is the difference between an imperfect but finished project that lives on your bench and a perfect project that exists only in my imagination.

I wanted to make the keypad way bigger, include more functions, profiles for different software packages. Maybe you select those with like a combination of key press and knob turn. Realistically all that would take 10 times longer than just getting to this point. And I'm pretty pleased with this result.

Of course this base design could be repurposed for any workflow or game. It's just a matter of redefining the macros. If you find this design useful or make anything cool out of it we'd love to hear from you over at the Core Electronics forums.

Best of luck and see you next time.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.