Build your own MIDI projects
Frequently Asked Questions.
MIDI & Music
MIDI and Music Information
MIDI 40 Keys, Modulation, Pitch Bend and Volume


MIDI 40 Keys and 3 Variable Controls 


The keyboard encoder is capable of encoding up to 40 momentary action, push to make, single pole single throw (SPST), switches to produce the equivalent MIDI note-on/note-off data commands and 3 variable potentiometer controls, which output MIDI Volume (7) and MIDI Modulation (1) Control Change commands and the MIDI Pitch Bend command. The keys are arranged in an 8 x 5 (40 keys) matrix.

The variable potentiometer controls can be pre-programmed to other Control Change commands if required.


The encoded switches are wired via IN4148 diodes, see switches schematic.




MIDI 8x5 Keys & 3 Controls


PRICE:  €45.00


 *Click to Enlarge*







The 40 Keys and 3 Variable Controls consists of:

  • The MIDI channel is preset to channel 1 
  • The velocity byte is preset to the maximum value.
  • Keyboard ranges from MIDI note 36 (C2) to MIDI note 75 (Eb5),
  • Other MIDI  velocity and/or start Note can be programmed on request,
  • An Arduino board including a suitable pre-programmed Atmega microcontroller,
  • A 2.1mm power socket, and associated LED, 
  • A MIDI 5-pin DIN output socket.



The 40 Keys and 3 Variable Controls requires:

  • a 9v battery or equivalent DC power source
  • Suitable key-switches or magnetic reed switches and associated IN4148 diodes,
  • 3 suitable, 10k ohm linear variable potentiometers


Circuit Schematic:

A switches circuit schematic of the 40 Keys and 3 variable potentiometer controls shows the switch connections. 


Three Variable controls:

The  3 variable potentiometer controls are for MIDI Volume, Modulation and Pitch Bend. 


Note that if  any of these 3 inputs are left un-connected then random corresponding Volume, Modulation and Pitch Bend outputs will be produced.



The MIDI IN OUT connector uses a  5-Pin 180 degree DIN sockets. Note that the MIDI OUT wiring is polarised and the correct pins should be used.






MIDI 8x5 Matrix Wiring:

The switches are organized in a 8 x 5 matrix (40 switches) arrangement. The switch keys are wired as shown in the  Wiring diagram.


The first 8 switches are all connected to Pin D10 on the Miduino. Also the other sides of these switches/diodes are connected down to Miduino contacts D2 to D9. So, for example, terminal connected to D10  is wired to one side of the 8 key switches SW 0 to SW7 and the wire can be looped from one key switch to the next.

The lowest note  is switch SW0 wired via diode D0 between digital Pins D2 and D10.
Pin D2 is also wired to the Anode of D8 and via SW8 to digital Pin D11. 
Pin D2 is also wired to the Anode of D16 and via SW16 to digital  Pin D12.
Pin D2 is also wired to the Anode of D24 and via SW24 to digital Pin A0 (D14).
Pin D2 is also wired to the Anode of D32 and via SW32 to digital Pin A1 (D15).

Each of the other side of these switches SW0 to SW7 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 5 other diodes. For example Anode (A) of diode DO is looped to D8 then to D16 then to D24 etc. down to D32 and finally to digital terminal Pin D2 on the Miduino.


The rest of the wiring is done in a similar manner


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.