Close

The Prototype Keyboard

A project log for VT-69 Handheld Terminal

It's a dumb terminal. You can connect a Raspberry Pi to it.

BenchoffBenchoff 03/02/2019 at 20:050 Comments

I'm buying a thousand silicone keyboards, months before I have finalized hardware. I need a way to test the samples of these keyboards, and the easiest way is to turn them into a USB keyboard.

The TL;DR is that everything is on the Gits

---------- more ----------

Building keyboards from scratch, using Cherry MX switches, diodes, and laser-cut plates is well-tread territory. That's basically what I'm doing here; the switches are the PCB and silicone keyboard, the microcontroller is a Teensy LC (because that's what I had sitting around), and there are no diodes because I don't give a fuck about NKRO. There are three basic components of this build:


The PCB

As stated in the previous log,  there's nothing really special about making silicone touch pads. Yes, everything should be plated in ENIG, but other than that as long as the traces and spaces are reasonable (I'm using 10mil) everything is going to work. The issue is just laying out the matrix. I'm using five rows with 16 columns, arranged thusly: BE WARNED IF YOU COPY THIS SHIT THERE'S GOING TO BE AN OFF-BY-ONE ERROR IN THE DOCUMENTATION

This was wired up to the Teensy LC thusly:

And the completed Gerber:

Not a big deal. Eagle file and Gerbers are in the Github.


The Firmware

There are dozens of different firmwares out there for configurable keyboards, all infinitely powerful and capable. This is just a test that isn't going into the final badge, so I just need something quick, dirty, and sloppy. I found a Teensy LC and wrote a little bit of code. The relevant part is below, the entire thing is on the Github.

const byte ROWS = 5; //eight rows
const byte COLS = 16; //sixteen columns

//Don't fucking ask me what this macro is doing here
//I'm just copying and pasting LiKe A sOfTwArE eNgInEeR

#ifdef M
#undef M
#endif

#define M(n) ((n) & KEYCODE_MASK)

char keys[ROWS][COLS] = {
  {M(KEY_ESC),M(KEY_1),M(KEY_2),M(KEY_3),M(KEY_4),M(KEY_5),M(KEY_6),M(KEY_7),M(KEY_8),0,0,0,M(KEY_LEFT),M(KEY_DOWN),M(KEY_UP),M(KEY_RIGHT)},
  {M(MODIFIERKEY_GUI),M(KEY_TAB),M(KEY_Q),M(KEY_W),M(KEY_E),M(KEY_R),M(KEY_T),M(KEY_Y),M(KEY_U),M(KEY_9),M(KEY_0),M(KEY_MINUS),M(KEY_EQUAL),M(KEY_TILDE),M(KEY_BACKSPACE),M(KEY_PAUSE)},
  {0,M(KEY_CAPS_LOCK),M(MODIFIERKEY_CTRL),M(KEY_A),M(KEY_S),M(KEY_D),M(KEY_F),M(KEY_G),M(KEY_H),M(KEY_I),M(KEY_O),M(KEY_P),M(KEY_LEFT_BRACE),M(KEY_RIGHT_BRACE),M(KEY_ENTER),M(KEY_DELETE)},
  {0,M(KEY_SCROLL_LOCK),0,M(MODIFIERKEY_SHIFT),M(KEY_Z),M(KEY_X),M(KEY_C),M(KEY_V),M(KEY_B),M(KEY_J),M(KEY_K),M(KEY_L),M(KEY_SEMICOLON),M(KEY_QUOTE),M(MODIFIERKEY_RIGHT_SHIFT),M(KEY_BACKSLASH)},
  {M(MODIFIERKEY_RIGHT_ALT),M(MODIFIERKEY_RIGHT_GUI),0,M(MODIFIERKEY_GUI),M(MODIFIERKEY_ALT),M(KEY_SPACE),0,0,0,M(KEY_N),M(KEY_M),M(KEY_COMMA),M(KEY_PERIOD),M(KEY_SLASH),0,M(KEY_PRINTSCREEN)} 
};
byte rowPins[ROWS] = {19,20,21,22,23}; 
byte colPins[COLS] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; 

 A quick test with a dupont cable while the Teensy is plugged in told me it was good enough to order the board.


The Bezel

Oh shit here's where it gets fun. This is the section that will also be heavily edited.

A silicone keypad isn't enough -- you also need a way to hold it down to the PCB so it won't slide away. Part of that is done with the bosses on the underside of the silicone switch and a few well-placed holes on the PCB. The rest of it has to deal with containing the key tops. I'm doing this with a piece of plastic that goes over the PCB and silicone keyboard:

This model was sent off to Shapeways, and a little bit later the prototype keyboards arrived from China:

The prototype worked the first time. A few design details of note: there is a 0.3mm setback between the silicone button and the holes of the keyboard; this is what silicone design guides recommend, and it seems to work well. The USB works well, and it looks like this works. Great. That's one prototype down, and now I have to build the whole thing.

Discussions