PS202 - MIDI-Duino

by Antti Pussinen and Wolfgang Spahn

An Midi-In and Thru/Out Board based on the Arduino Pro Micro. It can be used to controll all kind of devices like motors and lights. With an Arduino IDE modification one can use Midi over USB, too. A jumper allows to switch between Midi-thru and Midi-out.




Paper-PCB

Schematic

MIDI-IN, MIDI-THRU/OUT


Parts

  • Resistors:
  • 3x 220 Ohm
  • 3x 2 kOhm
  • 1x 1 kOhm
  • 1x 3.3 kOhm
  • Capacitor:
  • 3x keramic Cap 100 nF
  • 2x electrolytic capacitor 100 µF
  • Semiconductors:
  • 1x Arduino Pro Micro
  • 1x 7805
  • 1x inverter 74 LS 04N
  • 1x optokoppler 6N138
  • Diodes:
  • 3x LED Low Current 2mA
  • 1x 1N4148
  • 1x 1N4007
  • Mechanical:
  • 1x 8 pin IC socket
  • 1x 14 pin IC socket
  • 1x 10 pin socket strip
  • 1x 12 pin socket strip
  • 1x connector
  • 2x MIDI socket 5 pol 180°
  • 1x push button
  • 1/3 160x100mm 2.54mm raster stripboard

Software

Example Code

Arduino IDE hack

ARCORE USB-Midi hack for the Leonardo. One has to modify the Arduino IDE to run MIDI over USB.
Arcore Midi Hack
USB-Midi installation guide

Arduino MIDI Library

The Arduino MIDI Library v4.2 for Midi over TX/RX is here:
Arduino Midi Library
from that page:
https://github.com/FortySevenEffects/arduino_midi_library/releases/tag/4.2


Knowledge

The Arduino Pro Micro clone

https://www.sparkfun.com/products/12640

The cheap chinese clones don`t have the 3.3V converter on the board, they have a 5V converter. That means when powered over USB the Pro Micro runs on 4.7V. To close the jumper will avoid that (it´s next to the USB socket). But never power the Pro Micro again over the RAW input! Check the original sparkfun schematic for details.

Fast PWM

A super tutorial for the fast PWM on Arduino Leonardo:
http://r6500.blogspot.de/2014/12/fast-pwm-on-arduino-leonardo.html.
Due to the fact that the Pro Micro has no pin 11 or 13 I had to activate fast PWM on pin 5. It is the complementary channel A and thats why all values are 255 - value.

And here's the code:

void pwmSet5(int value)
{
 OCR4A = 255 - value; // Set the negativ PWM value
 DDRC |= 1 << 6; // Set Output Mode C6
 TCCR4A = 0x42; // Activate the complementary channel A
}
MIDI Library

Here are the links for the MIDI library for MIDI over the serial pins (TX, RX).
MIDI Library 4.2
MIDI Library Callbacks Description

MIDI Specifications
Midi Software for Linux