by
QC
Posted on
Wed, December 29, 2021 - 12:57:57 PM
midi arduino lasercut 3D printing
Motivation
I have been browsing the net for an easy to use USB Midi controller which can be used with my mixing software
Mixxx to be able to mix podcasts on the go. Initially I wanted to buy an off the shelf product from Korg, the
Nanokontrol 2, but they raised their prices to 69€. That's honestly not a lot for a product this powerful, but what if I tell you that I can make it at home for less? Let's say 54€ less? Yes, I paid 15€ for the stuff (without the Arduino clone i already had). All the files are open source and uploaded to a
github repository.
Finished fader.
Specifications
The has a few interesting features, mainly that it can easily be programmed in the Arduino IDE. The LEDs are all separately addressable, which makes them writeable via the computer interface. All switches including the big red one are also connected to the
Breadboard Arduino clone. It doesn't need an external power supply or anything else.
- 4x 30mm Slider Potentiometers with custom knobs.
- 7x individually addressable LEDs
- 1x red/green dual color 10mm LED for RX/TX
- 1x main switch, software controlled.
- 3x buttons
- 3x DPST switches
- micro USB to serial connection.
Hardware
The hardware was partly lasercut, and partly 3D printed. The lasercutter is a cheap chinese 40W one with a pair of really expensive
thorlabs safety goggles. I used 4mm acrylic glas and grey PLA filament. The fader knobs are pink PLA.
In total the stuff cost me around 15€, including the Arduino clone it would be around 33€.
Bill of materials.
Rendering of the case and frontplate.
Frontplate:
Luckily SolidWorks can directly export to a .dxf file. This format can be read via the K40 Whisperer software and cut on the lasercutter. I avoided adding any markings on the acrylic, because it looks cleaner this way. Also I couldn't think of anything useful to add, feel free to let me know.
Lasercut frontplate.
The parts all fit perfectly, the LEDs are glued in with a drop off general purpose glue. Don't use Cyanoacrylate glue, it will destroy the acrylic.
Case:
I had to print the case in two parts as my 3D printer would have been too small otherwise. I glued it together with Cyanoacrylate glue, which works surprisingly well. It has four pillars for the M3 inserts, which can be put in with a soldering iron and a steady hand. The opening in the back perfectly fits the micro USB port. the print is quite easy to do for most 3D printers and should be doable with almost all materials. I used colorFabb PLA, grey for the case and pink for the sliders. The sliders have a black stripe in the middle as it looks nice. On the bottom are four 11mm diameter cutouts for 10x4mm rubber feet, this gives the case a better feeling.
3D printed case with Arduino clone already mounted.
Pink sliders with black stripe.
Rubber feet on the bottom of the case.
Schematics:
All of the connections were soldered directly onto the parts. The current limiting resistors are on the back of the LEDs, the blue ones got 220 Ohm due to their higher forward voltage, the others 1k Ohm. There is a ground rails going all around the back and the sliders also have +5V connected on top. The Arduino clone I had lying around was a perfect fit, as it has all IOs in two rows. Note that I had to connect a +5V wire on the back to the output row to be able to wire it up like this.
Schematics.
Software
As most Arduino clones don't have a dedicated USB microcontroller, I opted for a virtual Midi port. This means that the CH340 on my clone opens a virtual COM port on my machine and an additional software converts it into a Midi port. The software used for this is called
hairless Midi and works like a charm directly out of the box. It has a Windows, Mac and Linux version, so no stress there.
Code:
Coding wise this project is as simple as it gets. I wrote it as a long loop so it can be easily modified also by non coding people. Just take a look at the
github page and scroll through.
Screenshot of the code.
Mixxx:
Mixxx is quite chill about different midi inputs. I used the learning wizard to choose the controls I wanted to be controlled by the USB midi controller. It took a couple of minutes to have all the buttons, switches and sliders mapped onto the right elements. Afterwards everything worked like a charm and Mixxx saved my settings in a nice file.
Screenshot with Mixxx and hairless midi.
Conclusion
So that's that, I hope this guide didn't get too long. All the files are on
github so you can download them and browse through. Thanks to the original
tutorial I was loosely following. If you have any questions or feedback just write a message or leave a comment <3
Less glamorous shot of the final product.
Â