Skip to main content

Build your own Makey Makey

The Makey Makey is a great board to quickly build interface devices. It plugs into a computer and gets recognized as a keyboard and mouse and allows you to easily add buttons and switches to your setup. As it works on conductivity you can change all kinds of objects (such as bananas) into buttons.

However, the Makey Makey is quite expensive, can't be easily modified and isn't always as easily available. Luckily you can build a very similar input device using a pico. After following the steps below the boards will get recognized as a HID (keyboard, mouse, gamepad) by any computer and OS (Mac/Win/Linux).

This process consists of the following steps:

  • Installing CircuitPython and copying the AdaFruit Human Interface Device (HID) libraries to the board.
  • Changing the code to select the inputs you want to use. You have the following options:
    • Keyboard - any key on a physical keyboard, or combination of keys (ctrl-c and ctrl-v)
    • Mouse - buttons, scroll and mouse movement
    • Media buttons - play, pause, skip, sound level

This tutorial uses the first pages of the DIY mechanical keyboard on the Adafruit page.

Installing Circuitpython and HID libraries

First install Circuitpython to the Pico, then copy the libraries to the board. Make sure that the libraries match the version of circuitpython you are running.

Editing the code

Copy the code from this page and save it to your Pico using your favourite Python editor. Don't have a favourite editorone yet? The tutorial page useduses Mu editor.editor, but you can use Thonny as well.

As copied, this code maps the following keys to the following pins:  --Note that the code skips pin 15--

Pin
Input
GP0 (KEY, (Keycode.GUI, Keycode.C)),
GP1 (KEY, (Keycode.GUI, Keycode.V)),
GP2 (KEY, [Keycode.THREE]),
GP3 (KEY, [Keycode.FOUR]),
GP4 (KEY, [Keycode.FIVE]),
GP5 (MEDIA, ConsumerControlCode.VOLUME_DECREMENT),
GP6 (MEDIA, ConsumerControlCode.VOLUME_INCREMENT),
GP7 (KEY, [Keycode.R]),
GP8 (KEY, [Keycode.G]),
GP9 (KEY, [Keycode.B]),
GP10 (KEY, [Keycode.UP_ARROW]),
GP11 (KEY, [Keycode.X]),  # plus key
GP12 (KEY, [Keycode.Y]),
GP13 (KEY, [Keycode.Z]),
GP14 (KEY, [Keycode.I]),
GP16 (KEY, [Keycode.O]),
GP17 (KEY, [Keycode.LEFT_ARROW]),
GP18 (KEY, [Keycode.DOWN_ARROW]),
GP19 (KEY, [Keycode.RIGHT_ARROW]),
GP20 (KEY, [Keycode.ALT]),
GP21 (KEY, [Keycode.U]),

You can change the inputs to other KEY codes, other MEDIA codes or other MOUSE codes. Check the Adafruit HID library documentation to see which options for inputs you have. The list is quite long, so have fun!

Wire up your Pico!

Connect your inputs to the relevant pins (pin number and GND). Pin pressdowns will only work when there is conductivity, so experiment around with what will connect and what doesn't. The simplest form is of course just to add a button to the end of the pin.