development

OpenDeck on Arduino

There’s an old saying which goes “if you can’t beat them – join them”. That kind of sums up latest OpenDeck development efforts.

Selling OpenDeck boards

Selling pre-assembled OpenDeck boards turned out to be not-so-profitable business. Actually, I was losing money on it. Once I’ve added up all the ridiculous taxes, import fees, PayPal fees, shipment etc. it turned out everyone else is making money on me, and I was losing money in the process. Granted, I was ordering small amount of OpenDeck boards, and ordering small amount of PCBs is never quite cheap, however I can’t really order hundreds of boards at this moment since demand isn’t that high yet. Instead, I’ve came up with other tactic.

Arduino

Pretty much anyone involved in some kind of electronic DIY project owns at least one of the Arduino boards. They are really cheap and good enough for most simple projects. One of those projects is often building a MIDI controller. So, how do people build MIDI controllers with Arduino? That’s actually not so simple task. Arduino doesn’t have easy to use USB MIDI support unless you code it yourself. You need to be a decent programmer to write MIDI controller software. You need to debug problems more often than not. All things considered, building MIDI controller with Arduino can quickly become a daunting task. There is, however, an alternative.

OpenDeck software + Arduino hardware

OpenDeck is really simple to use. Plug in the board to PC, PC immediately recognises new USB MIDI device and you’re pretty much good to go. Thing is, you need OpenDeck board for this, and there aren’t really that many boards around. What if you could run OpenDeck software on Arduino instead? Well, that’s exactly what I’ve done.

Arduino Leonardo and Pro Micro

First I’ve started with Arduino Leonardo and Pro Micro boards. They actually use exactly the same microcontroller as official OpenDeck boards – Atmel ATmega32u4. Making OpenDeck run on these boards was a simple matter of correctly defining pin addresses in firmware and I was good to go.

Arduino Uno and Mega2560

Getting OpenDeck to run on these boards was a bit more complex. In case you’re not familiar, these boards actually come with two microcontrollers on board – one main MCU, for which you actually write software (for Uno that is ATmega328 and for Mega that is ATmega2560) and other one (ATmega16u2) which actually serves as USB interface between your PC and main MCU on Arduino board. This MCU enumerates as Virtual COM port on PC, so, when you program the Arduino or read serial input from it, this MCU acts like a gateway between main MCU and your PC. The good thing about this is that Arduino boards actually have header on board which you can use to program this MCU, so, I’ve programmed it to act like a USB MIDI hardware. Entire communication process between PC and Arduino boards running OpenDeck software is really similar to original solution: all MIDI data sent from PC to Arduino first goes to ATmega16u2 MCU which then simply passes that same data to main Arduino MCU using serial link (also vice-versa), just like before.

 

Outcome

Now, Arduino Micro, Leonardo, Uno and Mega2560 can all run OpenDeck software. Plug your reprogrammed Arduino into PC, and PC recognises it as class-compliant USB MIDI device. Also, OpenDeck configurator recognises the board immediately and you can start configuring your brand new Arduino/OpenDeck board, just like with the official setup. The same I/O pins that you use on Arduino boards are used in OpenDeck firmware, so supported number of components is same as in original Arduino boards.

Availability

To get OpenDeck on Arduino, there are three options:

  1. Buy pre-configured Arduino board directly from me. This saves you a lot of hassle with compiling and uploading the code to Arduino (you will also need AVR programmer such as USBasp or AVRISP mkII). The pricing for this option is listed on my new website.
  2. Buy pre-compiled firmware and upload it to Arduino yourself. If you already happen to have Arduino boards laying around together with AVR programmer, you can buy pre-compiled firmware from me for 20€.
  3. Download the source code from GitHub, compile it and upload to Arduino yourself. This is for brave souls only – you will need Linux-based environment to compile the code, as well as familiarity with command-line tools.

Future

Based on interest, I plan to make OpenDeck available on more powerful ARM-based development boards, such as ST STM32 series. Also, plan is to add support for more complex components, such as OLED/LCD screens, accelerometers, gyroscopes and other more advanced sensors.

6 thoughts on “OpenDeck on Arduino

  1. Hi Paradajz and thanks for your work! 🙂

    I saw that in the GitHub packet there is a “fw_opendeck.hex” file that seems to be the compiled firmware.
    Does it work if you simply upload it using Xloader (http://russemotto.com/xloader/)?
    Isn’t it a 4th option?
    I still did not try because I fear to damage the board.

    I’m not into Arduino (I just received it as a present) and I don’t have an AVR programmer..

    Thanks a lot

    1. Hi Davide,

      precompiled Arduino firmware isn’t available – I am selling it for 20€. You are free to compile it yourself though – on GitHub all prerequisites are listed (Ubuntu, AVR toolchain etc.). In both cases (buying/compiling) you need AVR programmer, although you can simply use another Arduino as AVR programmer instead.
      If you need help let me know.

      Igor

      1. Thanks a lot for the reply!
        If I’m buying it, is there a newbie guide/video/link that shows me what to do?
        I can find anotner Arduino Mega from the friend that gave me the one that I have..
        Thank you!!

  2. Hi Paradajz
    I’m looking to order a pre-configured arduino board, could you tell me the number of analogue inputs (pot’s / faders) that are supported by the Leonardo and Pro Micro boards?
    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.