Close
0%
0%

Physical Keyboard for any Android phone

This is my attempt at having an android phone of my choice coupled to a portrait Physical QWERTY keyboard off an old blackberry.

Public Chat
Similar projects worth following
Ever since my first Blackberry, I've grown really comfortable with physical keyboards, and time and time again, I've found myself going back to the brand, despite some of their shortcomings. Following the death of my Priv, I've decided to start building my own phone with the specs that I want. The aim of this project is that by the end, I will have a fully functional daily driver android with a slide-out portrait keyboard.

After failing to map the pinouts to the Priv's combined keyboard/trackpad, I decided to use a keyboard off a Q10, due to the decent amount of information available. Using a Hirose BM14B connector soldered onto a PCB (and this, ladies and gentlemen, turned out to be the hardest part of the whole project) I then could solder wires and map it out on a Sprintek SK5126 chip. This chip is the best one I've seen around in terms of keyboard encoders as it comes with free and easy to use software to program it, it is also designed for mobile devices and therefore inherently low-power. It can be powered directly with a 5V source (such as a phone in this case) or one can power it with a 3.3V supply. 

Initially I put all components on the bare metal chassis of an old Priv, the idea was to see how all the other components would fit around it, which turned out to be unnecessarily complicated. Using a regular USB 2.0 cable, I could program the SK5126 and test out the layouts as well as hunt for shorts caused by the BM14B connector.

The donor phone of my choice turned out to be a Xiaomi Mi 8 SE due to its relatively high specs for its cheap price and a variety of available custom ROMs. I bought mine second-hand off ebay but for this purpose, any phone which supports OTG will do fine as Android automatically supports physical input devices OTG. 

This meant I had to buy a male USB C connector and use only the Power, Ground and D+/D- lines as well as ground the Configuration channel pin through a 5.1Kohm resistor (which indicates to the phone that it is an OTG device). 

  • 1 × Sprintek SK5126 Reprogrammable keyboard encoder chip from a company in California which converts a keyboard matrix into a USB output. Same USB is also used for programming the keyboard matrix and other parameters.
  • 1 × Hirose BM14B connector Actually more than 1 were needed as soldering these connectors onto the PCB is a real headache and most of them ended up molten from the heat.
  • 2 × PCB one PCB to branch out from the Hirose connector, the other one is to solder the SK5126 chip. Joining both PCB with wires determines the layout of the matrices.
  • 1 × USB 2 and USB C connectors.
  • 1 × Any android phone one might want to use. In my case it's a Xiaomi because of how easy it is to mess around with and how cheap it is.

View all 6 components

  • Suggestions? Please let me know!

    kylemonti11/10/2019 at 15:15 0 comments

    Before I finalise the test phase. I had a few ideas I would like to include in the final project which make a lot of sense and provide much much more functionality.

    1)  The SK5126 chip provides 2 pinouts for a PS/2 mouse (1 clock, 1 data) which means that I can simultaneously, without changing the chip, have a small mouse/trackpad allowing for more precise control without having to reach up for the touchscreen. Blackberry's trackpads automatically spring to mind, but upon reading the pinouts online, I don't understand how I can interface this as PS/2 data. If anyone has any information or ideas on how to achieve this, please let me know.

    2)  As the keyboard occupies the only USB port on the entire phone, I am also thinking of adding a USB hub chip with power support. This will allow me to charge the phone and plug in all sorts of OTG devices without having to unplug the keyboard every time. I think this is relatively easy to achieve and there are many chips out there which facilitate this.

    Let me know if you have any other relevant ideas I might try to incorporate into this project.

  • Scope of testing and known issues

    kylemonti11/10/2019 at 15:07 0 comments

    In its current test-phase, the complete phone and keyboard assy are rather bulky (more precisely it's just too long to fit in any reasonable pocket). Also, the weight on the phone means the whole thing is a bit top heavy and makes typing on it a bit less comfortable. This has been forseen which is why in the final build (the slider) I intend to pull the battery out of the phone and stick the battery right behind the keyboard and then attach a flexible extension cable to the motherboard which allows power to be delivered via the slider mechanism together with D+ and D- cables from the SK5126 chip. The battery connector seems to be a Hirose BM25, which I cannot find from the same shop I bought the BM 14B connector. This is my next task as it is a showstopper until I'm able to provide power to the phone of course.

    Another annoying issue comes from the BM14B connector which adapts the keyboard's I/O. due to the extremely small pitch of 0.4mm between each solder, the SK5126 sometimes detects a small amount of voltage between 2 adjacent pins and registers this as a keypress. This problem has been largely mitigated by putting resistors in line with the rows, this also resolves any capacitative effect happening between these extremely close pins. Nonetheless it still manifests itself from time to time and I intend to keep a close eye on it during this test phase. 

  • Practical test phase

    kylemonti11/10/2019 at 14:48 0 comments

    At this point in time, I have installed the keyboard and both PCBs on a sheet of PVC which I used to make a special cover for the phone. This allows me to test out the complete system in a practical manner without having to modify the phone at all. A switch on the side cuts off the power to the chip and will be connected to the slider in the final build to switch on the keyboard only when it is extended. The red and green LED's are indicators for ALT and Caps Lock respectively (they are driven directly by the SK5126 encoder which is another great reason to use that chip). 

View all 3 project logs

Enjoy this project?

Share

Discussions

kylemonti wrote 5 days ago point

@RW Is that the lead based one? Or do you know a particular part number/composition? Both my iron and heat gun are controlled temp. And I've got 19 connectors spare so I might give that a shot. Cheers.

  Are you sure? yes | no

RW wrote 5 days ago point

The stuff I've got is ancient, not sure the label on the tube is readable. I think it's just a tin/bismuth one. (Surprising it still seems to work given the 6 months or 1 year shelf life I'm seeing on these now) . The "good stuff" is meant to be the Motorola spec Indalloy 282  Bi57Sn42Ag1 which has mechanical strength equivalent to normal solders, yet melting point is down around 138C. They are all lead free I think due to lead crystallising and making it all crumbly if it gets in contact with Bismuth. That's the caveat with them, you have to make connections on clean, bare copper, to make sure they don't mix with another solder and go weak. However, the cheaper stuff and joints that can only be cleaned down to light tinning, can still be protected mechanically by immobilising the wires with glue and tape etc. This wouldn't be recommended for higher power connections though. 

  Are you sure? yes | no

RW wrote 6 days ago point

Nice, following because I've got some old BBs I wanna repurpose the keyboards from. What bugs the hell out of me on android though is the number of emulators or other ports of keyboard heavy applications that don't use the standard keyboard drivers. Some of them your hardware keyboard doesn't work at all only their custom software keyboard. Some of them, really only the alphabetic keys work, try and shift for symbols etc, and they act dumb. Extremely annoying when most of these are what I want a physical keyboard FOR. Some have variant behaviour with types of keyboard, possibly driver differences, a phone with a slider keyboard, that I've also used USB KB and a Bluetooth KB on, different keys and functions don't work, super frustrating. 

  Are you sure? yes | no

kylemonti wrote 6 days ago point

sounds more like an issue with the keyboard manufacturer. It all boils down to the encoder chip.

For me the worst ordeal has been soldering the hirose bm14b connectors which connects to the keyboard to the breakout pcb. Hot air melts them well before the solder paste. Using an iron to heat up the tracks individually proved better but causes a lot of microscopic shorts between them (the pitch is only 0.4mm). Hold the iron a second too long, and the connector once again deforms. What I've discovered is that if the shorts are too small to be seen, I can melt them away by hooking up a 1.5v battery to 2 of the shorting pins for a second, causing the short circuit to melt that last bit of solder under the connector without damaging it. Its the only way I've managed to make it work.

  Are you sure? yes | no

RW wrote 5 days ago point

Well they'll work fine in android specific applications, text and document editors etc, or for typing anything into text boxes in the browser like this one. 

One can find low temperature solder paste that flows at 180C or something like that, possibly lower. Kinda difficult if you don't have a temperature controlled iron though, you kinda have to pulse width modulate the heat transfer manually.

Also you can get for cars in an automotive store "defogger repair epoxy" or paint, which you might tack down fine wires with. It will add a couple of ohms though. 

  Are you sure? yes | no

kylemonti wrote 11/10/2019 at 15:26 point

Special thanks to Arturo182 on github who published the pinouts to the BB Q10 keyboard.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates