Author Topic: Reusing an old laptop keyboard for an Raspberry Pi laptop project  (Read 10353 times)

0 Members and 1 Guest are viewing this topic.

Offline Sullivanski

  • Thread Starter
  • Posts: 2
Reusing an old laptop keyboard for an Raspberry Pi laptop project
« on: Thu, 14 September 2017, 14:46:44 »
Hi there fellow geek friends.
I've been trying to gather information about a little project of mine, to resurrect old laptops with SoC computer chips like the Raspberry Pi. Now I know many might not like it and they will recommend me to do another way that is way easier, but I'm sick of the "throw anything that seems broken away" society. The pleasure to create something new out of spare parts is what's animating me lately.

To give you a headstart: I am capable to use the laptop screen through a driver board and the trackpad through a PS/2 workaround, it's fairly easy. Now this is why I'm here, the keyboard ethusiasts. Using the keyboard of an old laptop is quite a difficult task since the keyboard is just a flex cable without any drivers or controller whatsoever. The real controller are (mostly) embedded on the mainboard. So, not usable for my purpose (yet). But what I've heard is that you can use a controller from USB Keyboards. You just have to find a way to create some sort of adapter that puts the flex cable on the controller pins. But yesterday I found something that caught my eye. You all probably have seen these Android keyboards that you can buy at any Radio Shack.



Inside them is a small controller, that has the same distances of your flex cable and you can just fit it right to your laptop keyboard. Disclaimer, the following pictures are not mine, so I haven't laid a finger on it. This is something I'd like to discuss with others first before I give it a try. Especially because I have gathered no experience in stuff like that yet.



That thing fits mostly perfectly to any flex cable. Sometimes maybe 2 or 3 pins could be missing as you will see on the following picture, but it's usable.



In theory, the laptop keyboard will now be used as an USB device. Now here's where I need you, especially the friends of soldering parts by their own hands. You probably, most definitely have to create a custom keymap, but in Linux, almost everything is possible. And putting in every hardware to a serial bus would be nice since I can just put another SoC chip inside the laptop.

Here's my question: Is my idea possible? If it is, would someone agree to assist me in showing/explaining me how it's made? If not, has someone another idea for a workaround?

Leave your thoughts in the comments.

*SMALL EDIT: I have no Laptop yet, so I might be open to suggestions like a Thinkpad.
« Last Edit: Thu, 14 September 2017, 15:47:05 by Sullivanski »

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Reusing an old laptop keyboard for an Raspberry Pi laptop project
« Reply #1 on: Thu, 14 September 2017, 18:29:22 »
Not likely. The microcontroller chip would have to be programmable to be adapted to the matrix that your laptop keyboard uses.
Here, you can't even see what kind of controller chip it is. Maybe you could find out using the "lsusb" command, but I find it likely that it is a single-purpose keyboard chip that can't be changed from its factory matrix. Some of these cheaper controllers are made with the matrix defined by the chip manufacturer.

What people have done in the past is to use a Teensy 2.0 microcontroller board (or another board with the ATmega32u4 microcontroller) and one of the available firmwares for it. The keyboard matrix would have to be reverse-engineered and a specialised firmware have to be written and uploaded to the board - but I think there is also some firmware that can figure out the matrix by giving you instructions on which key to type and sensing what happens.
People have sometimes discussed connecting a keyboard matrix directly to the GPIO pins on a Raspberry Pi but I have yet to see that.

If you don't already have a laptop keyboard ... there are actually stand-alone Thinkpad keyboards. Those would connect to the Raspberry Pi with just a USB or indirectly from an adapter from dual PS/2.
« Last Edit: Thu, 14 September 2017, 18:35:06 by Findecanor »

Offline Sullivanski

  • Thread Starter
  • Posts: 2
Re: Reusing an old laptop keyboard for an Raspberry Pi laptop project
« Reply #2 on: Thu, 14 September 2017, 19:39:18 »
Some of these cheaper controllers are made with the matrix defined by the chip manufacturer.

Aw, shoots. I hoped that I could like somehow reprogram the matrix by software to make all the buttons work. I know, it'd be a lot of work since I need to get all button combinations working like Ctrl + [random symbols], Alt + [random symbols], but it would've been a job that I could get done by sitting my ass off.

Also, I have seen a solution that is no longer on sale, that actually uses an Ardurino and some sort of original controller for a keyboard. I could've paired the Adurino with the Pi, but tbh, I tried to avoid that since it would mean that there's another board cutting into my power supply.

If you don't already have a laptop keyboard ... there are actually stand-alone Thinkpad keyboards. Those would connect to the Raspberry Pi with just a USB or indirectly from an adapter from dual PS/2.

I've seen these Thinkpad keyboards, but I think it will be pretty hard to integrate them inside the laptop. Using the original one would've been the slickest option.

Alright, so if everything else fails, is there a good, small to none noticable way to replace a Laptop keyboard by a USB one?
« Last Edit: Thu, 14 September 2017, 20:05:40 by Sullivanski »