This unit utilizes MIDI Note ON/OFF data to control LEDS, Relays, Transistors, Triacs, etc. to switch Lights, Motors, etc. when combined with suitable output circuitry.
The unit responds to the default range of 62 MIDI notes from 36(C2) to 97(C#7). However any consecutive 62 note MIDI range can be pre-programmed into the unit on request. The 62 outputs, on the Arduino Mega, start at Digital Pin D8 and continue consecutively to pin D69. The outputs are normally at 0 Volt and when they are selected they switch to +5 Volts.
This unit can work in standard MIDI mode and via the USB connection. It defaults to standard MIDI Baud rate of 31250. By replacing the original firmware on Mega8u2/16U2, the Arduino Uno will act as USB-MIDI device (Standard Midi Class), you do not need to install additional device drivers on Windows, MaxOSX, and Linux, as the firmware acts as a device of Standard Midi Class. It will automatically install on the system as an Audio USB Device.Operation:
The unit detects the incoming MIDI data and if the MIDI channel corresponds to the correct MIDI channel setting, when a corresponding Note-on is detected, (to the pre-set note-on data), the corresponding output is switched on (+5 Volts) and stays on until the corresponding note-off is detected and the output is switched off (0 Volts). This allows each output to operate independently.Circuit Schematic:
Arduino Pin D0/RX is connected to the output of the Opto-coupler whose input is connected to the MIDI IN socket. Arduino Pin D1/TX is connected to the MIDI OUT socket via resistor R5. Arduino Pins D2 and D3 provide +5 Volt and 0 Volt(GND) but they need to be set correctly in the software. Arduino Pins D4, D5, D6 and D7 are connected to the 4-way DIP switch, which can be used to select the MIDI Channel (1 to 16), as shown in Table 1.
So 8 Pins (D0 to D7) are used when the MIDI IN/OUT board is plugged into the Arduino. All other pins are still accessible.
The outputs, on the Arduino Mega, start at Digital Pin D8 and continue consecutively to pin D69. (Note that Analog In Pins A0 to A15 are configured as digital outputs D54 to D69, respectively,MIDI Wiring:
The MIDI IN and OUT connectors use 5-Pin 180 degree DIN sockets. Note that the MIDI IN/OUT wiring is polarised and the correct pins should be used.Output Current Drive:
You can get a maximum of 40 mA (milliamps) current from each output separately. But the maximum combined rating when several pins are active at the same time is 200 mA for all pins. However it is probably best not to run the outputs at their maximum rating. For example, if driving LEDS directly via a series resistor, then high effeciency LEDS should be used to reduce the current required.Power Supply:
External power can come either from an AC-to-DC adapter or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack.
The board can operate on an external supply of 7 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.MIDI Channel Selection:
The outputs are switched ON via MIDI 'Note-On' commands and OFF by MIDI 'Note-off' commands. These MIDI commands are all channel (1-16) dependent. The MIDI channel (1 to 16) is selected by the 4-way DIP switch, shown in Table 1. Also, the outputs will switch Off if a correct MIDI Note On with a velocity of 00 is received. The unit also works in MIDI Running Status mode.
Table 1 MIDI Channel