So my plan is to convert an old and otherwise broken USB keyboard into a TTL serial device to easily communicate with it. This will require removing and replacing the controller in the keyboard with a TTL controller that I can program myself. I will have to make a PCB to suit the new controller. Next I will write a library to allow the Arduino to interact with the keyboard. I've never done some of these things, such as making a PCB, so this will be a learning experience for me as well.
![]() |
| The Keyboard: Doesn't work when plugged into a computer and is missing a button. |
To get the ball rolling I will take the back off of the keyboard, showing and explaining as much as I can about the workings of a keyboard for those that may be interested.
First thing noticed after taking the back off is the array of seemingly random input contacts.
Once the two layers of plastic containing the contacts are removed we see the rubber "springs" which allow the button to return to its normal state after pressing it. In this particular keyboard the springs are not fixed to the keyboard chassis. When I removed the contacts a couple of them decided to run across the table.
So here is a closer look at the two sheets of contacts. The lower sheet in this picture has the contacts slightly set into the plastic. This ensures that if there is no pressure on the contacts they will be separated by the thickness of the plastic. When a button is pressed and the rubber spring touches the contacts, the plastic is flexed which allows for a connection to be made.
To explain the actual mechanism that the keyboard uses to tell which key is pressed I will use a simplified diagram of the keyboard array. Imagine only the numpad on the keyboard, specifically only the numbers, excluding zero. We have a 3x3 array of numbers:
7 - 8 - 9
| | |
4 - 5 - 6
| | |
1 - 2 - 3
If all of the columns are connected with their own wire and all of the rows connected with their own wire we get an array of connections, or contacts. Now to read this simple input pad a controller has to have at least three output and three inputs. This would be the set up: the three inputs would be attached to the columns (or rows) and the three outputs would be attached to the rows (or columns).
To read this input device and determine which button is pressed the controller would have to run through this sequence. First a row (row 0 say) would be powered by the output pin, then the controller would check each of the input pins to see if any of them were "active". Then the next row would be checked and so forth. For example say the number 6 was pressed, the controller would make its way through the sequence to row 1 (second row) and check the inputs. It would find that the third input (input 2) is active. The controller would then use the information of which output and input were active to determine which button was pressed.
For a small 3x3 grid it is hard to see the advantage of doing something complicated when there are only 9 inputs. Even with this small example though the advantage is that only 6 pins were used to access 9 inputs. Imagine for a 4x4 grid, only 8 pins needed to access 16 inputs. Not bad.
This is in fact the same mechanism used in a keyboard, just on a much larger scale and not in such a nice square arrangement. Instead the rows and columns are skewed to make the keyboard layout that we are all familiar with.
I'm not sure when but I hope to purchase the controller for the inside of the keyboard soon and start playing around with it. I will keep you all posted!
That's all I have for today. Please feel free to leave comments / suggestions.



