Wednesday, April 29, 2015

Making A Custom Keyboard Part 2

Custom Keyboard Project Summary Page

Okay, I know I said the previous design was the one I would make, but I have not stopped redesigning things. I probably won't stop either. I just keep having better ideas. This latest version throws even more tradition out the window. I have dropped the number of keys down to 46 or 47 (if you don't include the "lock" key. Still not sure about that one.)
Here is a 3D model of the thing, just to give you a taste:


As you can see, the thumb is now much more responsible and the pinkeys have almost nothing to do compared to their old spot. I have also gotten rid of the top number row. HOW? I NEED NUMBERS!!! Don't worry. You can still do everything you used to be able to do. Here is the layout for this new 10.5" x 4.5" x 1.5" Mantis-Hackster:



Now, the basic idea is that you now have two "shift" modes. The regular shift key works like normal on the left thumb (much like the previous design.) This model puts the "fn" key on the left thumb as well, but down a level. Calling it "fn" is now kinda a misnomer as it does so much more. The "fn" key is now like a second shift. This key allows access to a full 10-key and all the symbols found on the outside edges of a normal keyboard. I have optimized it for programmers by having the brackets and parenthesis on the inside columns. Home, End, Page Up, and Page Dn have been combined with their respective arrow keys, which have also been moved. Backspace and delete share a key. Tab and Escape share a key. Yeah, it all makes sense. It is kinda like some phone keyboards, really. You have the regular text shift and then the symbol key. One other nice thing is that the symbols can be arranged according to commonality. (That gives those keyboard layout nuts another thing to argue over.) I picked a layout that seemed to make sense and just figured it was good enough. Symbols aren't that common, after all, so they won't be your bottleneck when it comes to typing.

For those confused about the Lock and macro key:
Lock can lock any set of keys on the keyboard. Hold down lock and then start hitting keys. This button just keeps keys from sending the "key up" message to the computer. When the lock is released, all pressed keys will stay "down" until lock or that key is hit again.
The macro key can just record a set of keystrokes and then play them back over and over. Useful for formatting things. Format one line then just hit replay for the next! I love this feature from some text editors and want it more readily available all the time.
Feel free to change the lock and macro buttons in your own version of this layout. Heck, if I get this all done and release the code for the teensy, you can swap out those keys real easy!

Anyway, here is the NEW price breakdown (price before shipping in parenthesis if there was shipping costs):
- Colored Keycaps: $30 ($25)
- Teensy 2.0: $16 ($19.03)
- Acrylic Case: $40.64
- 50 Cherry MX Blue switches: $61.65 ($46.50) (a few extras just in case)
- 50 (1N4148) Diodes: $1.85
- Cat5 7ft cable (for colored wires): $1.36
- USB 2.0 to Mini-B 5-pin 6ft cable: $1.41
--- (shipping for cat5 and usb2.0 was $5.99 together)
Total costs: $158.90

I am sure the case could be a little cheaper too, but I just took off the extra button costs.

Yay! A little bit cheaper. If this were on massdrop or some other group-buy site, the price would probly be about $120 and come with a more official case. I just found some Gateron switches on massdrop that cost closer to $45 for 120. That could make 2 keyboards. That would make the total above closer to $140. Were this to be made in a real production line, it could probly be made for close to $70-ish. That would be a pretty descent product right there.

Anyway,  I am sure I will tweak things even more as I get closer to making things for real. I now have all the parts but the case supplies. I have those on order and should get them by May 5th, so hang in there.

As a side note for making the case, I am currently a student at BYU and am going through the training stuff to get access to the shop lab. This will allow me to use the laser cutter for making the case. If you don't have a free option like this through a nearby school or library, you may have to get it made for you by someone online. Look around, there are a surprising number of solutions to getting a case made for your keyboard. If worse comes to worst you can always just make one out of wood or cardboard...

Oh, and feedback is always appreciated

Friday, April 17, 2015

Making A Custom Keyboard Part 1

Custom Keyboard Project Summary Page

I have started building my own custom keyboard. Have just finished the design phase and have purchased all the parts I need to make it. The following is a more detailed description.

I started by designing the keyboard I wanted to build in Inkscape. I drew everything to scale so I could measure and get exact amounts for everything. My original design looked something like this:


I continued to modify and tweak things. I built a crappy cardboard prototype with keys pulled off an old keyboard and finally came to the following design:


Yeah, a bit of a change... By making the keyboard under 12" wide and reducing the number of keys to 68, I was able to knock close to $100 off the end price. DEFINITELY design and redesign everything while hunting for materials. You can save yourself a lot of money.

Here is the price breakdown (price before shipping in parenthesis if there was shipping costs):
- Colored Keycaps: $30 ($25)
- Teensy 2.0: $16 ($19.03)
- Acrylic Case: $40.64
- 70 Cherry MX Blue switches: $80.25 ($65.10)
- 80 (1N4148) Diodes: $3.00
- Cat5 7ft cable (for colored wires): $1.36
- USB 2.0 to Mini-B 5-pin 6ft cable: $1.41
--- (shipping for cat5 and usb2.0 was $5.99 together)
Total costs: $178.65

NOTE: I am sure I have forgotten something... but this is a good initial cost point. Here is some more information on where I got things and the details about each part:

Colored Keycaps - $30 ($25)

A couple notes first. If a keyboard has a horizontal rectangle for an enter key, it is ANSI. If it has a upsidown L-ish shaped enter key, it is ISO.
There are two main types of Keyboard Profiiles for cherry keycaps. The ones with different shapes for each row are often known as OEM, Standard Profile, or DCS and will talk about R1, R2, etc. for which row that key will fit on (due to it's shape.) The non-shaped keys that will be the same for the whole board are often called DSA or flat keys. Be aware when buying your keys which rows are where or you may end up with a layout that has a jagged set of keys.
I purchased mine from MaxKeyboard. They seemed to have the best price for getting a full set of keys. For the above design I got an "Custom Color Cherry MX Full Replacement Keycap Set (Blank)" with ANSI 104-key full size set. I got the one with the 6.25 spacebar so that I could get the extra 1.25 control keys for the bottom row of my keyboard. (The 6.0 comes with smaller special keys and bigger control keys. See the description on their site. It is a good one.)
The full set like this gives me way more keys than I need, but any other deals would have costed a significant amount more. The above design needs 60 1x1 keys (The size of standard letter keys,) 6 1x1.25 keys (the size of the alt key on most keyboards,) and 2 1x1.5 keys (one and a half the size of a letter key. The size of the tab key on most keyboards.)
The big colored pack gives me all those keys and enough to replace the top row and a few others with blue if I want. This pack also ensures that the profiles for each row will be nice and tidy. The only ones that will be a bit off will be the spacebar and the shift key. This bothered me for a moment, then I decided I wanted the space and shift to stick a bit above the row above it.

Teensy 2.0 - $16 ($19.03)

I did not do too much reading or research on this one. Every custom keyboard guide I looked at online used this one. It seemed like the standard for custom keyboard controllers. There are even some really easy pre-written code things out there, apparently. This seems like a fairly no sweat buy. You can get them cheap straight from their maker: PJRC

Acrylic Case - $40.64

I don't have much to contribute here. The acrylic sheets I have found are all surprisingly expensive. If you have a cheaper way to make a case, let me know. I went with the layers approach described in this guide(in case that link breaks, it just talks about cutting out layers and stacking them up to make the case.) The Cherry MX switches will come in two types: MX1A-xxNN and MX1A-xxNW. The NN switches are meant to be attached to a 1.5mm mounting thing where the NW ones are meant to hook straight to a PCB (circuit board). I mention this here because you will need to get at least one sheet of acrylic that is 1.5mm for the switches to hook into if you are not using a pcb. I found shelf liners on Home Depot's website that fit the bill for my keyboard. From one sheet I could get close to a 3/4" case (and it comes with 4 sheets.) The sheets are actually 0.06" thick, but I figure I can sand them down a bit if that doesn't fit the 1.5mm switches.
Other case options: Most people follow a format similar to some other keyboard. In that case you can simply buy one of those and use the case from it. You may even be able to find a broken one for cheap.

70 Cherry MX1A-E1NN (Blue) switches - $80.25 ($65.10)

I got these with the diodes off of AlliedElec at a bulk rate. If you are getting the normal 104, your cost will be even cheaper per switch. I kinda wanted the brown MX1A-G1NN switches, but everywhere that has them cheap are out of them. If you want to know the difference between the MX switches, there are lots of videos online. Here is a summary of what they are so you are not going out there blind. There are three main types of actions available: Linear, Bump, Bump&Click.
Linear goes down and up at a constant pressure application level. This is supposedly better for gaming and things where you will be holding the key down or doing non-traditional presses with it.
Bump has a slight bump as you press down. This tactile feedback lets you know when the key registers. This is a good all-around key for typing and gaming.
Bump and Click keys are bump keys that also make a click sound when the key registers. These are the most "fun" to type with. They are meant for typing.
Please note that in some of the sound test videos the users are pressing to hard and are creating a "clack" for all keys. This is from the switch bottoming out. That is not the same as the click. There are little bumper rings and pads you can buy to get rid of the clack (if it bothers you) or you can just learn to type with the right amount of force (recommended.)
Within the three categories of linear, bump, and bump&click, there are several choices. Each category will have various switches with different amounts of "actuation force." Reds (Linear), Browns (Bump), and Blues (Bump and Click) are the lightest in each category. These are what you would choose for your letter keys unless you are super heavy handed. Spacebar and some modifiers (and Esc) are usually heavier switches (Unless using multiple switches for the spacebar.) Yeah, thumbs are heavy.
I purchased all blues, as I plan on this being a programming keyboard and I wanted the cheap bulk prices. I may purchase heavier switches for some keys later after I have got a feel for things.

80 (1N4148) Diodes: $3.00

I got these from AlliedElec with my cherry switches. Just search for 1N4148 and they should come up. Diodes are needed to prevent "Ghosting." This is where extra keys can be typed that you never touched. For more info on that see the wiring guide here. It is good and makes sense

Cat5 24awg 7ft cable (for colored wires) - $1.36

It is good to have different colors for wires. Most spools are huge and expensive. One tutorial then mentioned that you can use cat5 cables from Monoprice and I was like "BRILLIANT!" As for the gauge of wire, I have seen suggestions from 20 to 24 awg. I don't know much about wire, so if someone has a more exact answer, please let me know.

USB 2.0 to Mini-B 5-pin 6ft cable (for Teensy): $1.41

The folks at PJRC do not provide a USB cable, so I picked up a 6ft one on Monoprice when I got my cat5 cable.

Until Part 2...

Well, that is all I have for now. I have ordered by parts and they will be coming in the next few weeks. I will post more instructions as I complete them. Hope this helps someone out there who is a total nerd like me.

Also, If anyone actually wants my inkscape design files, let me know. I will gladly share them.