Introduction: Make Any Vintage Keyboard Work With a Modern PC
So this is part of a larger project to modernise a 1987 Toshiba T1000 laptop using the amazing and tiny LattePanda. For those of you that don't know, the LattePanda is a tiny x86 computer board that has a quad core Atom processor, 4Gb of Ram, and 64Gb of flash storage and also contains an Arduino. And when I say it's tiny, I mean palm of your hand sized! The Laptop project will be a whole other Instructable when it's done. For now this guide will show you how to make your old non standard keyboard work with USB. That means this same process can be applied to a Commodore 64 keyboard or whatever you like!
The largest obstacle in this project for me was interfacing the old original keyboard with the modern system via USB, and having Windows think it's a regular keyboard. I first thought I could buy a USB keyboard, rip out it's controller and somehow tie it into the old keyboard. I spent quite a bit of time on this, and to some extent it it did work. But I could never get all the keys to work. I thought it best to use and Arduino then, and modify a couple sketches to get it working. Although the LattePanda has an Arduino built right in, it is limited to 20 input pins and cannot be programmed to be seen as a keyboard by windows as much as I could tell. But then I got wise to the existence of the Teensy LC micorcontroller, and this changed everything. The Teensy is as the name suggests is tiny, and has more than enough I/O pins. It's also very cheap and light on power.
Materials:
-A keyboard of your choice disassembled
-Teensy LC or other Teensy
-Ribbon cable with solderable pins on the end (optional)
Step 1: Get a Picture of Your Key Matrix, and Trace Those Lines Out
This is the most time consuming part. If you successfully trace out a whole PCB like this then you've got yourself some pretty high geek cred in my books. This board (it also may be a clear film with two layers) is called the key matrix. There are typically two sets of wires coming out of every key matrix. One set will be one side of every key, and the other set the other side of every key.
In my case I had 24 wires coming out. Numbers 1-8 were the first set, and 9-24 were the second. What I did to make things easy was put the board in my flatbed scanner so I could get a nice high resolution image of all the lines. You could use your camera as well. Now for every one of the contacts (wires connected to the board), trace the lines like I did using a different color for every line. I found it helpful to number each pad that connected with a key to the number of the contact it's connected to. In the case you are working with a keyboard that has the clear film, you will have two layers that you need to scan. Each layer is a set as described above. One will probably have 8 contacts coming out, while the other will be around 16. In the photos you can see I started tracing out the lines on a film style key matrix.
Step 2: Create a Spreadsheet of Keys and Their Contacts
Now that you have a piece of keyboard art (I mean just look at all those pretty colours you picked!). You need to get the data into a spreadsheet. Each key will have two contacts assigned to it (one from every group). You can use my attached spreadsheet as a template. Your keyboard will probably have more or less keys, so modify as need be.
Attachments
Step 3: Wire Up Your Key Matrix to the Teensy
I hopped on amazon and got this fancy ribbon cable with pins on the ends for about $8 CAD. You can also just use the wires that were there to begin with, but the soldering on the teensy might be a bit more tricky.
To make it easy I used the same pin number on my key matrix as the one on the Teensy for all 24 wires. Ex. Key matrix=1 -> Teensy=1, Key matrix=2 -> Teensy=2, and so on. The Teensy LC I bought came with no pins, rather it had holes that you could solder into. This worked very nice in combination with the ribbon cable I ordered.
Step 4: Setting Up Teensyduino and Modifying the Sketch
Teensyduino is an addon for the Arduino development enviroment. As of writing this, it only supports up to Arduino 1.8.1. If you have a newer version, you may need to uninstall and install 1.8.1 for it to work. Here is a guide on getting it installed: https://www.pjrc.com/teensy/td_download.html
This page was a huge resource when doing this project: https://www.pjrc.com/teensy/td_keyboard.html Once it's installed, you will be able to open Arduino and now select your Teensy as a board. You also have to go to Tools -> USB Type: and select "Keyboard". Download and open the sketch on this page with these settings. You will need to do two simple things to get up and running:
-Modify the keys Array (shown in the picture) to fit your spreadsheet from the previous step
-Modify the Rows and Cols to use the pins you've selected on your teensy. One set of wires will be the rows, and the other is the columns.
Before you can download to your Teensy, you need to press it's reset button. Once you do, quickly download your sketch.
Attachments

Participated in the
Microcontroller Contest 2017
15 Comments
11 months ago
Do you have the pinout from the wires from keyboard to the teensy? I mean a clear map from each wire position to what terminal pad in teensy. I have two dead T1000 laying around and I think I will follow your steps :)
Reply 11 months ago
Never mind .. the picture is clear on that :)
Teensy LC on the way ..
2 years ago
"...i will be publishing an instructable about the whole thing."
I'm hoping you will! Did you actually get this fully operational on your T1000?
3 years ago
trying to do this with the keyboard from a busted T1200, as for the code, what's the purpose of the '1' '2' before KEY_ESC?
3 years ago
Trying to get an old Military GRiD 1550 keyboard to work using this method, but whenever I press a key, it also produces 2-3 other characters (ghosting?).
For example...
Q Produces q['
W produces wp;'
Etc..
Some keys don't work at all.
The keyboard has 11 Rows and 13 Columns, modified the code to suit but given my extremely limited knowledge of coding, I'm struggling to understand what I've done wrong.
Heres the code I used, any suggestions would be greatly appreciated..
#include <Keypad.h>
const byte ROWS = 11; //eleven rows
const byte COLS = 13; //thirteen columns
char keys[ROWS][COLS] = {
{'1',KEY_F9,'2',KEY_F5,KEY_F4,KEY_F3,KEY_F2,KEY_F1,'3','1','2','3','1'},
{'a','1','2','3','1','2','3','1','2','b',KEY_LEFT_SHIFT,KEY_RIGHT_SHIFT,KEY_SPACE},
{'1',KEY_F10,KEY_F8,KEY_F7,KEY_F6,'2',KEY_1,KEY_ESC,'2','3','1','2','3'},
{'1',KEY_6,'2',KEY_3,KEY_2,KEY_W,KEY_Q,KEY_TAB,'3','1','2','3','1'},
{'1',KEY_7,KEY_5,KEY_4,KEY_E,KEY_S,KEY_A,KEY_CAPS_LOCK,'2','3','1','2','3'},
{'1',KEY_4,KEY_8,KEY_D,KEY_F,KEY_Z,KEY_SPACE,'c',KEY_LEFT,'2','3','1','2'},
{'1',KEY_0,KEY_T,KEY_R,KEY_G,KEY_C,KEY_X,'d',KEY_DOWN,'2','3','1','2'},
{'1',KEY_MINUS,KEY_U,KEY_Y,KEY_H,KEY_B,KEY_V,KEY_SCROLL_LOCK,KEY_NUM_LOCK,'2','3','1','2'},
{'1',KEY_F11,KEY_I,KEY_K,KEY_L,KEY_M,KEY_N,KEY_UP,KEY_TILDE,'2','3','1','2'},
{'1',KEY_EQUAL,KEY_O,KEY_F12,KEY_J,KEY_BACKSPACE,KEY_COMMA,KEY_RIGHT_BRACE,'e','2','3','1','2'},
{'1',KEY_P,KEY_LEFT_BRACE,KEY_SEMICOLON,KEY_QUOTE,KEY_PERIOD,KEY_SLASH,KEY_ENTER,KEY_RIGHT,'2','3','1','2'},
};
byte rowPins[ROWS] = {1,2,3,4,5,6,7,8,9,10,11}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {12,13,14,15,16,17,18,19,20,21,22,23,24}; //connect to the column pinouts of the keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
unsigned long loopCount;
unsigned long startTime;
String msg;
int x = 0;
Question 3 years ago
Hi! great instructables! I'm trying to reuse your code for a Sinclair Spectrum ZX +2 with a Teensy 3.2 but I'm a bit stuck: https://stackoverflow.com/questions/56958981/keyboard-map-sinclair-spectrum-zx-2-on-teensy-3-2 can you point me in the right direction? The upper membrane and lower membrane are driving me crazy
Question 4 years ago
Hello, I have an old keyboard for an Amstrad 3386SX.. notice it has 16 x 16 connectors¿ is it possible make it work? teensy only have 24 pins .. sure I missing sommething, my apologies, I'm newbie in this adventure
Answer 4 years ago
Hi. Wondering if you still have that keyboard and would you consider trading it so it matches the 3386SX main unit I have :) Thanks.
5 years ago
Hi,
Thanks for this inscructable!
I started to trace a scanning of the keyboard I am working on but I don't understand properly how to proceed further.
I traced the 24 tracks until they had an obvious terminating point; now I am left with a lot of tracks unaccounted for as I don't really get the logic of where to go next. I can't see very much detail on the main photos for this guide.
I've attached an image of what I have so far, could someone explain to me the logic behind where to go next?
Sorry if this is a bit vague; I lack the vocabulary to describe what I mean properly.
Thanks
5 years ago
Hi there, just wanted to say thanks for the great instructable! I have a pretty similar toshiba laptop kb (8086 or maybe 80286) that I salvaged and I've had a teensy++ 2.0 waiting for years to do this project. I guess I didn't want to do the work. But you've inspired me, and its all wired up to a teensy and I'm figuring out the keymap. So far the spacebar prints "G" and "L" prints "H". So... proof of concept? I'll update when I get it working.
6 years ago
I added a surplus keyboard to a Timex Sinclair once. I figured out the keyboard matrix on a piece of paper. How's that for geek cred?
https://www.instructables.com/id/Sinclair-Surplus-K...
6 years ago
Oohh... I have a T1000 lying around, and I've been wondering if there's anything useful to do with it. Do you have additional information about this project somewhere else?
Reply 6 years ago
Cool! Not just yet but i will be publishing an instructable about the whole thing.
6 years ago
DUDE. I did this, but I couldn't because the keys came out all different. I had a bluetooth module and everything. Good to know you have to map the keys lol.
6 years ago
Lol I've seen this in my newsfeed and i said myself: this is well documented, wonder what the author's other instructibles are, turns out it's you whom I'm already a follower :p.
I really like the teensy, 9/10 I'll use it to hack myself a custom mechanical keyboard for my personal terminal shaped gaming pc.
Since you plan to reutilize that nice pc over there Maybe this would be of some interest: ( https://www.youtube.com/watch?v=7D1lAzRpcWo&t=326s ), especially the old internet emulation part.
I'ts always nice to see your projects, i'm looking forward to see more.