]> git.armaanb.net Git - atreides.git/blob - README.org
Add assembly guide.
[atreides.git] / README.org
1 * Atreus Keyboard
2
3 The [[http://ergodox.org][Ergodox]] keyboard is an absolutely fantastic design; I use it every
4 day at my office. However, I like to work away from the office
5 frequently, and I thought I might try my hand at designing something a
6 little more portable. The great thing about assembling my Ergodox is
7 that it taught me there's really nothing magical about it; it's just a
8 piece of circuitry with a bunch of switches read by a microcontroller
9 that speaks the USB HID interface.
10
11 The Atreus is meant to be complementary to the Ergodox as something
12 smaller, cheaper, and more travel-friendly. The case measures 25x11cm
13 and lacks even a number row, relying heavily upon the fn key. There is
14 no PCB in this design, requiring [[http://wiki.geekhack.org/index.php?title=Hard-Wiring_How-To.html][a manual matrix wiring approach]].
15 However, given that there are only 4 rows and 11 columns, this isn't
16 as daunting as it could be.
17
18 I've seen a number of existing DIY 40% keyboard designs, but most of
19 them stagger the rows, which I find very annoying now that I've gotten
20 used to the columnar layout of the Ergodox. In addition, many of the
21 designs I've seen waste a lot of room on the space bar, failing to
22 take into account the fact that the thumb is the strongest and most
23 versatile of the fingers. This design avoids both these problems while
24 taking a more couch-friendly single-piece approach.
25
26 [[atreus.jpg]]
27
28 ** Layout
29
30 Only a handful of punctuation marks (and no digits) are available
31 unshifted, and all the modifiers are on the bottom row.
32
33  :    q     w     e     r     t       ||       y     u     i     o    p
34  :    a     s     d     f     g       ||       h     j     k     l    ;
35  :    z     x     c     v     b       ||       n     m     ,     .    /
36  :   esc   tab  super shift bksp ctrl || alt space  fn   enter pgup  pgdn
37
38 The numbers and most punctuation are on the fn layer:
39
40  :    1     2     3     4    5        ||       6     7     8     9    0
41  :    -     +     (     )    =        ||       /     [     ]     {    }
42  :    !     @     #     $    %        ||       ^     &     *     ~    ?
43  :  reset                    `        ||                   _     |    \
44
45 I type in Dvorak but prefer to do the remapping in software rather than
46 hardware so I don't have to change layouts when I switch to my
47 laptop's internal keyboard.
48
49 ** Parts
50
51 *** Switches
52
53 This layout has five modifiers and 37 non-modifiers.
54
55 I strongly prefer the feel and sound of tactile [[http://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=651][Cherry MX blue]]
56 switches for typing. However, I like having linear switches on the
57 modifier keys (ctrl, alt, super, shift, and fn). [[http://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=102][Cherry MX red
58 switches]] are nice and light but are expensive and difficult to
59 find. [[http://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=103][Cherry MX black switches]] are cheaper and easier to source, but
60 may be too heavy, especially for keys under pinky fingers.
61
62 One trick is take the springs from some of your blue switches and
63 trade them with the springs from your black switches. The blacks then
64 become the equivalent of reds, and the blues become MX green switches,
65 which are a heavier variant of blues. These are typically used for
66 space bars on boards that otherwise use blues. They could be suitable
67 for non-modifier thumb keys like backspace, space, and enter.
68
69 *** Diodes
70
71 In order to avoid ghosting, each switch needs a [[https://www.radioshack.com/product/index.jsp?productId=2062587][1N4148 diode]].
72
73 *** Microcontroller
74
75 An [[http://www.digikey.com/product-search/en/programmers-development-systems/evaluation-boards-embedded-mcu-dsp/2621773?k=arduino%20micro][Arduino Micro]] or [[http://www.pjrc.com/teensy/index.html][Teensy 2]] is recommended. Be sure to get one
76 without headers so it will fit in between the bottom layer and the plate.
77
78 *** Keycaps
79
80 This [[http://keyshop.pimpmykeyboard.com/product/dsa-pbt-blank-sets][DSA-shaped base set]] (spherical indentations on the key, same
81 profile for each row) from Signature Plastics has 52 1x keys plus a
82 few extras we won't use. It claims on that page to contain only one
83 deep key, but my shipment contained two, which I put under the index
84 finger keys to help guide your hands without looking. However, it only
85 contained a single 1.5x keycap, and the middle two thumb keys both use
86 them, so you might want to pick up an extra.
87
88 ** Case
89
90 Layered laser-cut acrylic; see [[file:case.svg][case.svg]].
91
92 [[layers.jpg][layers.jpg]]
93
94 The first two shapes in the case file are the top and bottom covers;
95 these should be cut on 3mm acrylic (black in the photo). The third is
96 the spacer that goes under the fourth, which is the plate on which the
97 switches are mounted. These should be cut in 6mm, especially the
98 spacer, which needs to be at least as thick as the micro USB cable you
99 connect to the microcontroller. The switch plate could be thinner,
100 but not under 3mm.
101
102 On a 100W Epilog laser, the 3mm layers cut in about a minute and a
103 half. I did a run with 6mm acrylic of the other layers which took
104 nearly 6 minutes.
105
106 ** Firmware
107
108 My [[https://github.com/technomancy/tmk_keyboard/tree/atreus][fork of the tmk firmware]] has support for the Atreus
109 layout. Currently only supports software-dvorak--the default layer is
110 all qwerty, but the punctuation keys send keycodes assuming that the
111 qwerty->dvorak transformation will be applied to them, so they don't
112 make sense otherwise.
113
114 You should be able to cd into the `keyboard/atreus` directory and run
115 `make KEYMAP=atreus` (or whichever variant you want) to produce a
116 `atreus.hex` file. Use this with the `teensy` or Arduino tools to
117 upload to the microcontroller. The "reset" button on the lower left
118 will ready the Teensy for an upload so you don't have to open the case
119 to hit the onboard reset button.
120
121 ** Recommended Bill of Materials
122
123 - 50 MX Blue switches: $29.00 (mechanicalkeyboards.com)
124 - 50 diodes: $3.45 (radio shack, should be able to buy in-person)
125 - Base DSA keycap set: $18.00 (signatureplastics.com)
126 - Teensy 2: $16 (pjrc.com or mechanicalkeyboards.com)
127 - Acrylic materials: $11
128 - Acrylic laser cutting: 7.5 at $3/min (varies by thickness of acrylic)
129
130 - 5 MX Black switches: $8.50 (optional)
131 - 5 MX Red switches: $10.00 (optional)
132 - additional 1.5x DSA keycap: $1 (optional)
133
134 =(+ 29 3.45 18 16 11 (* 3 7.5))= $99.95 plus tax/shipping
135
136 - mechanicalkeyboards.com: free shipping in the US
137 - Signature Plastics (keycaps) shipping: $8.00
138 - PJRC (teensy) shipping: $3.03
139
140 ** Other Tools
141
142 You'll need a soldering iron, solder, a glue gun, a multimeter, wire,
143 wire strippers, and a USB micro cable. You'll also need seven M3
144 machine screws with nuts; the length of the screws depends on the
145 thickness of the acrylic you use.
146
147 ** Assembly
148
149 Once you have all the parts, the first thing to do is glue the
150 switches to the switch plate since there's no PCB to hold them in
151 place. Be aware that the screw holes unfortunately are not
152 symmetrical, so before inserting the switches it's important to ensure
153 that the plate is right-side-up. Use a drop of hot glue on the top and
154 bottom of each switch to affix it in place.
155
156 Once the switches are in place, the matrix must be created. I
157 recommend getting red wire for the rows and black for the columns. The
158 rows need eight strands of wire with the insulation exposed at
159 intervals matching the spacing of the switches; see [[https://secure.flickr.com/photos/43319799@N00/12669228444][this photo]] for
160 details. You could also just use many short stripped segments of wire
161 instead of a contiguous piece. Most of the row wires will need four
162 segments of insulation, but you'll need two with five for the rows
163 with the inner thumb keys. Physically the inner thumb keys look like
164 two additional columns, but logically they are treated as if they're
165 in the same column with the left one in row 3 and the right one in
166 row 4.
167
168 The exposed sections of row wire should be connected to the higher of
169 the pins on the switch using a diode. Be aware that diodes are
170 directional! The band around the diode should point to the top of the
171 board. Take care with the upper row that you don't let the wire go too
172 high; avoid getting in the way of the spacer layer. Once the
173 rows are wired, the remaining (negative) pin of each switch should be
174 wired into the negative pin of the switch above and below it. Use
175 black wire. This should be slightly easier since no diode is
176 necessary. [[https://secure.flickr.com/photos/43319799@N00/12668880863][This photo]] shows the completed matrix for one side. Test
177 each row and column as you go with a multimeter. You should be able to
178 get continuity from row to column when the corresponding switch is
179 activated.
180
181 After the matrix has been wired on both sides, the next step is to
182 connect the microcontroller. The TMK firmware has the rows in pins D0,
183 D1, D2, and D3 of the microcontroller. You'll need to connect the rows
184 from both the left and right sides into the proper pin. There are more
185 columns than rows, so I used ribbon cable to bring the column
186 connections back to the microcontroller from the outside in. The
187 columns go to pins F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, and
188 B4. It's important to realize that when you flip over the board
189 in order to solder it, you have to flip over the schematic in your
190 mind too. If you count your columns from the left, you'll get them
191 backwards. (Which I actually did for the first half.) You can see [[https://secure.flickr.com/photos/43319799@N00/1270569443y3][my
192 wiring of the microcontroller]].
193
194 Once you've wired one side of the microcontroller in, it would be a
195 good time to test it. You'll need to install the [[http://www.pjrc.com/teensy/loader.html][teensy loader]] and
196 point it at the .hex file from the tmk firmware build. Then hit the
197 physical reset button on the Teensy itself. At this point you should
198 be reading real keycodes from the half of the keyboard that you've
199 wired. Once you've confirmed that's working, continue with the other
200 half. Then screw the other layers in place and you're all set!
201
202 ** Cost-saving Options
203
204 There are a few ways to lower the cost further.  Using [[http://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=482][Matias]] key
205 switches could save you a fair bit if you go in on a 90-pack with
206 someone else, but they're a little harder to find keycaps for; the MX
207 caps won't work on them. Using wood for the case will reduce both the
208 materials cost as well as the amount of time needed to cut the case.
209
210 Replacing the colored acrylic with transparent might also save a few
211 dollars. You could also use thinner acrylic for the switch plate too;
212 I cut mine in 4.5mm. A thinner spacer is inadvisable; even with 6mm
213 it's pretty tight.
214
215 Another common trick is scavenging keycaps and switches from used
216 keyboards; something with Cherry or Alps switches should work. This
217 can be time-consuming though.
218
219 ** License
220
221 Copyright © 2014 Phil Hagelberg
222
223 Released under the [[https://www.gnu.org/licenses/gpl.html][GNU GPL version 3]]