Part 2: PCB DesignAs soon as I struck on a design that tickled my fancy, I found myself in KiCAD drawing lines again. That's when things get real.
This keyboard needs to be my daily driver. A proper PCB is a must. It's a very expensive way to get a design made just for yourself, but that's the price I pay for durability and full LED support.
As with my previous projects, I'm basing the design around an ATmega32U4. It is well supported by the community and my firmware likes it very much. It has plenty of room for my current code base to grow, unlike smaller microcontrollers like the ATmega32U2, which is very short on RAM.
I think that ARM processors are going to be the norm very soon, and I think this is the right direction to move. The AVR architecture is too limited to keep innovating. However, I have lots I can still do with my trusty ATmega32U4. Plus, I have a pile of them in my basement to use.
To keep I/O lines open for the LEDs, I used a 4-to-16 line decoder for the column select. It's a nice little chip but it's hard to solder such small leads.
![Project Zeta: CompactTKL -- Design And Build Log (Complete!) 98296-0](https://geekhack.org/index.php?PHPSESSID=64fg9g32isljca66rt7bqsfn5t944gp2&action=dlattach;topic=71161.0;attach=98297;image)
To drive the backlights I'm using standard NPN transistors as a common collector amplifier. This is a pretty good design because it doesn't leech any power from the microcontroller. You just have to make sure to limit your LED current so that you don't overdraw from the USB.
The matrix is a fairly uninteresting 6x16 grid. Organizing and naming the switches and LEDs is always my least favorite part of the process. I usually try to layout the schematic similar to how I plan to layout the PCB, because it gives a little bit of insight as to where the traces might get busy.
![Project Zeta: CompactTKL -- Design And Build Log (Complete!) 98298-1](https://geekhack.org/index.php?PHPSESSID=64fg9g32isljca66rt7bqsfn5t944gp2&action=dlattach;topic=71161.0;attach=98299;image)
I decided to switch it up a little bit and I made the left and right hand different backlight zones. One reason was to even out the loading of my drivers, but also I figured it might lead to some interesting backlight usages in the future. I haven't really decided how to use it yet.
At this point I intended to take a break but I just couldn't help myself and dove into the PCB layout. It's a tedious task but I rather enjoy it. It's relaxing to trace those little lines around. It's exactly like putting a puzzle together. This board had quite a bit to fit compared to my other projects, however I decided to keep it simple and only support one specific configuration, so there was plenty of room.
![Project Zeta: CompactTKL -- Design And Build Log (Complete!) 98300-2](https://geekhack.org/index.php?PHPSESSID=64fg9g32isljca66rt7bqsfn5t944gp2&action=dlattach;topic=71161.0;attach=98300;image)
The only configuration option, as a matter of fact, is to install a MX Lock switch on the Caps Lock. It has an offset LED that requires an extra hole. Compared to my past projects, the switch footprints are less complex. I'm going for a refined look. Though the PCB supports PCB-mount switches, it requires plate mount stabilizers. I plan to use costar stabs, anyway.
I had PCBwing do the fabrication. They are a relatively cheap PCB fab, but they do a decent job. They are sticklers for design rules, though. You can't really get away with any broken holes or pads near the edges. I was feeling good about this design, so I splurged on the white solder mask.
![](http://i.imgur.com/11pKSb2l.jpg)
![](http://i.imgur.com/V6Cvhcal.jpg)
I can't help but grin when I see the fabricated PCB. I just love it. It looks good and it feels sturdy. I really like how the CompactTKL logo came out and the Geekhack logo looks really good, too. I don't know what my deal is with tiny SMD parts, though. Why do I always do this to myself? The pads look so big in the layout editor, I never think about how I'm going to solder it. *sigh*
Next, I need to give this thing a home...