I love articles like these, this stuff isn't that hard and its way more fun than other ways to spend time (my opinion of course). Making a PCB for a keyboard is really really straight forward too. I bet we could do that on Upverter.
I really like the idea that you could use something like an iPad. (or better two iPads) rest your hands on the screen in what are your natural "home row" position. Then touch type text that appears on a screen in front of you while the iPads are busily figuring out how far your fingers are moving and 'tuning' where the other keys should be done. Once you've done like 50 words error free it beeps and send that off. Shapeways makes the cover, Albert PCB makes a circuit board, and you order key switches and diodes from a distributor. Boom a custom keyboard designed by you for you.
The PCB is the easy bit. Making the firmware which delivers your keypresses down a PS2/USB pipe is not. You have to consider things like n-key rollover and ghosting/blocking particularly when using matrix encoding/scanning which are a bastard to code.
The cool thing about the modern world is that incredibly talented people have already written decent opensource keyboard firmware. But I'll get to that in Part 2 of the writeup :)
Aren't those things only a problem because keyboards are being mass-produced? Companies are cutting costs by using less components which introduce these kind of problems. If you're building your own custom keyboard you're not going to care if it costs you a bit more, especially if it means you can avoid these problems from the start.
Yeah I know just enough about hardware to be dangerous but I think you can stick 6 16-bit GPIO expanders off of an I2C or SPI bus and address every switch individually. Makes no sense for mass production but for diy it's $10 in parts or something
This is incorrect. While typically Linux has implemented the spidev poorly (its really just a stub to do the things you do occasionally like sideload firmware into a card) SPI itself it actually reasonably zippy for this application.
Typical "fast" SPI clock rates are 10Mhz on a 20Mhz MCU[1], and with a daisy chained set of SPI parallel I/O chips (they appear as 'one' device on the SPI bus) you can clock the state of all 105 key switches (or 120 if you're using 5 of the 24 bit ones) into an embedded processor like the AtMega328 at 10mS per sample. So that is 100 samples per second. Usable for this stuff but not ideal.
Since the n-key rollover patent [2] expired a number of companies have made chips that implement this for arbitrary sized matrices (given i/o pins) of which an exemplar is Atmel's AT43USB325E [3] which can handle up to 20 x 8 (that is 160 keys). The Atmel part is especially useful because it has a built in USB 'peripheral' port and the app notes for this part show how to easily make a USB keyboard out of a bunch of random key switches hooked to a diode matrix.
I've thought about doing something like that. Though I believe that what you want to be doing is using hand measurements and a slightly more standard design. I want to get a few of my own keyboard designs under my belt before I start making promises, though.
Keys - $0.80 x 78
Diodes - $2-$3
3D printed shells - $240 from Shapeways. Cheaper from a friend with a makerbot
Keycaps - Cheapest when harvested from a board found at goodwill. Otherwise, $35 or so from WASD
Teensy++ - $24
I'll leave the "priceless" joke to the peanut gallery.
I really like the idea that you could use something like an iPad. (or better two iPads) rest your hands on the screen in what are your natural "home row" position. Then touch type text that appears on a screen in front of you while the iPads are busily figuring out how far your fingers are moving and 'tuning' where the other keys should be done. Once you've done like 50 words error free it beeps and send that off. Shapeways makes the cover, Albert PCB makes a circuit board, and you order key switches and diodes from a distributor. Boom a custom keyboard designed by you for you.