LEET Keyboard

3D printed single octave MIDI keyboard with full color LED feedback.

This single octave MIDI keyboard is part of the LEET synth project. Before continuing with the details below, it’s a good idea to read the main post first (if you haven’t already):

This post describes how the keyboard works, how it was developed, what you need in order to build your own, and a step by step building instruction.

Description of the LEET keyboard

Product guide. Click here to download high-resolution PDF.

Part list:

Component cost is around $6 on eBay (October 2020, depending on shipping and supplier).

  • 1x 3D printed core 3DPCB. Uses 34g PLA filament ($0.7).
  • 1x Arduino pro micro, or compatible clone (5V version. ATmega32U4) – (~$4)
  • 15x 6x6mm 4pin through hole tact switches – preferably with low activation force (50g / 0.5N) – ($0.2)
  • WS2812 LED-strip with 13 LEDs (60 LEDs/m. I used IP60, white FPC) – ($1.1)
  • 1x 25cm RK wire (containing 24 strands of 0.3mm copper wires) – ($0.1)

Equipment:

  • 3D printer (FFF/FDM with PLA filament)
  • Solder station with a narrow tip
  • Basic tools: needle- and cutting pliers, knife, hot-glue
  • Computer to run Arduino IDE and upload firmware (using a Micro USB cable)

Development

The keyboard was the first device I developed in my LEET synth project. I wanted to build a minimalistic MIDI keyboard that could be connected to a computer or mobile phone to make up a basic synth. There are tons of professional keyboards available, but they are quite bulky and expensive compared to what I had in mind. There are some DIY MIDI keyboards online, but the ones I found were either too basic (proto or perfboard without any case) or overly complicated and bulky, with different parts requiring complicated assembly. As always, if you can’t find what you are looking for – build it!

Since I wanted to have LEDs for feedback, I decided to use WS2812b addressable LED-strips to provide full color feedback, minimum wiring and only a single I/O on the Arduino. I selected a LED-strip with 60 LEDs/m since the distance between each LED roughly matches a piano.

Each switch on the keyboard goes to a dedicated I/O of the Arduino pro micro. This way, there is no risk of key ghosting, and no need for decoder ICs or diodes; simplifying design, cost, program and assembly. Two extra switches are used to select octave, and a third switch is used to select MIDI channel. I did not include pitch bend and volume potentiometers, but it should be quite easy to add, since two I/Os are unused (but switch pinout to ensure that potentiometers are connected to AD inputs).

The keyboard is quite compact and robust. I initially made it thinner, but it looked fragile and unbalanced, so I increased the thickness to 8mm. To keep the design clean, I kept all wires on the backside, but exposed the components on the front. They could of course be covered by a front, but I like the techy appearance and having a single 3D printed part that integrates the whole product.

Embedded code for the Arduino pro-micro.

screenshot of main loop

The program of the keyboard is straight forward thanks to the use of MIDIUSB and NeoPixelBrightnessBus libraries. The main loop reads the switches, sends corresponding MIDI commands and listens to incoming MIDI for the LED feedback. If the incoming MIDI package correlates to the selected channel, the corresponding LED is enabled and the color of the LED is derived from the pitch of the note. The global constant ‘echoLED’ controls if the LEDs are lit up on keypresses and incoming MIDI (if true) or only  MIDI (if false). When adjusting octave or MIDI channel; the number of lit LEDs indicate the selection and then fades rather quickly. Since the keyboard only has 13 LEDs – channels 14-16 are not shown, but can be selected. To make setup easy – a change of MIDI channel is stored in EEPROM and thus remembered the next time the keyboard is powered up.

Step by step building instructions

This instruction describes the assembly process step by step on a level suitable for most people. Building the keyboard is quite easy thanks to the wire channels in the 3DPCB which indicate how the components shall be connected.

Building a LEET Pad in 10x speed. The Keyboard is built in a similar way.

1. 3DPCB:

Download the latest version of the 3D model here (the .stl file is suited for 3D printing.)

Print the core using a fff/fdm 3D printer.  I recommend beginning with the smaller leet_test part to verify that your printer is calibrated before starting the 3-4 hour print.

I used the following settings:

  • 3D printer: Prusa i3 MK3S with 0.4mm nozzle
  • Material: PLA
  • Nozzle temperature: 210deg C
  • Layer height: 0.2mm
  • Infill: 20%
  • Support: None

    The printing time is 3-4 hours with default speed. Once the print is done, you can trim any defects with a fine sandpaper if needed.

2. Arduino program

While printing you can download, set up and program the microcontroller:

  • Install the Arduino IDE and download the latest LEET keyboard firmware here.
  • Download and install MIDIUSB and NeoPixelBrightnessBus libraries.
  • Connect the keyboard to your computer with a micro USB cable.
  • Select Arduino pro micro as board, and select corresponding com port (if the Arduino is not appearing with a com port, try another cable, since some charging cables lack data wires and won’t work).
  • Compile and upload the code.

3. Wires:

Strip 25cm of RK wire (the multi stranded cable used for internal wiring in electrical 230V cabinets) to get the 24 pcs of 0.3mm copper strands inside.

4. Microcontroller:

Secure the Arduino pro micro (without pin headers) in place with a dab of hot melt adhesive (glue gun) on the backside. Ensure that the holes are aligned.

5. Switches:

Insert the switches and fold the pins on the backside to lock them in place. I recommend a small flat screwdriver.

6. LED strip 1:

Cut a section of LED strip with 7 LEDs.

Backside view of LED strip with marked pads.
  • Remove the protective liner and the double sided adhesive that covers the three connections on each end on the backside of the section of the LED strip.
  • Solder two strands of wire to “DIN” and “GND” on the exposed pads of the backside (note that one end of the LED strip is “DIN” and the other is “DO”).
  • Solder three strands of wire to the other side (DO, 5V & GND).
  • Thread the 5 wires through the 3DPCB, remove the liner and press the LED strip in place.
  • Thread the DIN wire through the wire channel to the microcontroller, ensure it’s tight and solder it in place on the front side. Cut away excess wire close to the solder.
  • Thread the neighboring GND through the channel, stretch, solder it to the Arduino board and trim.
  • Thread the three remaining wires on the other end through their channels to each dedicated opening.

7. LED strip 2:

Backside view of LED strip with marked pads.
  • Cut a section of LED strip with 6 LEDs.
  • Remove the protective liner and the double sided adhesive that covers the three connections on the “DIN” side.
  • Solder three strands of wire to “DIN”, “GND” & “5V” to the exposed pads on the backside.
  • Thread the 3 wires through the 3DPCB, remove the liner and press the LED-strip in place.
  • Thread the 5V wire through the channel, stretch and solder it with the wire from the other LED strip in the dedicated opening. Trim the wire from the other LED strip.
  • Continue to thread it to the microcontroller, stretch it and solder in place.
  • Thread the DIN wire through the wire channel to the opening where it meets the “DO” wire from the other LED strip. Ensure both wires are tight, solder them together and trim the ends.
  • Thread the GND wire and solder it together with the other GND wire at the dedicated opening. Trim the wire from the other LED strip and continue to thread the wire through its channel to each of the 12 switches. Tighten it and solder the wire to each switch (24 pins) along the way.

8. Connect the switches

Solder a wire to both available pins of a switch. Insert it in its wire channel, thread it through the Arduino, add some tension, solder it and cut the remains.
Repeat for all 15 switches. Don’t forget to take a break every now and then to stay focused.

9. Inspect

Check the solder joints, ensure that the wire is secured and tight within its channel and that everything is flush against the backside. If anything is loose, protrudes, looks funny or sharp – re-solder until it’s perfect.
Good job – Give yourself a well-deserved high five.

10. Power up and play

Connect the keyboard to a computer or a mobile phone with a USB micro cable. The startup animation should turn on every LED and the device should appear as MIDI in your DAW. Insert a coin and start playing!

Download project files

All files required for this project are available at this GitHub repository:

https://github.com/vonkonow/LEET-Synthesizer/tree/main/Keyboard

License

This project is open source under MIT License
(Attribution is optional, but appreciated /Johan von Konow ;)

24 Replies to “LEET Keyboard”

  1. My son and I would really like to make one of these, but it’s too big to be printed in one go on our aging Printrbot Play. Would it be possible to make a version that would print in two sections with a dovetail joint or similar to puzzle-piece it together? I tried for a couple of hours to split the stp file but it appears I don’t know what I’m doing.

  2. This is fantastic. Excellent work on the STL file, prints like a dream. I even printed it at 100 percent infill the first time, and despite taking all night and having to play a game of tweeze the string in the morning, the end result is fantastic, weighty, and lucky within tolerances. I cannot wait to finish and plug this thing into Ableton.

  3. This is fantastic (and quick!) and I really appreciate you doing this for us. I’ll let you know how it goes.

  4. Hi Johan this is awesome, thank you for sharing it. Any recommendations of where to buy multiple arduinos or clones for the project?

    1. Hi
      It depends on your location and delivery time.
      I buy from eBay within Europe to avoid customs tax when shipping to Sweden. Part price is higher, but total cost lower for smaller quantities.
      eBay from china or Alibaba is the cheapest way, but shipping time and tax might be a disadvantage. At alibaba you can find pro-micro clones for $2.5.
      Buy direct at Huaqiangbei is the best option, but a bit tricky today due to covid…

  5. Thanks for making all of your hard work free and starting a community! This posting couldn’t have come at a more perfect time. I printed a few arcade button boxes last week but these look so much more fun. The first layer on the print was fun to watch, I was sure something would come off the build plate or not stick but no issues so far. I didn’t see a place to donate or send you a cup of coffee! Thanks again.

  6. I’m having trouble (embarrassingly) figuring out just what exactly RK cable is. I am in the USA, could anyone help me figure out what to ask for/search for so that I pick up the right thing at the hardware store? Or order it? I just want to be sure me and the nephew do this right. Thank you so very much for all the hard work you have done on this, it has not gone unappreciated. This is something fabulous!

    1. The exact diameter of the wire is not critical. Any conductive wire will do.
      I have tried lots of different wire diameters and think that 0.3mm diameter is the goldilocks option, not too stiff, and not too fragile.
      I have used strands of wire from RK cable (24 strands in each cable) since it can be bought in any hardware store at very low cost. The RK cable is typically used as internal wiring in fuse boxes and control units, since it is easier to bend than the cables used in the walls (with fewer and thicker strands).
      Technical name is RK (H07V-K) (750/500 V), it typically follows
      IEC 60228 class 5. https://en.wikipedia.org/wiki/IEC_60228 and SS 424 02 31-3
      Here is one source in Sweden with an English website: https://www.biltema.se/en-se/construction/electrical-installations/installation-cables/coupling-cable-2000017929

      I’m sure that there are similar cables around the earth. If you find one, please let me know the name in your region and I will update the post.

  7. Just printed this last night found a 4 pack of micro pros on amazon shipped for around $18 and 120 switches for 3.99, lights are bit tricky fir good quality so still searching for those, wish I could post a pic of my print

      1. Hi Patrick
        Normal force 100g / 1N will work fine, but might be a bit too clicky, dependning on taste.
        I bought low force ALPS switches at huaqiangbei last time I was in Shenzhen. I have not seen similar on eBay, but if anyone finds a link, post it here.
        Digikey mouser and other well sorted distributors have high quality switches with different activation force:
        https://www.digikey.com/en/products/filter/tactile-switches/197
        https://www2.mouser.com/Electromechanical/Switches/Tactile-Switches/_/N-5g2m

  8. Im having the same issue. I looked into it and the only thing that I could come up with is this is thermostat wire. I am hoping the we can get a link to the ebay listing or something to compare against.

  9. Johan for some reason I have not been able to register for you forum. But i already ordered parts and printed 2 of the parts. I would love to help on the project. Plus how cool would a user build gallery for you look! Anyhow, I had a question about the LEDs I can find 1m 60s/m and then it jumps to 5m 60s/m and so on. Which size do i need?

    1. Strange with the forum registration. Have you checked your spam filter if the email confirmation gets caught there?
      The idea with gallery is definitely something to consider, I’ll see what I can do.
      Regarding the LEDs, the units are using 8-13 LEDs each. That means that 1 meter with 60 LEDSs is enough for 4-5 units. If you want to build more – then 5m (300LEDs) should have you covered ;)

  10. That number in the US market place is how close the LEDs are apart from each other. Anyway you can email me so we can chat?

  11. First, Thank you very much for your invention, i’ll tried it !!

    I want to try to modify all the pieces on the top or bottom to can make puzzles parts and be able to nest the pieces to finally create a big synthesizer !! :D what do you think about that ?

  12. @pyriel127 and @aokpj – I put a post in the “what-is-rk-wire” thread that Johan created with my discovery that ordinary “lamp cord” (aka 18/2, the stuff between a plug and a lamp or appliance, from Home Depot or Lowe’s, about 27-38 cents/foot) does just fine – it has about 19-20 individual strands per “side” that I measure at 0.28-0.30mm each and which are actually spec’d by most mfgs I could find as 0.3mm. See my post for more details. Looks like it’s going to work very well.

  13. For anyone else checking this out I think “28 gauge bus wire” or “28 gauge bare copper wire” is what you want here if you just want to go the amazon route. Looking at the H07V-K seems to be around 12 gauge; and 28 gauge at 24 wraps that would put it right at around 14 gauge which should be close enough for government work.

Leave a Reply

%d bloggers like this: