MacroKey v1.0 - Pt.1
Recently, I started another electronics project. If you haven't read my last post I'll summarize it here. A while back I jumped into the deep end with my first-ever custom PCB. As someone who doesn't know much about hardware and EE, this project was extremely complex. It involved multiple control and power management ICs, Audio amplifiers, and DACs.
This time, I'm trying something simpler, a computer macro pad. It consists of two Cherry MX key switches, a rotary encoder (with pushbutton), and an STM32F072CBT6 microcontroller to put it all together. The goal is to load something like QMK onto it, so I can control what each switch does when I plug it into the computer. If this works, I plan on making a version with a grid of key switches.
I removed the USB C power management IC this time and went with the simpler, but not as flexible option of using two 5.1k resistors. In addition, I'm using a microcontroller that doesn't require external clocks so no extra crystal oscillators will be needed.
You'll notice no overcurrent, overvoltage, or ESD protection on the USB port. This is a design oversight and future versions will include it. But for now, it should be fine. Considering the microcontroller and LDO are both rated for low current, anything dangerous should destroy those first before causing any fires (hopefully 😄).

In addition, I'm also trying JLCPCB's assembly service. It adds a lot of work to the design stage, but it will save me many hours of placing SMD components as I don't have a microscope or a proper reflow hotplate.

Enclosure
I whipped up a quick enclosure in Fusion 360, leaving part of it inset so I can add a lid.

You might have noticed the pin headers, one is a UART and the other is an I2C header for an OLED display I might add in the future. The PCB fits into M2 pins and sits on top of chamfered posts so all of this is 3D printable.

But does it work?
Unfortunately, I oriented the LEDs incorrectly when submitting it for assembly, and won't have access to a hot air rework station for a month or so. For that reason, I'm going to be releasing part 2 of this blog post later. I plan to go over the software development process, something I have much more experience with 😄.

I have attached the KiCad project below, consider it MIT-licensed.