project #10: MKCV96
96 keys MIDI Keyboard Controller with Velocity sensing


Once upon a time there was a nice chip named E510: 128 keys velocity sensitive keyboard scanner. Unfortunately, it has been discontinued. During discussions of my other projects I was often asked if there is some replacement of this chip. That is why I decided to design velocity sensitive keyboard controller, based on PIC16F84 which is full functional replacement of E510. For your information, E510 datasheet can be found in the Documents page.

Initially, 124 keys version of this unit (mkcv124) was released, but there appeared problems with multyple On/Off keyboard events. The problem decision cost was reducing scanpoints to 96. The freed RAM was used for key flags. This way, the current version is 96 scanpoints, not 124. It is still convenient for standard piano keyboards.

mkcv96 is capable to scan up to 96 keys (8 octaves) with changeover contacts. All features of E510 (except scanpoints number) are supported. In addition, user is able to select amongst 4 velocity sensing curves (see pictures below).


Here is the typical schematic of velocity sensing keyboard design using mkcv96.

(click on picture to see it enlarged)

The unit shown above can be connected to PC Game/MIDI adapter or to standard MIDI device. An additional stabilized power supply unit is needed in the second case.

Velocity curve #0 (Lin)
Velocity curve #1 (Exp)
Velocity curve #2 (Log)
Velocity curve #3 (S-type)
MIDI channel #1(phisycal 0)
MIDI channel #2(physical 1)


mkcv96 can be used for E510 replacement:

The typical uses of E510, described in datasheet are also supported by the mkcv96 replacement unit.

Below is an illustration of Velocity sensing keyboard construction. The picture is placed here by kindly permission by its author, Derek Johnson (UK). Full description of Derek's Velocity sensitive keyboard controller (including source files) can be found on his own site.

Used parts:

: PIC16F84. Can be used PIC16C84. The difference is that the first one has Flash memory, and the second has EEPROM memory. There is no difference in the way they are used in such designs.
:74LS138 decoders 3:8. Up to 14 of them can be used, depending on user's needs.
X1: Quartz resonator. Must be 4MHz.
C1,C2: Capacitors 27pF each. Certain quartz resonators have these capacitors integrated.
If you use such resonator, there is no need of C1 and C2.
D1..D96: Each contact (key) has serially connected diode to prevent keycrossing when more than one contact is closed (a few keys pressed on keyboard). These can be any type of standard diodes.
R1,R3..R9: Resistors 2.2k. Used to hold up certain IC pins.
R2: Resistor 220 Ohms.
J1,J2,J3: Jumpers.


  • In case when mkcv96 is connected to standard MIDI device, that device must have an opto-isolated input. This is an standard requirement for every MIDI input. The mkcv96 MIDI output is capable to drive an opto-isolator with up to 10 mA which is the standard current for MIDI interface. Click here for more information about interfacing MIDI devices.
  • Using external power adaptors with output voltage more than 5v could damage your controller and the other MIDI devices connected to it. As I know there are no 5v adaptors on the mass market. Making such adaptor is relatively simple work. You can click here to obtain such adaptor schematic. It is not required to be an electrician in order to make such adaptor but a basic knowledge about electrical safety is a must. I assume that reading this means that you are capable to build the schematic shown above, thus you are capable to build the adaptor yourself.

Embedded software:

The firmware for this project is free for non-commersial use and can be downloaded from here .


Here is how the ready assembled unit looks (click on picture to see it enlarged).

Details about ordering this and and other units can be found here. Package for this unit includes User Manual with fully documented schematic.