]> git.armaanb.net Git - atreides.git/blob - assembly/assembly.tex
Updated assembly instructions
[atreides.git] / assembly / assembly.tex
1 \documentclass{article}
2 \title{Atreus Keyboard Assembly}
3 \date{ }
4 \usepackage{graphicx}
5 \usepackage{geometry}
6 \usepackage{wrapfig}
7 \newgeometry{margin=3cm}
8 \begin{document}
9 \setlength{\parindent}{0cm}
10 \maketitle
11 \section{Prerequisites}
12
13 In order to assemble your keyboard, you'll need your kit plus a few
14 other tools. The kit should contain these parts and a few spares:
15
16 \begin{itemize}
17 \item Case (top plate, switch plate, spacer, bottom plate)
18 \item Diodes (42)
19 \item Key switches (42 tactile or clicky, 5 red)
20 \item A-Star Micro controller
21 \item Printed circuit board (PCB)
22 \item Machine screws and nuts (8 each, 16mm M3 size)
23 \item Key caps (40 normal, 2 long)
24 \item USB micro cable
25 \item Rubber feet
26 \end{itemize}
27
28 You'll also need to have these on hand:
29
30 \begin{itemize}
31 \item Sandpaper (200 grit and 1000 grit waterproof)
32 \item Can of spray lacquer (clear glossy recommended)
33 \item Newspaper or other material to spray on
34 \item Soldering iron and solder (thin solder and an iron with a sharp
35   tip recommended)
36 \item Wire cutters
37 \end{itemize}
38
39 \vspace{1em}
40
41 The latest version of this document can always be found
42 online.\footnote{http://atreus.technomancy.us/assembly.pdf} If you're
43 reading a black-and-white printed copy, you may find some of the
44 photos clearer in color onscreen. This copy describes the
45 circuit-board-based kit. If you are hand-wiring a board, see the older
46 assembly
47 guide.\footnote{http://atreus.technomancy.us/assembly-hand-wired.pdf}
48 The photos in this guide depict Matias switches, (with rectangular
49 switch stems) but you can use Cherry MX switches (with stems shaped
50 like a +) as well. The assembly steps are mostly the same in either case.
51
52 \section{Sanding}
53
54 Start by sanding down both sides of each piece with your lowest-grit
55 sandpaper. You may want to hold two pieces together while sanding for
56 strength or placing it on a flat surface you don't mind scruffing up;
57 too much pressure on a single plate could damage it.
58
59 \vspace{1em}
60 \noindent\makebox[\textwidth]{%
61 \includegraphics[width=0.7\linewidth]{sanding.jpg}}
62 \vspace{1em}
63
64 Keep in mind that the top side of the top plate and the bottom side of
65 the bottom plate are the only surfaces that are exposed to the touch
66 once the keyboard is fully assembled, so these will need the most
67 attention when sanding. You can sand the other surfaces as well just
68 to get the scorch marks off, but you don't need to worry about how
69 smooth the inner surfaces feel to the touch. Be sure to get all the
70 wood dust off the pieces before you go on. A clean tack cloth or other
71 fine cloth works well.
72
73 \vspace{1em}
74
75 Some people don't like the look of the exposed edges charred from the
76 laser cutter. You can choose to sand off the charring, or alternately
77 cover it all with black ink from a sharpie marker for a more
78 consistent look, or leave it alone.
79
80 \section{Finishing}
81
82 Once the case is sanded down all over with coarse sandpaper, find a
83 good place to spray the lacquer. It should be outdoors or in a
84 well-ventilated garage if spraying outdoors is not feasible. Lay down
85 the newspaper with the pieces of the case on top of it. Spray your
86 first coat of lacquer to the face-up side of each piece. Try to use a
87 steady hand and keep the path of the spray overlapping itself just a
88 small amount as you go to and fro to minimize runs but still cover all
89 the area. The evenness of the spray matters less on the internal
90 surfaces of the case, so it's a good time to practice and get the hang
91 of it.
92
93 \vspace{1em}
94
95 Check the lacquer directions to see how long your particular product
96 needs to dry; this can vary from half an hour to many hours. Once your
97 first coat is dry, flip each piece over and spray the other
98 side. Repeat for a second coat. After the second coat, you can ignore
99 all surfaces except for the top of the top plate and the bottom of the
100 bottom plate since only these are exposed to the outside. At this
101 point you can take in the switch plate and continue the rest of the
102 keyboard construction while you wait for remaining coats to dry.
103
104 \vspace{1em}
105
106 The outer surfaces should have between eight to ten coats applied
107 total. As you get to the later coats, the end result will be smoother
108 if you can keep them thinner. After your second-to-last coat dries,
109 take your fine sandpaper and soak it in water, then sand over the top and
110 bottom surfaces lightly. Add a final coat and buff it with a fine
111 cloth. If you make any mistakes or are unhappy with the smoothness of
112 the finish, let it dry and add another layer of lacquer, then try
113 lightly sanding it again. If you have some wood finishing oil, you can
114 apply it with your fingers.
115
116 \section{Diodes}
117
118 If you've never soldered before, there are plenty of good
119 introductions online.\footnote{This one from Adafruit is great:
120   https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools}
121 Coat the tip of the hot iron thinly with some solder before you
122 start. The key is to use the iron to heat both parts of the joint for
123 a second or two, then bring in a dab of the solder and let it melt and
124 stick to the lead and the circuit board pad.
125
126 \vspace{1em}
127
128 Take five diodes at a time and bend them into a U shape. Place them
129 into the diode holes next to each switch slot on the unlabeled side of
130 the board. Each diode has a black band on it; the band should be
131 pointing in the direction of the arrow on the printed side of the
132 board. Once all five are in, pinch the legs of the diodes together to
133 keep them from falling out, then flip the board over and solder them
134 in place. Make sure they don't protrude up more than necessary.
135
136 \vspace{1em}
137 \noindent\makebox[\textwidth]{%
138   \includegraphics[width=0.65\linewidth]{diodes.jpg}}
139 \vspace{1em}
140
141 In the photo the diodes are inserted from the back of the circuit
142 board, but it will work just as well to insert them from the front as
143 long as the black band is oriented correctly. Once they're soldered,
144 trim the diode legs with wire cutters. Grip the diode leg as you
145 trim it to keep it from flying across the room. Keep the diode legs;
146 they will be needed in the next step. Repeat until each diode position
147 is filled.
148
149 \section{Controller}
150
151 Once the diodes are in place, you can begin attaching the controller.
152 If the controller came in a pink bag with its own header pins, you may
153 be tempted to use them to connect the controller to the circuit
154 board. Don't do this--they are too big and will prevent the case from
155 closing when you're done. We will be using the diode legs we just
156 trimmed instead.
157
158 \vspace{1em}
159
160 First take the PCB with the labeled side down and fill the four corner
161 holes in the center ``A-STAR'' section with solder. Insert diode legs
162 into these holes while melting the solder. Then repeat the process for
163 the other holes on the left, keeping them pointing as straight as
164 possible. Leave the right side alone for now.
165
166 \vspace{1em}
167 \noindent\makebox[\textwidth]{%
168   \includegraphics[width=0.65\linewidth]{many-pins.jpg}}
169 \vspace{1em}
170
171 Fit the controller over the pins you've attached so far. Solder the
172 four corner pins already connected to the PCB into the corners of the
173 controller. (The bottom left corner is unused; the pin above it is used
174 instead.) Try to ensure the controller is as close to the PCB as
175 possible and not at an angle. Then solder the other left-side diode
176 legs into the controller as well. Trim them all with your wire
177 cutters when they are secure.
178
179 \vspace{1em}
180
181 Eight right-side holes remain. For these, bend four diode legs at a
182 time into an L shape, and insert them into four of the remaining
183 holes. Flip the board over and solder the protruding diode legs to the
184 PCB, then trim them down and flip the board back over. Straighten the
185 diode legs, then solder and trim them. Repeat for the remaining
186 right-side holes. From the PCB side, all the holes will be used, but
187 from the controller side, there will be some unused.
188
189 \vspace{1em}
190 \noindent\makebox[\textwidth]{%
191   \includegraphics[width=0.8\linewidth]{bent-legs.jpg}}
192 \vspace{1em}
193
194 Before you go on, take the time to double-check the solder joints on
195 the controller. The solder should fill the hole completely without
196 spilling over to adjacent holes, and the legs should be secure. Also
197 check that all the diodes are facing the correct direction with the
198 black band pointing to the bottom of the board.
199
200 \section{Firmware}
201
202 Installing the firmware now isn't strictly necessary, but it will
203 allow you to spot mistakes before the board is finished.
204
205 \vspace{1em}
206
207 \begin{wrapfigure}{r}{0.25\linewidth}
208   \includegraphics[width=0.8\linewidth]{reset.jpg}
209 \end{wrapfigure}
210
211 Plug in the USB micro cable into the controller, and plug the other
212 side into your computer. Get a copy of the
213 firmware \texttt{.hex} file \footnote{Available at
214   https://atreus.technomancy.us/tmk} and \texttt{avrdude}. The
215 first time you upload the firmware, you will have to use the hardware
216 reset to enter the bootloader: take a diode leg or wire and touch one
217 end to the reset pin and one end to the ground pin. (These are circled
218 in the photo.)  Touch them together twice in under a second and the
219 LED underneath will begin pulsing in a different pattern from the
220 original blinking. This indicates it has entered bootloader mode for 8
221 seconds.
222
223 \vspace{1em}
224
225 While it's in the bootloader mode, type \texttt{avrdude -p atmega32u4
226   -c avr109 -U flash:w:atreus.hex -P /path/to/usb} from the directory
227 containing the firmware\footnote{See the firmware readme for
228   instructions about determining the USB argument and customizing the
229   layout.}. The firmware should be uploaded, and it will start
230 functioning as a keyboard once switches are connected. Next time you
231 upload, you can use the reset key instead of touching the pins
232 together.
233
234 \section{Switches}
235
236 Next take four switches and place each switch in a corner of the
237 switch plate. (The case layer with all the holes in it.) The switches
238 should be oriented so that the side with pins is to the ``north'' of
239 the board so they will fit into the holes in the circuit board. Put
240 the switch plate face-down on the table with the pins sticking
241 up.
242
243 Carefully fit the circuit board over the protruding pins with the
244 labeled side down. Solder those corners to hold the circuit board and
245 the switch plate together. The switches should be flush with the
246 PCB. Take care that the switch pins are straight when you insert them;
247 pushing in a switch with a pin that's a bit bent will bend it flat and
248 prevent it from poking through the circuit board.
249
250 \vspace{1em}
251 \noindent\makebox[\textwidth]{%
252   \includegraphics[width=0.7\linewidth]{some-switches.jpg}}
253 \vspace{1em}
254
255 Next fill in the rest of the bottom row (SW1:3 through SW10:3) and the
256 leftmost column (SW0:1 and SW0:2). If your kit has red linear switches
257 which do not have any tactile bump, you can choose to use these for
258 the modifier keys (shift, ctrl, alt, etc) or to leave the modifiers as
259 normal tactile or clicky keys. Since modifier keys are held down, they
260 do not benefit from tactility like normal keys do, so some people find
261 they prefer linear keys there, but this is a matter of personal
262 taste. The modifiers on the bottom row are SW2:3, SW3:3, and SW8:3.
263 Place normal switches (usually grey or white) here if you want the
264 modifiers to feel like the other keys, and red ones if not.
265
266 \vspace{1em}
267
268 Solder the left and right pins of each of the switches you've placed so
269 far, and then plug it in to test them to ensure that each row and column is
270 connected back up to the controller correctly. Once you've confirmed
271 this, solder the rest of the switches, but leave the middle two
272 sideways ones for last.
273
274 \vspace{1em}
275 \noindent\makebox[\textwidth]{%
276   \includegraphics[width=0.7\linewidth]{center-switches.jpg}}
277 \vspace{1em}
278
279 %% The main (non-rotated) switches on Matias kits have their pins
280 %% positioned a bit lower on the switch than Cherry pins; this shifts
281 %% the whole PCB a bit further down from where it would be on Cherry kits.
282
283 %% The holes for the rotated switches are oriented according to their
284 %% position on Cherry boards because Cherry switches cannot have their
285 %% pins twisted; they have a plastic post that helps mount it on the
286 %% PCB, but moving the middle holes down into the Matias-friendly
287 %% position would make it completely incompatible with Cherry, while
288 %% leaving it in the Cherry-friendly position simply makes it slightly
289 %% inconvenient for Matias kits.
290
291 Connecting the center two rotated thumb keys (SW5:0 and SW6:0) in kits
292 with Matias switches requires a little bit of tweaking. (Cherry
293 switches do not need this step.) The holes for the pins are not
294 aligned quite under where the pins protrude. A little twisting will
295 allow them to go in nicely. Note that the two switches must be twisted
296 in opposite directions since they are oriented facing away from each
297 other. You can use pliers or even just your wire cutters to twist
298 them.
299
300 \section{Wrapping Up}
301
302 If there's a misbehaving switch, it's often caused by a cold
303 joint. Reflow the solder on both contacts of the switch and the diode
304 first; if that doesn't fix it, it may be the connection to the
305 controller. You can follow the traces for the rows back to the middle,
306 but the columns on the back of the board are obscured when the
307 keyboard is assembled; you can see them in this PCB
308 diagram\footnote{https://atreus.technomancy.us/pcb}.
309 Re-melting the controller's solder joint for the affected row or
310 column is usually enough to get it working, but in some cases you may
311 need to reach under to get the joint that connects it to the PCB.
312
313 \vspace{1em}
314
315 You may want to add strain relief by wrapping the USB cable with
316 electrical tape or a zip tie at the point just below where it leaves
317 the case. This will make it so pulling on the cable does not dislodge
318 it from the controller.
319
320 \vspace{1em}
321
322 After the switches are all in and tested, place the keycaps. They can
323 take a fair bit of pressure to go on, so support the underside of the
324 board while pushing them on. Once the caps are on, they are very
325 difficult to remove again; don't try to pull them off without
326 desoldering the switch first.
327
328 \vspace{1em}
329
330 All that's left is to do is close the case by placing the switch plate
331 on top of the spacer and bottom plate, placing the top plate on it,
332 and screwing it together with the nuts facing up. If the controller
333 was not attached close enough to the circuit board, it may be
334 necessary to sand down the USB connector in order to close the
335 case. If the rubber feet don't stay on with the provided adhesive,
336 white glue may be needed to secure them.
337
338 \vspace{1em}
339
340 Congratulations. Enjoy your new keyboard. It will take a
341 considerable adjustment period to get used to it, but it should result
342 in much more comfortable and effective typing. Also remember that
343 you're encouraged to customize the layout to make it truly your
344 own. Happy typing!
345
346 %% \noindent\makebox[\textwidth]{%
347 %% \includegraphics[width=\linewidth]{finished.jpg}}
348
349 \end{document}