A ZX Spectrum USB Keyboard Adapter for Raspberry Pi Builds

I used a reproduction ZX Spectrum case for a RetroPie build and designed this USB keyboard adapter to connect a Raspberry Pi.

Cameron Coward
2 months agoRetroTech / Gaming

The Sinclair ZX Spectrum is the most beloved home computer to come out of the United Kingdom in the 1980s. While it wasn’t the most powerful computer on the market, it was impressively affordable and quite capable. Even when it first hit the market, a 16KB version of the ZX Spectrum could be purchased for just £125. It proved to be enormously successful with 5 million units sold, and remains an enthusiast favorite to this day. When I found out that you can purchase new reproduction ZX Spectrum cases today, I decided to use one for a RetroPie build and designed this USB keyboard adapter to connect a Raspberry Pi.

I do own an original ZX Spectrum 48k (and a few other Sinclair models), but I didn’t want to waste original hardware on this project. Instead, I ordered a reproduction case from RetroRadionics. I chose an orange case with a white faceplate and orange key mat, but many other color combinations are available. You can order that case with an included keyboard membrane. All of those parts are compatible with a real ZX Spectrum, so my keyboard adapter would work with an original Speccy just as well as it does with the reproduction parts.

I designed the adapter because I wanted the keyboard to actually be functional. Something in my mind hates the idea of having non-functional parts on a build. A Raspberry Pi 3 Model B+ is inside of the case running RetroPie, and I have two Nintendo SNES-style wireless controller receivers plugged in. But I wanted the option to use the keyboard in addition to those controllers — especially for games that require a keyboard like The Hobbit text adventure game.

The PCB for the adapter is designed to mount onto the same holes used for the ZX Spectrum motherboard, so no modifications to the case are necessary. The ribbon cables from the Speccy plug directly into the PCB through a pair of Molex connectors. A Teensy 3.2 microcontroller development board soldered to the PCB checks the keyboard matrix to detect key presses. The Teensy, in turn, is programmed to appear as a USB HID keyboard when it’s plugged into any computer, including a Raspberry Pi. The PCB also takes in power through a DC jack and feeds it to the Raspberry Pi and an optional cooling fan.

I used Autodesk Fusion 360 to create a basic sketch of the mounting hole locations, and then a simplified 3D model of the PCB. I was able to use that 3D model to create a board outline, which I imported into KiCAD. After placing all of the component footprints on the board in KiCAD, I added a bit of artistic flair. A bunch of silly text is on the back of the board, and the front has a couple of lighthearted graphics. I did have to make some compromises when programming the keyboard functions, as the ZX Spectrum keyboard is much different than modern keyboards, but it does work. This whole project is also open source, so you’re free to modify the code to fit your own needs.

Related articles
Sponsored articles
Related articles