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