Convert Any USB Keyboard To Bluetooth

[DastardlyLabs] saw a video about converting a PS/2 keyboard to Bluetooth and realized he didn’t have any PS/2 keyboards anymore. So he pulled the same trick with a USB keyboard. Along the way, he made three videos explaining how it all works.

The project uses a stock DuinoFun USB mini host shield with a modification to allow it to work on 5V. An Arduino mini pro provides the brains. A FT-232 USB to serial board is used to program the Arduino. A standard Bluetooth module has to have HID firmware installed. [Dastardly] makes a homemade daughterboard–er, shield–to connect it to the Arduino.

The result is a nice little sandwich with a USB plug, a Bluetooth antenna, and some pins for reprogramming if necessary. Resist the urge to solder the Bluetooth board in–since it talks on the same port as the Arduino uses for programming, you’ll have to remove it before uploading new code.

If you need help reprogramming the HC-05 Bluetooth module, we’ve covered that before. This project drew inspiration from [Evan’s] similar project for PS/2 keyboards.

40 thoughts on “Convert Any USB Keyboard To Bluetooth

    1. You have a point there, building the obvious can be a challenge.
      But building to create the obsolete can be much more rewarding. There are lot’s of folks that have old equipment they want to keep alive and when the obsolete keyboard fails and can no longer be bought in modern shops or if you want a wireless keyboard on your old system… well what do we do?

      PS: I saw the USB host module. I have no experience with USB host related to microcontrollers, but is this difficult, what problems are to expected and what modules is preferred. Can anyone suggest a usefull source of information about that topic?

    2. Seems like it should be possible with off the shelf tools/hardware. If you’d like a starting point the USB Host library does have some code for speaking to Bluetooth HID devices via a usb plugged bluetooth dongle: https://github.com/felis/USB_Host_Shield_2.0#bthid-library

      You’d then need something to emulate a usb keyboard, like a Teensy maybe, then stream and/or translate the incoming BT HID payloads to something the teensy can send via it’s keyboard emulation. https://www.pjrc.com/teensy/td_keyboard.html

      Good luck!

      P.S. if you just want to eliminate bluetooth altogether you could go the hardcore route and use the teensy or a similar keyboard emulating controller to read the keyboards’ key matrix directly, bypassing the built in controller.

    3. Indeed! One reason might be to let a bluetooth keyboard work at BIOS level, before the OS’s bluetooth driver stack has been loaded. I’d be interested in seeing something like this.

      1. More the reason is, I have ideas for using some of those tiny wireless keyboard/touchpad combos that come from eBay’s HK side. You know, the “iPazzPort” ones with the touchpad off to one side and a rounded edge underneath that. I’m thinking of a portable computer, messenger bag style (meaning case with a shoulder strap), with a wrist-mounted keyboard, mouse, and possibly display. (Mind you, I’m passionately against smartphone/tablet-style onscreen keyboards. Ugh!)

        However, I refuse to clog up the airwaves around me with signals that have to traverse a distance that’s shorter than I am! (I’m 5’3″ — or 1.6m for those of you outside of the US.) There’s simply no good reason to use that sort of link over that sort of distance, and a couple of very good reasons /not/ to do it that way.

        For example… I don’t know /much/ about BT, but I assume it uses the “channel” paradigm, like WiFi does, mostly because /everything/ wireless seems to do it that way. Well… imagine any given Starbucks with a person in every chair. Each person has a smartphone or tablet, and a single BT device (headset, keyboard, etc) that they want to use with their device. Any given BT device has a range of at least 330ft (thanks, Wiki)… do the math, and no matter which way you slice it, some of those people are not going to be able to use their stuff.

        Now, of course, that’s a bit of an exaggeration — no Starbucks is going to be that full of that many people with that much tech all at once — at least, not in any /likely/ circumstance. But the point remains quite valid — just as “too many cooks spoil the broth”, too many signals spoil the air around them — and with the kind of range BT has, I’d think it unfortunately easy to get to the saturation point…

        Hence, wanting to convert a wireless keyboard (for example) to USB wired…

        Worth noting — gee, why not just plunk an Arduino Nano in there or a Teensy or whatever? First of all, touchpad mouse. Second of all, the viability of the /keyboard/ portion working that way, depends entirely on how the unit is built. If it’s a membrane keyboard like standard PC keyboards are, sure — you’ll have to wire up your own connectors, or wreck the board to make breakouts, but that’s doable. But if it’s one single PCB with integrated switch contacts and an array of metal domes (or worse, /rubber/ domes, like on your TV remote) — well, as they say where my parents grew up (upstate NJ) — fagheddaboutit.

        One thought I do have tho — would it be possible to cut the antenna traces on both keyboard and receiver and use coax (the dinky stuff, like WiFi antenna cables use — yes, that stuff /is/ coax, I’ve gotten into it before) to connect the two together directly, and have it come out working…?

        1. My observation is that the antenna pin off the soc pr module isn’t actually much worse an antenna than the one on the pcb at 2.4ghz… So you’d have to run a few hundred feet of coax to be sure you’re running over it.

          1. “…to be sure you’re running over it.”

            I don’t know what that phrase means. Are you saying I’d need a couple hundred feet of coax, minimum? That’s a lot!

          2. …actually, on second thought: that’s what shielding is for ;) Little bit o’ kitchen foil will take care of /that/ problem, right quick… yes, I know to insulate it :P

        2. Normally most Bluetooth devices use a lower power mode for a nominal range of 10m not 100m (what your “330ft” roughly convert to). It is designed as “personal area network”.
          And especially if I strap something to my wrist I would happily go some extra length to ENSURE there are no cables attached which are not absolutely necessary. This is a question of convenience. I do not want to imagine a backpack with cables dangling to such a device.
          Of course you could connect the two parts with some coax cable. For 1-2m you can use very thin coax (like 0.81mm) the attenuation is no problem.

  1. I would pay good money for a polished, consumer-ready version of this. If only to get a pair of full-size (not dumb mini) peripherals.

    Seriously. Try and find a Bluetooth keyboard with a full 104-key layout, or a full-size Bluetooth mouse. They don’t exist.

      1. Wireless or Bluetooth?
        That’s the important distinction I’m making. I have a bunch of full-size wireless mice too.

        I just don’t want a chunky dongle taking up one of my two USB ports on my Bluetooth-equipped ultra book if I can help it.

          1. I have a Logitech DiNovo keyboard, Bluetooth. Works great, although battery life isn’t stellar. That said, haven’t had any mechanical problems in over 10 years of ownership

    1. Logitech MX 5000 desktop is a wireless/bluetooth combo with the mx 1000 laser mouse. They run in both bluetooth and wireless mode. It even has a 2 way communicating keyboard. It was waaaaay far ahead of its time. Batteries for the keyboard were brutal though (AA). I’m looking to make it lithium ion to match the mouse which is already Lithium.

  2. Upgrade seems like a strong word. As far as I am personally concerned bluetooth/wireless peripherals are always a downgrade. Tho I can see the use in something like this for a device that only has the ability to interface via bluetooth, maybe an android tablet or something.

    For everything else my computer is ~3ft away and it’s chocked full of powered USB ports that remove looming dread of an impromptu “low battery”.

    1. Of course, you’re right. My impetus with this project was that my particular gaming pc was 10+ feet of cable away across the living. Extended USB cables are available, but I didn’t want that length of cable running across the floor. I have the option of mains power close to my sofa, but I’ve mostly been using the USB battery pack with the relay.

  3. Echoing the comment that I’d love this in reverse. A raspi (or similar) that can interface reliably to bluetooth then emulate HID over usb directly, so I can get into BIOS and the like reliably. I’d pay money for such a thing.

    1. Check Chinese retailers such as Aliexpress.com, and you will find that a lot of those factories turn out me-too products. The soul-crushing experience of two generations of communism and a continuing one-party state has crushed any real spirit of innovation. What one one person makes and sells, another makes and tries to sell a little cheaper.

      You see that with all the Pixie 40-meter ham transceivers at the store. Someone seems to have sold the first one with a 7.023 MHz crystal and all the copy-cats are doing the same despite the fact that in the U.S. only hams with an Extra license can use that frequency. Even marketing one for a slightly higher frequency seems too innovative. What one does, another does. You can see dozens of virtually identical products here:

      http://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20160905070524&SearchText=pixie+radio

      1. “What one one person makes and sells, another makes and tries to sell a little cheaper. ” Excuse me, but this is not communism – its how capitalism crushes innovation. Communism crushes by irrelevance of action to the income.

  4. I wonder if this would work in a different situation? I’ve got an Alphasmart Neo that emulates a USB keyboard when I want to get my writing from it onto a computer. (It emulates typing the text very quickly into a text program on the computer.) Unfortunately, that leaves users with no way to get their text directly onto a tablet or smartphone, since they only work with Bluetooth keyboards.

    https://en.wikipedia.org/wiki/AlphaSmart

  5. How would I change this into a universal Mobile Keyboard. In other words (How can i add a second bluetooth module to this). If i add a second one over the 1st one [with all the same connections], I can’t see any problems as long as i add a switch on the lines that send signals. Does this Sound Plausible?

    Input from everyone would be great.

  6. nice project, could the issue with the mouse be the dpi it is set to? could this not be resolved by using a faster atmel chip? or lowering the dpi on the mouse? dont ask me how to do it, im no expert lol just a guess lol

  7. I was wondering I have a couple of keyboards that have CAC readers on them. I really like them. As much as I like the mechanical keyboards, I have yet to see one that has the reader on it. So has anyone tried a keyboard that has a common access card reader on the keyboard.

Leave a 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.