Arduino Mechanical Keyboard

The Hardware


Mechanical Keyboard With Arduino

Arduino mechanical keyboard software

Arduino powered mechanical keyboard. A full writeup along with photos is available on my website. This is a mechanical keyboard based around a Teensy 3.2 microcontroller board and the Cherry MX switches. The point of this project is not only to build myself a keyboard from scratch, creating a custom 65% layout, but also to try to program it. In this video, I show how I built a fully customizable keypad for my CNC using mechanical switches, an Arduino and a custom PCB manufactured by PCBWay, who y. A few years ago, Arduino has changed the way the USB is used. The NicoHood HID library makes use of the new possibilities. It makes it possible for example to have extended features for a USB keyboard, like the media keys. For a normal keyboard and mouse, the Arduino Keyboard Mouse library will do. It will be perfect for a ignition button. A small, Arduino-based physical device that can perform different keyboard operations through capacitive touch sensing.

  1. Solder the 500mah jumper on the trinket backpack for batteries larger than 500mah
  2. (Optional) Cut the switch trace on the trinket backpack and solder a micro switch between the two contacts. See for more details
  3. Solder the trinket backpack to the Bluefruit micro
  4. Solder the micro USB power connections to ground and 3.3v on the Bluefruit Micro
  5. Solder the Data ( + ) pin(PS2 clk) of the micro USB to pin 2 on the Bluefruit micro
  6. Solder the Data ( - ) pin(PS2 data) of the micro USB to pin 3 on the Bluefruit micro
  7. Solder all batteries in PARALLEL to the trinket backpack
  8. Plug the micro USB into the keyboard and double stick tape the electronics

Battery life and charging

  • Battery life depends on the size of your battery, power consumption of your keyboard, and the power level of your bluetooth
    • I haven't tested my battery life with 6000mah battery nor have I measured the power consumption( multimeter broken :( )
    • I can run a 12 hour work day with stock bluetooth power settings and medium backlight with no problems
  • You can charge the keyboard through the micro USB on the bluefruit.
    • I usually charge mine when I leave work

Arduino Pro Micro Mechanical Keyboard

The Software


  1. Download my git repo
  2. Install the proper drivers
  3. Download the adafruit Bluefruit library
    1. Add to your arduino library
  4. Add Adafruit board support in Arduino IDE

Arduino Keyboard Keys

Update your BLE module

  1. Download the adafruit app
  2. Follow this procedure

Upload the Firmware

  1. Open this project in the Arduino IDE
  2. Select Bluefruit Micro as your board
  3. Select the proper serial port
  4. Click upload

Arduino Keyboard Example

Limmy twitter. Configure and connect

  1. Hit shift + ctrl + esc on your MODIFIED keyboard
    1. This will reconfigure your bluetooth module for keyboard use
    2. Bluetooth is now named 'BLE_WASD'
    3. Do this again if your keyboard ever stops working randomly
  2. Connect your keyboard to your computer or phone
    1. I have only had luck with Windows 10(it was able to solve the funky driver errors from the adafruit bluefruit module)
    2. Windows 7 was a no go
    3. Windows 8 is untested
    4. Android only works upon first pairing
    5. Apple products untested


  • This code will work with any arduino and bluefruit module, you just need to change the pinouts and stuff.
  • This code supports 100% of the PS2 receiving protocol(one way communication) and has some extra features for a WASD keyboard(media keys)
  • Use the `special_functions( )` function to do custom things with your keyboard. Like make a T9 number pad.
  • You can change the power output of the Bluetooth module to increase range or save battery

This is a quick adobe rendering of what I want to do. I'm sure the color and placement might change a little but you get the idea of what I'm trying to do.

What blows my mind is nothing like this exist. There is one project I could find where someone added a Slide Potentiometer to a keyboard but it used 2 usbs. My goal is to have 1 usb that controls both the keyboard and the Slide Potentiometer.

So my question. Is there a single Arduino product that could handle mechanical keyboard inputs and 1-2 Slide Potentiometer ?