Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an old laptop keyboard like the one shown below: old laptop keyboard

It has a 24-wire flat cable coming out of the back. Would it be possible to use this as a keyboard for the Pi (I assume with some microcontroller in between)?

share|improve this question
I don't know for that one in particular, but I do know that it is possible to modify a some laptop touchpads to work with regular ps/2 without any active extra circuitry. – Gunnish Feb 18 '13 at 10:35
grynx.com/projects/converted-laptop-keyboard might interest you. – Lord Loh. Feb 19 '13 at 22:40
Possible, probably, but if you need to ask, you most likely do not have the skills to do it. I would suggest a cheap USB-keyboard. – Thorbjørn Ravn Andersen Mar 2 '13 at 21:55
up vote 6 down vote accepted

There is no easy or simple way to achieve what you ask. The simplest answer is just ignore this keyboard and get a USB one.

However, if you really want to do it, it's a DIY job through and through. Your solution will be custom to this keyboard and may or may not be easily adapted to accommodate keyboards from other manufacturers.

Laptop keyboard connectors are not standard. They vary across manufacturers. Typically, they also lack any electronics to process the keypresses and convert them into simpler data messages, e.g. key codes or button codes etc.

Therefore, first you need to figure out what happens each time you press a key, i.e. which electrical signals get activated (get shorted together).

Then you have two options, both very tricky:

Option 1 - Very advanced:

You need to construct an electronic interface which will connect between the keyboard and the USB port on the Pi. It needs a microcontroller to emulate a USB keyboard when it's plugged into the USB port and you will need to write software to map the key pressing signals into USB keyboard presses. The microcontroller needs to do all the work. You might want to read this related question: Can I make a full USB keyboard with Makey Makey + Raspberry Pi

Option 2 - Insanely advanced:

Raspberry Pi has a connector with 17 GPIO (general purpose input output) pins. You need to design a circuit to reduce the 24 keyboard lines and interface them to the GPIO pins. Then you need a custom keyboard driver for the Pi operating system.


Some of the 24 connector lines will be inputs and others outputs. Each time a key is pressed, some of the inputs connect to some of the outputs. Some of the lines may be unused. It will take patience and a continuity checker to figure out exactly what happens. Also consider searching for keyboard encoder chips. This is an example: http://www.ti.com/product/tca8418e These chips take out the hard work of encoding.

share|improve this answer
Basically, it's probably impossible... =P – daviewales May 26 '13 at 10:40

Sorry to reply to such an old thread, but you can achieve this with an old USB keyboard controller.

I haven't tried it yet, but I believe this should be possible. Simply line up the connectors on the ribbon cable with those of the keyboard controller and hold it in place with the cap (make sure it has the same amount of connectors, it usually does). If the ribbon cable is too small, get an adapter.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.