This keyboard encoder is capable of encoding any number of momentary action, push to make, single pole single throw (SPST), switches from 1 up to 128 to produce the equivalent MIDI note-on/note-off data commands on any MIDI Channel (1 to 16).The encoded switches are wired via IN4148 diodes.

The unit can work with any size keyboard up to 128 notes. Any unused keys/notes can be left unconnected.

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.


This unit can be connected to new keyboards or it can be used with an older non-MIDI keyboard by using magnetic/reed switches to isolate the old and new scanning circuits. This will allow the older keyboard synthesizer to continue to operate as normal while also providing a MIDI output.

MIDI 128 Note Keyboard Encoder Wiring:

The switches are organized in a 16 x 8 matrix (up to 128 switches) arrangement. Note if less than 128 switches are required, then ONLY the switches required need to be wired.

The lowest note is switch SW0 wired via diode D0 between Pins 22 and 23 of the Arduino MEGA.

The next note is switch SW1 wired via diode D1 between Pins 24 and 23 of the Arduino MEGA.

The next note is switch SW2 wired via diode D2 between Pins 26 and 23 of the Arduino MEGA.

The next note is switch SW3 wired via diode D3 between Pins 28 and 23 of the Arduino MEGA.

The next note  is switch SW4 wired via diode D4 between Pins 30 and 23 of the Arduino MEGA.

The next note is switch SW5 wired via diode D5 between Pins 32 and 23 of the Arduino MEGA.

The next note is switch SW6 wired via diode D6 between Pins 34 and 23 of the Arduino MEGA.

The next note is switch SW7 wired via diode D7 between Pins 36 and 23 of the Arduino MEGA

Pin 22 is also looped to the Anodes of 15 other Diodes D8, D16, D24, D32, D40, D48, D56, D64, D72, D80, D88, D96. D104, S112,  and D120.

Pin 24 is also looped to the Anodes of Diodes D10, D19, D28, D37, D46, D55, D64, D73, D82, D91 and D100.

The other 7 pins 24,  26, 28, 30, 32, 34 and 36 are wired in a similar manner to the other Diodes.

Pin 23 is connected to switches SW0 to SW7,

Pin 25 is connected to switches SW8 to SW15,

Pin 27 is connected to switches SW16 to SW23,

Pin 29 is connected to switches SW24 to SW31,

Pin 31 is connected to switches SW32 to SW39,

Pin 33 is connected to switches SW40 to SW47,

Pin 35 is connected to switches SW48 to SW55,

Pin 37 is connected to switches SW56 to SW63,

Pin 39 is connected to switches SW64 to SW71,

Pin 41 is connected to switches SW72 to SW87,

Pin 43 is connected to switches SW88 to SW95,

Pin 45 is connected to switches SW96 to SW103,

Pin 47 is connected to switches SW104 to SW111,

Pin 51 is connected to switches SW112 to SW119,

Pin 53 is connected to switches SW120 to SW127.

Each of the other side of these group of 8 switches (eg SW0 to SW7 etc.) is wired to a diode on the Cathode (K) side (end of diode with stripe).

The other side of each of these diodes is looped to  other diodes. 

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 MIDI Channel (1-16) is user selectable via the 4-way DIP switch. The system will also work with MIDI running status.

DIP Switch Selections



4 3 2 1
on on on on 1
on on on off 2
on  on  off on 3
on on off off 4
on off on on 5
on off on off 6
on off off on 7
on off off off 8
off on on on 9
off on on off 10
off on  off on 11
off on off off 12
off off on on 13
off off on off 14
off off off on 15
off off off off 16

Table 1 MIDI Channel


The MIDI/USB 128 Note Keyboard Encoder unit consists of:
  • An assembled, built and tested Arduino board including a suitable pre-programmed microcontroller,
  • The velocity byte is preset to a value of 100,
  • The MIDI channel (1-16) is user selectable via the 4-way DIP switch
  • Other velocity values can be pre-programmed into the firmware on request,
  • A 2.1mm power socket, and associated LED,
  • A MIDI activity LED,
  • An assembled, built and tested  MIDI In/Out Board,
  • A 150mm wired MIDI 5-pin DIN input socket,
  • A 150mm wired MIDI 5-pin DIN output socket,
The MIDI/USB 128 Note Keyboard Encoder unit requires:
  • a 9v battery or equivalent DC power source
  • Suitable key-switches or magnetic reed switches and associated IN4148 diodes


The MIDI/USB 128 Note Keyboard Encoder Unit Resources:
MIDI/USB 128 Note Keyboard Encoder

ITEM#: MIDI/USB 128 Note Keyboard Encoder

PRICE:  €69.95

After clicking on the 'Add to Cart' button, just complete your order on the Paypal site, where you can select the required quantity. Also the appropriate shipping cost is calculated and added. However you may still cancel or adjust your order, at this point.