Modifying and fixing my Das Keyboard

Introduction

So I managed to break my Das Keyboard… Yes I was sad (buying a replacement isn’t cheap). After discussing with a good friend I decided to get it back to a functioning state and also modify it at the same time. I really enjoy small keyboards with (full functionality), especially 60% layout ones, so that would be the goal. The result came out great and I’m satisfied with getting an even better keyboard without breaking the bank! The results can be seen below.

Figure 1: My Das Keyboard Ultimate 4C that broke
Figure 2: The fixed and modified Das keyboard – 60% layout version

I do not recommend you to modify a working Das Keyboard (they are darn good keyboards). But if you happen to break or come by a broken keyboard this article could be of interest

Feel free to ask questions about this build in the comment field below!

Table 1: Components used
Component Quantity Link (Ebay affiliate link)
Teensy++ 2.0 USB 1 Teensy++ 2.0 MCU
Jump wires A bunch

The problem

The keyboard had been fried by a malfunctioning USB-hub. When diagnosing I found that a small Cortex MCU on the keyboard’s PCB was short circuited – it heated up real bad when plugging in the USB cabel. This meant that replacing a simple component was out of the question. However, the pcb and switches were intact so replacing the damaged MCU with e.g. a teensy would get it working again. And as an additional bonus it would allow me to program any keyboard layout I want.

Figure 3: The PCB inside the keyboard
Figure 4: The fried MCU

Understanding the PCB layout and traces

First off, we need to understand how a mechanical keyboard works. Commonly the switches(keys) are arranged in a matrix fashion. The MCU sweeps the matrix row by row to see what keys that are pressed. Using a matrix decreases the number of required inputs to the MCU and as long as the sweeping is performed fast enough the user will not notice any delay when typing. Diodes are used to prevent ghosting of keys. More information about the matrix arrangement can be found at deskthority’s tutorial.

Figure 5: Matrix configuration. Image credits: https://deskthority.net/ and Daniel beardsmore

The matrix of the Das Keyboard is shown in figure 6. I’ve desoldered all keys that will not be used and only outlined the matrix for the remaining keys for the 60% layout.

Figure 6: How the PCB’s traces correspond to rows(red) and columns(yellow). Purple lines show the connection to every key from diode

Modding

A collection of images from the modification.

Figure 7: Front of keyboard before cutting
Figure 8: After cutting
Figure 9: Teensy mounted between metal backplate and pcb
Figure 10: Connecting the teensy to the matrix
Figure 12: Hole for USB connection
Figure 11: Wooden frame (beech)

Software

I chose the open source firmware kalled TMK. It is a popular collection of keyboard firmwares that easily can be flashed to a e.g. a Teensy. However for my Das keyboard modification I noticed that the diodes were mounted in reverse to how TMK sweeps rows vs columns. You can modify the tmk software to accommodate this but I decided to flip them using a soldering iron.

The tmk software was modified so that it used the GPIO pins I seleceted for connecting the rows and columns. In total there are 14 columns and 5 columns on my pcb. Also my backspace key was not connected to any of the rows or columns (see thick dashed yellow line in figure 6). That key had to be remapped to belong to row 3 and column 13 (indeces 0,0 is the top right of figure 6)

For the exact changes I did to the tmk firmware check the commit of the fork I did of tmk: https://github.com/asaxen/tmk_keyboard/commit/723c9ec1715ef81d137bb257dbb211a5c06b745d

Keyboard layout definition example: (found under keyboard/gh60/keymap_poker.c)