Mechanical Keyboard Goes BLE

Like many programmers, [Daniel Nugent] loves his old mechanical keyboard (a WASD Code Keyboard). What he didn’t love was the cord. Sure, you can get a modern wireless keyboard, but it won’t be the same as the keyboard you’ve spent so much time with. Armed with a Bluetooth Low Energy (BLE) module, a rechargeable battery and some coding, he kept his keyboard but got rid of the wires.

Although he has some specific handling for the WASD, the code would very likely handle any PS/2 keyboard. The PS/2 interface is a simple synchronous serial port with a single clock and single data line. Handling it with a microcontroller isn’t very difficult.

You might like a refresher on how the PS/2 communicates. Or, perhaps you’d rather just build the whole keyboard. We’ve even seen people who really went old school on mechanical keyboards. For us, though, a hack like this on an IBM model M would be good enough.

If you want an overview of Bluetooth vs BLE, checkout this post and see the video below.

18 thoughts on “Mechanical Keyboard Goes BLE

  1. This is probably the best case scenario for inductive charging. The keyboard will spend 60% of its life in rest state and some in working state in a well defined area of the desk and make some excursions. Nice large items to hidden charge loops in, and never forget to plug it up and be dead in the water. Also it will give you some more excuses about workstation ocd. “Are you sighting the side of your keyboard to line up with your monitor? Yes it gets the most charge effciency that way.”

    1. I’ve done Qi charging DIYs before. what you could do is to embed 2 or 3 coil units in the keyboard and diode parallel them since they are really just 5v power sources. build a base for the keyboard and align some 3 coil senders in there (amazon and ebay have diy coil kits if you don’t want to break open an existing qi base). then, stagger the alignment so that if you are off center a bit, one coil combo will engage and if you shift a bit the other way, another combo will engage. a little pricey but at least you get to be sure that you won’t be unaligned on the charger sweet spots.

      I guess an even easier method is simply have a base that fits the keyboard in a way that some plastic bit aligns with some other bit. then you’d only need the single qi pair of coils.

      btw, you can buy qi coil kits very cheaply:

      http://ecx.images-amazon.com/images/I/61StKxVF2fL._SL1200_.jpg

      not hard to open it and find the red/black wires. its JUST that simple, folks! it gives you 5v out and you can wire that to any lipo charger circuit that would take 5v from usb. consider a power mux chip if you want safety to plug in usb cables as well as the qi charger card.

      I hacked one of those cards for an arduino remote control I built and I can get away with using a fairly small lipoly battery since the remote sits in the qi cradle when its not in use.

      note that qi cards do get warm so make sure there is ventillation (holes, at least) if you embed a qi card in your project.

      1. My plan was (is…) to do it all on the BLE chip itself, using a CSR1010, which should improve battery life to the point where a CR2032 or a pair of AAAs should be more than sufficient. PS/2 decode could probably even be done on the 8051 in the CSR1010 without bothering the main processor.

  2. Just wondering…

    You know many keyboards do dual PS/2 and USB, with an “adaptor” included in the box? Almost certainly the adaptor doesn’t do much, just redirects some pins, and the keyboard chip itself decides whether to spit PS/2 or USB down the line.

    Question is, how do you make an adaptor like that? Is there a resistor value, or just redirect some pins? Like maybe +5V comes in one one line for USB mode, and another for PS/2? In fact you could reverse the voltage, and use a bridge in the keyboard to cope with that, and be able to tell from the polarity which plug was connected. That’d still leave 2 pins spare for USB or PS/2 data and clock.

    Then again that’d require spending 10p on a diode bridge. Any idea how it’s done? A bit of messing with a multimeter and an adaptor might be instructive. I ask because obviously interfacing to PS/2 is a lot easier, and it’s probable keyboards will still support it for the next few years. Could be handy for people to know.

    1. PS/2 signals are open collector/drain has pull up resistor on the pins while USB has 15K pull down resistors. I would assume that the firmware decide whether that same two pins becomes PS/2 or USB pins by looking at the voltage on them.

Leave a Reply to blCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.