emacs/var/elfeed/db/data/5a/5a2863452595445fe08559e090ca39aa49ffd158
2022-01-03 12:49:32 -06:00

207 lines
15 KiB
Plaintext

<figure>
<img src="https://f000.backblazeb2.com/file/bsag-blog-imgs/handwired%5Fcorne%5Fin%5Facrylic%5Fcase.jpeg"/>
</figure>
<p>It seems that building keyboards is addictive. After my <a href="https://www.rousette.org.uk/archives/building-a-corne-low-profile-keyboard/">first attempt</a>, I
made another, this time a version with LED lighting. At least, that was the
plan. While the soldering for the keyboard itself went smoothly, soldering the LEDs
(SK6812MINI 3228 LEDs) was enormously frustrating. These LEDs have tiny contact pads
on the back of the unit, so to solder them into the openings in the PCB so that
they shine through the switches, you are supposed to create solder bridges from
the back of the LED to the PCB. Since the LEDs melt at temperatures quite close
to those needed to melt lead-free solder this &mdash; to put it mildly &mdash; is quite
a challenge. On one half of the keyboard, I got some of the underglow lights
working, but none of the per-key lights. On the other half, none of the lights
worked. I finished the keyboard and was pleased with the low-profile build, but
the situation with the lights quietly nagged at me. Through a combination of
curiosity and stubbornness, I felt compelled to have another go, and this
third Corne keyboard is the result.</p>
<h3 id="the-layout">The layout</h3>
<p>It is probably obvious by now (given that this is my third) that I love
the key layout and form factor of this keyboard. I love the fact that every key
is only one unit away when my fingers (and thumbs) are in their &lsquo;home&rsquo;
positions. The layout I have created for numbers, navigation and symbols makes it
extremely easy to type everything without stretching or searching. I went the
slightly unconventional route of placing the numbers in two rows on the left
half of the keyboard (1-5 on the top row and 6-0 on the home row). I have been
able to touch type for a while, but have never been able to accurately touch
type numbers until now. I could go on, but the main point is that I wanted to
stick with everything I had used for my previous builds (layout, Kailh Choc blue
key switches, and so on) but use SK6812MINI-E 3228 LEDs instead of the
frustrating SK6812MINIs.</p>
<p>The MINI-Es are very similar in size, and have the same capabilities, but
instead of the fragile pads on the back of the LED, they have little copper legs
which stick out either side. When you drop the LED into the PCB cut-out, the
legs stop it falling through the hole, and sit flush with the pads on the back,
so they are <em>much</em> easier to solder. The problem, however, is that despite the
similar part code, MINI-Es have a different pin-out and so are wired up
completely differently from the MINIs. This means that you can&rsquo;t just substitute
them unless the PCB has been designed especially for them. In <a href="https://github.com/foostan/crkbd/blob/main/corne-chocolate/doc/buildguide%5Fen.md">Version 3</a> of the
Corne PCB, the version for MX key switches is designed for the MINI-E, but the
Choc version uses the MINI LEDs. I did toy with the idea of learning how to
modify a PCB design using Kicad, but that seemed like too much of a leap in
terms of my knowledge. I mean, I&rsquo;ve only just learned how to use a multi-meter
to test continuity, so my electronics knowledge is not exactly extensive!
Instead, I decided to hand-wire the keyboard so that I could take into
account the different pin-out of the LEDs.</p>
<h3 id="hand-wiring">Hand-wiring</h3>
<p>Hand-wiring a keyboard isn&rsquo;t that hard. There are a number of detailed guides
available (this one by <a href="https://www.masterzen.fr/2018/12/16/handwired-keyboard-build-log-part-1/">masterzen</a> is very clear), and with a small keyboard like
the Corne, you don&rsquo;t have to do too much work. However, I wasn&rsquo;t sure how neat I
would be able to keep the LED wiring without a PCB, and how I would keep them in
place, as well as anchoring the controller and TRRS jacks. While pondering this,
I came across the <a href="https://github.com/swanmatch/MxLEDBitPCB">MxLEDBit single key PCBs</a>. These clever little things provide
support for a single key switch (versions for MX and Choc are available),
and provide breakout pads for wiring up the rows and columns, as well as
data in and out and power/ground connections for LEDs. There are also dedicated pads
for surface mounting diodes on each PCB. There are several similar versions out
there, but the benefit of the MxLEDBit is that it is compatible with the
MINI-Es. There&rsquo;s also a board that houses the ProMicro compatible controller
together with the reset switch and TRRS jack.</p>
<p>I really like these little PCBs, but there&rsquo;s a reason people use standard PCBs:
wiring everything up yourself takes so much longer, and the end result is
inevitably more bulky (even if you carefully route the wiring) than a standard
PCB would be. Once I had resigned myself to this being a multi-weekend project,
I found it quite a mindful process. My first task (which turned out to be the
quickest part of the project) was to solder a diode and LED to each PCB. I
hadn&rsquo;t used surface-mount diodes before, but apart from the challenge of
actually <em>seeing</em> the things properly to check polarity, they weren&rsquo;t too hard to
solder. The MINI-E LEDs were a delight. I couldn&rsquo;t be sure until I
finished the project but &mdash; spoiler alert &mdash; it turned out that the soldering
of each LED worked fine first time. I would never go back to trying to use the
MINIs as the MINI-Es are so much less trouble. Once each of the PCBs had the
components fitted, I separated them into individual units (they come as a 5x5
grid) and started on the assembly.</p>
<p>I re-used quite a few of the components from my first keyboard build, but I
bought an acrylic sandwich case to build the keyboard around, as it enabled me
to adjust the height by using more or less of the acrylic layers. Since I didn&rsquo;t
know quite how might height I would need to accommodate the wiring, it was
useful to have this flexibility. The switch plate was a bit thicker than is
ideal (3 mm). If I had been using hot-swap sockets for the key switches, I don&rsquo;t
think they would have held in place well, but with the MxLEDBit PCBs pushed tight
against the underside of the acrylic, there was just enough of the switch pin
protruding for me to solder them on. Before soldering the switches in, I created
all the row and column wire connections and tested for continuity with a
multi-meter.</p>
<h3 id="wiring-the-matrix-and-leds">Wiring the matrix and LEDs</h3>
<p>I used solid core 22 AWG wire for the rows and columns, and then stranded core
22 AWG wire to connect the rows and columns to the controller, as its flexibility
enabled me to move the wire around to provide room to solder the LED connections
later. I cut a piece of the solid core wire, stripped one end, bent the stripped
portion into a right angle and then figured out the length needed to the next
connection before trimming, stripping the wire and bending it. Each connecting
piece was therefore like a staple, and just long enough to reach from one pad to
the next. When I started, I had to be careful not to dislodge the key switches
(remember that I had not yet soldered them in), but as I soldered more of the
matrix with the solid wires, the whole thing held together better. Once I was
happy with the continuity of all the wires, I soldered the controller on to the
controller PCB, connected up the controller to the rows and columns and tested
each switch footprint with tweezers using the <a href="https://caniusevia.com">Via keyboard tester</a>. I had to
re-flow the solder one connection, but otherwise it all worked perfectly!</p>
<p>After soldering the key switches and testing again, I moved to the LEDs. I had
wired the rows and columns of the keyboard in exactly the same way as the
standard Corne to make life easier as I did not have to touch those aspects in
the firmware. I could not really do the same for the LEDs, as I was not using
underglow LEDs at all (so I had fewer units), and it also made more sense to
wire them in a different order because of the location of the pads. I wasn&rsquo;t
absolutely sure it was going to work, but after looking at the firmware, I was
fairly confident that I could specify a different number and layout order of
LEDs. Each PCB has a <code>DIN</code> and <code>DO</code> pad for data in and data out respectively. I
started by connecting the LED pin on the controller with the <code>DIN</code> pad of the top
row key nearest to the controller, then worked my way along the row, down to the
next row, back towards the controller, and so on, connecting the <code>DO</code> of one key
with the <code>DIN</code> of the next.</p>
<figure>
<img src="https://f000.backblazeb2.com/file/bsag-blog-imgs/the%5Fpretty%5Fguts.jpeg"/>
</figure>
<p>By this time, the board was fairly congested with wire, and I still had to
connect each of the keys to 5V power and ground. I decided to use very fine
magnet wire for this job to save space. This is enamelled to provide insulation,
but if you dip the tip in hot solder, the enamel burns off and tins the wire in
one go. The wire is 0.1 mm diameter (so literally as thick as a human hair), and
was fairly challenging to see, let alone solder. It was so fine that it blew
about in the draft from my ventilation fan. I had to manipulate it with my
fingers rather than tweezers, as I had read that tweezers can scratch the enamel
coating, leading to shorts. I think this was the part that I found the most
difficult, but I went slowly, testing as I went with the multimeter to make sure
that I was creating proper electrical connections.</p>
<p>Eventually, I had one side of the keyboard completely connected, and held my
breath as I plugged in the USB cable. Initially, only the first few LEDs lit up,
and were flickering different colours. I found that the connection from the
controller to the first key had a bit of a cold solder, and re-flowing that joint
made all the LEDs light up properly &mdash; celebration time!</p>
<p>With the knowledge that my wiring actually worked, the second half went a bit
quicker. I cut and placed the wire for each row and column before soldering in
one go, which was more efficient. I was also able to organise the wires from the
controller in a more compact way for the second half, learning from the
experience with the first. This time, the LED wiring worked perfectly first
time.</p>
<h3 id="the-case">The case</h3>
<p>The final task was to assemble the acrylic case. It came with M2 screws and
standoffs, but I bought some nicer hex socket screws and some different lengths
of standoffs so that I could organise the layers in the order I wanted. I ended
up using all the layers to give myself enough space for the wiring, but the end
product still feels very low profile compared to a standard keyboard. The only
thing I haven&rsquo;t solved is anchoring the controller PCB to the case. It has four
holes to fix it to the case with standoffs or screws, but the acrylic case was
not designed for it and does not have screw holes. I reckoned that my chances of
drilling acrylic without cracking it were basically nil. I had thought that I
might be able to use blobs of <a href="https://sugru.com/what-is-sugru">Sugru</a> to attach the boards to the base of the
case, but it turns out that the only thing that Sugru <em>doesn&rsquo;t</em> stick to is
acrylic. For now the boards are just wedged into the case and I have to be very
careful when attaching the TRRS or USB cable. Since this board is going to live
on my desk at home<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, that&rsquo;s not too much of a problem. I may
eventually be able to figure out a way of securing it a bit more solidly though.
I do like the way that the coloured light shines out through the sides and base
of the case. The transparent bottom also means that I can admire my hand-wiring
when I feel like it too!</p>
<h3 id="bonus-extra-custom-cables">Bonus extra - custom cables</h3>
<p>There was one other project that I had half-completed. Some way through building
the other keyboards, I had bought a custom USB cable kit and some angled TRRS
connectors with the idea of building custom cables to go with my new keyboard.
These have paracord sleeves with an extra Techflex sleeve on top for durability
and extra fanciness. I had already made the USB-C cable without too much
trouble. The heatshrink tubing application could have been a bit neater, but
otherwise it wasn&rsquo;t too difficult and works well. I like having a cable that is
exactly the right length for my set up so that I don&rsquo;t have untidy loose wire to
coil up.</p>
<figure>
<img src="https://f000.backblazeb2.com/file/bsag-blog-imgs/custom%5FTRRS.jpeg"/>
</figure>
<p>The TRRS was another matter entirely. In the past, I have looked at the prices
charged by companies making custom USB and TRRS cables and thought that they
were quite expensive. Now I think that they don&rsquo;t charge nearly enough money,
particularly for TRRS cables. Even soldering with magnet wire is easier than
trying to get those tiny wires into the right spots, avoiding melting the
insulation, and not getting any shorts. I tried twice and failed completely, but
decided after finishing this keyboard that I would have one last go. This time I
abandoned the idea of putting heatshrink under the metal sleeve which screws on
to the connector itself. This made it too bulky and impossible to fix when
shorts developed after screwing the thing together. Instead I wrapped the
assembly with electrical tape, then tested for shorts once it was screwed
together. I had to repeat this several times, undoing the tape, fixing shorts
and re-assembling before I got it all to work. Then I put the heatshrink on over
the outside of the metal sleeve to strengthen everything up. This time it was
third time lucky and the cable works! Again, I designed it to be just the right
length to loop around the Apple Magic Trackpad that I place between the halves
of my keyboard. I had intended it to be oriented so that the loop went over the
top edge of the Trackpad, <em>but</em> the section of the case next to the controllers is
just a bit too bulky to allow the jack to be fully inserted when it is in that
orientation. I&rsquo;ll have to live with it being oriented around the bottom edge
instead. It isn&rsquo;t a practical problem, but it looks a little odd. Anyway, I
don&rsquo;t really care &mdash; I&rsquo;m just jubilant that I finally got that cable assembled!</p>
<p>I&rsquo;m so happy with my new keyboard. It might seem ridiculous to go to such
lengths to have coloured lights on my keyboard, but every time I go to my desk
to work, the pretty lights cheer me up no end. I haven&rsquo;t played with that aspect
of my layout yet, but they could also have a functional role: you can change the
colour of the lights when particular layers are activated, or when caps lock
is engaged, or you can change the colour of particular keys to highlight groups
of keys on layers. I&rsquo;m happy with it just being pretty though, and the keyboard
is as delightful to type on as my other Cornes, and has a more solid, robust feel.</p>
<section class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1" role="doc-endnote">
<p>As the first one I built donated its parts, the second will be the one I take to work once I am back in the office full time. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</section>