Embedded Keyboard Project, Part 1

Hello,
This is the first of a series of posts detailing our EE 478 final project, which is to create a MIDI instrument. The idea is to dismantle an electronic keyboard, and rewire all the keys in order to make our own keyboard instrument. I’m feeling more free to publicize my work on this project, since my lab professor Dr. Peckol publishes our work on the class web site for future classes to use as reference, anyway (link).
For this project, we’re creating a 49-key digital keyboard instrument. The keyboard is equipped with an LCD screen interface which shows a navigation menu, and is navigated with pushbuttons. The navigation menu allows the user to change musical settings, such as instrument, reverb, chorus and volume. The system is designed to be low-power and low-cost. We are running all components in the system on a 3.5 Volt supply (except for the external speakers). The 49 key musical keyboard input is controlled by a PIC microcontroller, which converts the keyboard input into MIDI serial data that is sent to a synthesizer chip. The microcontroller is also responsible for interfacing with LCD and pushbuttons for musical configuration settings.
Today, we made our first leap into the project by purchasing a used 49-key MD-500 ‘Optumus’ Radio Shack keyboard on Craigslist for $20.
As you can see, the keyboard is equipped with all sorts of features, including a MIDI recorder / playback feature, metronome, prerecorded songs, auto-rhythms, MIDI-out, and more. For our project, we are creating our own features, so all of that stuff is going to be removed.
After taking apart the keyboard, here is what is in the inside:
As you can see, there are five visible main sections. There are the two speakers, which we may not end up using. There is the panel for all the buttons, which we won’t need either. On top of that, there is the LED screen for the front panel, which is not useful. The keyboard is powered by a battery pack, which we probably won’t use. There is the keyboard section (bottom), which has groups of 8 diodes, each for a section of eight keys. Total, there are 49 diodes on this board. Connected to this board through the large gray ribbon is the ‘mother board’ for the keyboard.

The ribbon consists of 15 wires, connecting the 49 keys to the keyboard controller. I needed a soldering iron to completely remove the mother board to see the circuitry on it, but by peeking under, here was what was uncovered:
As you could see, the keyboard wires feed into a 38-pin DIP adapter, which feeds into some mysterious ball of black glue. What’s under this black glue is probably the keyboard controller / MIDI synthesizer.
Hmmm… 15 wires and 49 keys… how does that work? Well, I found an informative site online, for creating a simple keyboard controller with the PIC16F877A microcontroller, which we now have quite a bit of familiarity with:

(Credits for this diagram go to Thomas Scarff, Lecturer at Dublin Institute of Technology, School of Electronic and Communications Engineering)
The circuitry in the keyboard is probably very similar to the image above. The keys are arranged as a matrix with rows and columns. On the keyboard I got, the notes are probably grouped by rows of 8, not 16. The keyboard controller polls only one of the rows of eight keys at a time by asserting high one of the row selector pins (pins 34 through 40 in the image). When a row is selected, the values of the notes on the row will appear on the column pins for the keyboard controller (pins 2-9, and 19-30 in the image). For 49 keys, you need 7 columns of notes to select out the individual row of eight notes (49 / 8 = 7, rounded up). Doing the math, 8 rows + 7 columns = 15, which accounts for all the wires in the ribbon. Our next step is to figure out which wire corresponds to which row or column on the key matrix.
The keyboard controller continuously loops through all the rows of keys and collects data on the state of all the keys. When one key is noticed to have changed, a on or off key event will be triggered, depending on the new state of the key.
Well, that’s all for now, I will continue to give updates as our project progresses.

Leave a Reply

Your email address will not be published. Required fields are marked *