Noah's Macropad (Handwiring a Mechanical Keyboard)

by borrelnootje in Circuits > Arduino

483 Views, 3 Favorites, 0 Comments

Noah's Macropad (Handwiring a Mechanical Keyboard)

DSC09140.JPG
DSC09141.JPG
DSC09142.JPG

As a (beginning) mechanical keyboard enthusiast, I knew I had to make myself a macropad. Gateron Milky Yellow Pros, a rotary encoder, all packed up in a cat-themed case. Featuring my keycaps from Osume and GMK's 'Dandy'. (the pictures above show my hotswap 60% build).

Supplies

IMG_8265.jpeg
IMG_8305.jpeg
IMG_8383.jpeg
circuit_itotm.png
  • Soldering iron
  • Soldering tin
  • Wires. Lots of wires! In different colors as well, to make sure the digital pins stay organized!
  • Cutting pliers
  • Stripping tool
  • Headers
  • Arduino Leonardo (without the plastic bottom case)
  • Rotary encoder EC11
  • Switches (Gateron Milky Yellow Pros in my case)
  • A case (MDF, consisting of the bottom, side and top plates)
  • 3D-printed knob for the EC11 encoder (6 mm diameter hole, 18 mm diameter in total)
  • 3D-printed cat ears
  • Code!
  • A lot of patience :)
  • MDF pcb
  • Resistor x11 (10K ohm)
  • A metal bar (4 mm diameter)
  • Tweezers (to make it easier to pull the resistors through and bend the legs to a 45 degree angle)


Optional (although, some people would find this a must): lubing (+filming) your switches.


You're also going to need a circuit, to make sure you're soldering the right parts to the right components.


You will be left with 3 parts:

  1. The bottom part (including the Arduino)
  2. The middle part: your MDF pcb, your circuit plate including the headers and soldered on switches and resistors
  3. The top part (2 MDF sides, 1 MDF top)

Prepping

IMG_8162.jpeg
IMG_8161.jpeg
IMG_8171.jpeg
IMG_8191.jpeg
IMG_8234.jpeg
  • Use double sided tape to attach the Arduino to the bottom plate. Make sure to put a little MDF plate in between (4 mm thick, mm width, 40 mm height).


Measurements

  • 3D knob:
  • 18 mm width
  • 5,8 mm hole
  • Cat ears
  • Width: 14 mm
  • Height: 20 mm
  • Side plate (printed 5 times)
  • Inside
  • Width:59,5 mm
  • Height: 80 mm
  • Outside
  • Width: 71 mm
  • Height: 93 mm
  • Bottom plate
  • Width: 71 mm
  • Height: 93 mm
  • Top plate
  • Inside
  • Width: 52 mm
  • Height: 65 mm
  • Outside
  • Width: 71 mm
  • Height: 93 mm
  • Printed Circuit Board (PCB, the plate with the little holes on which you solder)
  • Width: 56 mm
  • Height: 79 mm
  • Little MDF plate that goes in between the bottom plate and the Arduino
  • Width: 30 mm
  • Height: 40 mm


Notes

  • All the MDF plates are 4 mm thick.
  • Import the 'cat ears' file into Cura twice, and reflect one ear. Also turn the ear to its side, to prevent a blob at the top.
  • I sawed the left piece of the pcb off, otherwise the top wouldn't fit on.

Headers

IMG_8325.jpeg
IMG_8328.jpeg
IMG_8336.jpeg
IMG_8341.jpeg
IMG_8343.jpeg
IMG_8345.jpeg
IMG_8351.jpeg
  • A little tip to make this easier: make sure to have some styrofoam where you can push the headers in for some stability.
  • The shorter header pins must be on top, the longer ones will push into your Arduino!
  • Firstly, heat the pin, then add the soldering tin, remove the soldering tin, and lastly remove the soldering iron. The blobs can't touch each other!

The tough part

  • You're going to need 3 more digital pins for the rotary encoder, but the header distance didn't correspond with the distance between the little dots on the plate.
  • To solve this: I pushed a 3-pin header (you can break this off if you have a longer header) into the 3 digital pins that I needed and then bent the pins. I soldered some wires at the end of this 3-pinned header, that I stripped. Then I pulled them through the board, after which I soldered and cut them. Between the Arduino and the plate now were 3 'naked' wires, which I isolated with some tape. Et voila! Improvise, adapt, overcome.
  • Useful to know: you can bend sheathed wire.

Extending the Switch Pins

IMG_8197.jpeg
IMG_8359.jpeg
IMG_8361.jpeg
IMG_8363.jpeg
IMG_8366.jpeg

In order to fit through the MDF pcb, you're going to have to extend your switch pins. The picture above shows a very ugly soldered switch, but I have found a life hack that prevents blobs of tin from getting all over your switch. First, tin the end of the switch pin, then the end of the wire. Hold them together, heat it up (no tin!) and there it goes. Make sure to remove the soldering iron once it sets, because if you hold it longer the tin will come off again. This way, you're not going to need a robot hand (unlike the one I used on the picture) AND you'll ensure that your switch is the right size to fit through the MDF plate.

Getting the Switches Through the Circuit Board

IMG_8369.jpeg
IMG_8370.jpeg
IMG_8371.jpeg
IMG_8372.jpeg
IMG_8373.jpeg

You now have your switches plopped through your MDF plate, now it's time to get this construction through the circuit board. Here comes the fun part, your sheathed wires won't fit through the plate ;) So first, you're going to have to strip the wires. Now this is where your map will come in handy, because you're going to have to wiggle all the pins through the board, at the right spot. Practice makes perfect, and patience is key as well! I believe in you :D

IMPORTANT: Make Sure the Switch Pins Are Straight

IMG_8458.jpeg

This makes it easier to get the switches through the circuit board, as well as keeping everything nice and organized. Oh, and this will prevent your wires from breaking off, because you won't have to wiggle them to get them straight.

Pull the Resistors Through the MDF Plate

IMG_8460.jpeg
IMG_8463.jpeg
IMG_8466.jpeg
IMG_8471.jpeg
IMG_8479.jpeg

Bend the legs to a 90 degree angle and pull them through the designated holes on the MDF plate. Now, bend the legs to a 45 degree angle, preventing them from slipping out when flipping the plate over.


Ideally, you would want 3 dots in between the resistor legs.


You want to make sure that the switch pins and resistor legs are as close to each other as possible. This will make connecting them to one another easier.


We'll also be needing 3 resistors for the rotary encoder, which we will place at the top of the circuit plate

Extending the Encoder

Soldering to the Circuit Board

Now you've got all the wires through, let's secure them by putting some soldering tin to each pin on the circuit board. This will ensure the wires staying in place, making it easier to work with them. After you've done this, you can cut the switch pin wires to the same length, but make sure to keep enough length (approx. 4 cm) to connect the other parts to the switch pin wires.


You only need a little blob, as big as one hole of the circuit board (just like you did at step 2, when soldering the header to the circuit board)

Attaching the Encoder

IMG_8498.jpeg
Screenshot 2023-02-05 225951.png

At step 2, you DIY'ed a 3-pin header for the rotary encoder. Now, you're going to attach the bottom 3 wires of the encoder (that you soldered on at step 7) to the 3 pins of the header. This means that you're going to have to desolder the previous wires that were connected to the 3-pinned header. To do so, simply hold the soldering iron next to the tinned connections and wait until the soldering tin gets hot. You can now pull apart the two wires, if they're not already falling themselves.


  • Top left pin of the encoder:
  • Right leg of top resistor (1/3, at the top of the circuit board)
  • Digital pin to header 10 (see explanation above)
  • Top right pin of the encoder: Left leg of the middle resistor (2/3). This will lead to the 3.3V
  • Bottom left pin of the encoder: Digital pin to header 8 (see explanation above)
  • Bottom middle pin of the encoder: to the GND (horizontal bar right below)
  • Bottom right pin of the encoder:
  • Digital pin to header 9 (see explanation above)
  • Right leg of the middle resistor. This will lead to the 3.3V


  • Left leg of the top resistor: GND
  • Right leg of the top resistor: top left leg of the encoder


  • Left leg of the middle resistor:
  • Top right leg of the encoder
  • Left leg of the bottom resistor
  • 3.3V (header pin)
  • Right leg of the middle resistor: bottom right pin of the encoder


  • Left leg of the bottom resistor: left leg of the middle resistor
  • Right leg of the bottom resistor: header 8


Connecting the Switch Pins to the Resistor Legs

Screenshot 2023-02-05 195006.png
Screenshot 2023-02-05 194805.png
Screenshot 2023-02-05 195659.png

I get it, you're overwhelmed by the amount of wires now. I was too, so this was the part where I decided to take a break. But no worries, Noah from the future knows exactly what to do.


Bend the right leg of the resistor upwards, bend the right leg of the switch downwards. Press them down and put soldering tin on the dot where the two wires intersect.

Connecting the Switch Pins to the 5V

Screenshot 2023-02-05 201833.png

Now you're going to need your metal bar (0,4 mm diameter). Place it VERTICALLY next to the left pin of a row of switches and make to add some tin at the crossroads.

Connecting the Resistors to the GND

Screenshot 2023-02-05 202835.png

Place the other metal bar HORIZONTAL underneath the resistors. Connect the left pin of the resistor to the horizontal bar underneath. Note: there will only be two horizontal bars instead of three, so you're going to have to connect the bottom (left) resistor legs to the horizontal bar above (instead of below). You can do so by using a wire, but make sure this wire is isolated (so keep the wire sheath on!)


IMPORTANT: before you do this, measure out where the vertical bar and the horizontal bar will cross each other. Mark these points on the horizontal bar, and add a heat shrink before connecting the left pin of the resistor to the horizontal bar (that will eventually lead to the ground, but we'll get to that later).

GND to GND, 5V to 5V

IMG_8524.jpg
IMG_8527.jpg

We're talking metal bars here. You've now connected the switch and resistor pins to the bars, but what are the bars connected to? Well, nowhere.. yet. This is your time to shine, connect the 5V bar (vertical) to the 5V header, and the GND bar (horizontal) to the GND header.


Lastly: connect your two horizontal bars as well as your two vertical bars to each other.

Code!

NOTE: this code does not contain the code for the rotary encoder yet, nor have I figured out yet how to have one key act as ctrl+c (and ctrl+v).