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