Introduction: 3D Printed Arduino Macro Keyboard

This was my first project working with the Arduino Pro Micro. You can use it in Zoom or Discord chats to do things like toggle mute, toggle your video, or share your screen. On top of that, you can program it to open frequently used programs on your computer or do things like taking screenshots and locking the screen. The code can be pretty easily edited to your needs if you want to open different programs or if you want to add your own hotkeys.

To use it, you can toggle power on and off using the middle switch, and select whether you'd like to control Zoom or Discord using the right hand side switch. After that, just push the right button and do things like muting your microphone or toggling your video on and off.


Arduino Pro Micro x1

Perfboard x1 (I'm sure you can get it cheaper somewhere. This was just the first result I found)

Pushbuttons x 13

Slide switch x 2

5mm red LED x1

220 ohm resistor x1

Super Glue


Soldering iron

3D printer

Label maker (optional)

Drill (optional)

Step 1: 3D Printing and Joining

The first thing to do is 3D print your shell. My 3D printer is a little too small to print it all in one piece so I used this as an opportunity to practice a new technique for joining pieces. First, download the files from Thingiverse here. They can all be printed without supports or rafts.

You'll also want a hinge. You can just buy one from the hardware store, but I chose to 3D print mine as well using this awesome design: (not mine)

Once everything is printed, you'll need to join the two bottom parts together and then the same thing with the top parts. To do that, heat up your soldering iron and clamp together the pieces you want to join. Once your soldering iron is hot, place it on the seams between your two parts and drag it to the side to melt the two pieces together. Do this on the inside of the box to keep things neat and you should end up with a seam as seen in the above photos. You can then do the same with the two top pieces. If you are unsure about this step, have a look on Google. There are heaps of videos explaining how to join 3d prints with a soldering iron.

Depending on where you would like the USB cable to come out from, you'll also need to drill a hole in one side of your box and pass the small end of the USB cable through it. Again, if you don't have a drill, or if you want a neater look, feel free to use some 3D editing software to add the hole before printing.

At this stage, paint all the parts if you would like, and then glue or otherwise attach the hinge to the back of the box (see third photo above).

Step 2: Button Placement and Wiring

The buttons and slide switches should fit pretty snugly into the shell. Push in the pushbuttons from the bottom, and slot the slide switches in from the top. Depending on where you want your power LED, drill a 5mm hole and slot the LED through from the bottom as well. If you don't have a drill, I suggest using something like TInkercad to add a hole for the LED before you print the parts.

Use a bit of super glue to keep everything in place and now you're ready for wiring everything up. Follow the wiring diagram above and solder everything up. Use the perfboard to create your communal ground rail. If the perfboard is too big, feel free to cut it up in pieces like I did. Make sure that you note which button goes to which pin to update the code later.

Note that you should NOT be using an Arduino Uno (I could only use an Uno in the diagram sorry). All of the pin numbers are still the same, with a few written in manually if they aren't available on the Uno. Sorry for the dodginess of the diagram but it hopfeully still gets the point across :)

Step 3: Code

With all of the wiring complete, it's time to plug in the Arduino and upload the code. You can download the code below. When you upload the code, MAKE SURE YOU CHOOSE THE RIGHT BOARD! I bricked my first pro micro by selecting the 3.3V bootloader when my board was a 5V board (there is a way to un-brick it but I couldn't get it to work). Make sure you check! If you want to be sure, upload the code before doing all of your soldering in case something goes wrong.

There are a few areas in the code that allow you a bit of personalisation:

Power Button/switch
I initially had bigger plans that didn't work out, so there is an extra switch. In future, it may provide for extra functions but currently, the middle switch has replaced the big red power button to turn the keyboard on and off. If you would prefer to use a button as the power switch, there is an obvious code block that you can uncomment and use to replace the labelled section

Reordering buttons
If you would like to reorder the position of buttons, refer back to what pins each button attaches to. At the top of the code file, you can change the pin number definitions to reflect your personal setup.

Adding/changing hotkeys
The format for hotkeys is pretty self explanatory. If you would like to alter any of the hotkeys or otherwise modify the code, I have a few tips:

1. Windows key - This is designed for Windows so some of the hotkeys I used use the windows button. The Keyboard library doesn't have a Windows key, so use 'KEY_LEFT_GUI' instead.

2. press vs. write- The code uses both and Keyboard.write(). The write method is the same as just clicking the corresponding key on your keyboard. The press method is the same as holding down a key. If you use the press method, make sure you release the keys afterwards with 'Keyboard.releaseAll()'

3. Opening programs - My method for opening programs like cura and excel is a little bit clunky. Basically, the keyboard presses the Windows key (opens start menu), types in the name of the program using the 'Keyboard.println' method, and then presses enter. To make sure this works, you need to give the computer time to respond to each keypress before doing the next. The delays in my code are the right amount for my computer but you might need to extend them if your computer is a bit slower.

Step 4: Personalising Zoom and Discord

We're almost there! One of the last things to do is change a few settings within Zoom and Discord. In Zoom, we need to allow the relevant keyboard shortcuts to be used globally (i.e. make them work even when Zoom isn't the active window). Follow the photos above to go into Settings -> Keyboard Shortcuts and then tick "Enable Global Shortcut" for all of the relevant shortcuts. If you want to leave your meetings without having a warning dialog pop up, also head to Settings -> General and untick the "Ask me to confirm when I leave a meeting" box.

In Discord, open up the desktop app and go to Settings -> Keybinds, and then enter your preferred keybinds. If you don't want to change the code at all, just copy the settings seen in the last photo.

Step 5: Labelling

Once you've got everything functional, I'd recommend adding some labels to your buttons. I used a labelmaker but you could just as easily print something and glue it on, or you could maybe even 3D print some labels?

Step 6: Conclusion

That's it! We're ready to go! Once the keyboard is plugged in, there's no extra setup needed. The buttons should all register as expected. If you want to add more hotkeys, I'd recommend using the second switch the same way as the Zoom/Discord switch is used to make a single button have multiple uses.

If anything was unclear or if you want to discuss anything, feel free to leave a comment and I'll do my best to respond :)

Happy Making!

Arduino Contest 2020

Participated in the
Arduino Contest 2020