• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Bluetooth to USB Conversion using a special circuit that I can create with my limited knowledge...

Joined
Sep 11, 2020
Messages
244 (0.14/day)
Hello.

I'm trying to convert a small Bluetooth keyboard to USB and I'm wondering if anyone any knowledge on the subject. If this isn't the place to ask about this, just let me know.

I know it's less practical and far more time consuming than other options, but I just want to use a small physical keyboard with any device that isn't Bluetooth capable. If this were intended for one device I'd use an adapter and move on, but I need to use it for a variety of devices on demand and most of them don't have any BT capability.

That being said, just how dumb is what I'm trying to do ? I'm not too knowledgeable with any of this yet but I've taken a look at some PCBs for the more modern BT keyboards and it looks like the signals from the key presses travel directly to the microcontroller and then out to the PCB trace antenna with seemingly no way for me to interject.

Some older BT keyboard possess a BCM2042 HID module that can be desoldered and completely removed, possibly allowing for another MCU to be soldered into its place. I could go to this route,but take in consideration that I have a limited knowledge.

The Bluetooth keyboard that I've bought is sold out everywhere. And a small keyboard like that but USB does not seem to exist at all. If you want a closer look at the keyboard I mentioned,this is :

https://lilygo.cc/products/t-keyboard

very thanks.
 
Isn't this achievable with an Arduino or similar microcontroller board capable of acting as an USB host?
 
That board uses a lower-end ESP32C3. It does not support USB HID. I don't know if that keyboard's PCB has an ESP32 module, or just the bare chip soldered onto the mainboard. If it's a mainstream module, then you may be able to find something similar, but powered by, let's say ESP32S3, which does support USB HID.
Other than that - just straight-up wire into columns and rows of the keyboard with any microcontroller that can do USB HID(like Raspberry Pi Pico or something tiny), and just translate your cols|rows to proper keycodes.
 
This is for your tablet project?

Seems like plain old RF would be a lot easier than BT.

Something like this.

https://www.adafruit.com/product/922

If nothing else, can build your own. Check out adafruit and sparkfun. They have everything one needs for diy keyboards.

Isn't this achievable with an Arduino or similar microcontroller board capable of acting as an USB host?
5302-07.jpg

https://www.adafruit.com/product/5302

indeed it is.
 
Last edited by a moderator:
This is for your tablet project?

Seems like plain old RF would be a lot easier than BT.

Something like this.

https://www.adafruit.com/product/922

If nothing else, can build your own. Check out adafruit and sparkfun. They have everything one needs for diy keyboards.


View attachment 392503
https://www.adafruit.com/product/5302

indeed it is.

Nop. In parallel I'm trying to create a mobile phone. I'm trying to understand how much difficult is to implement the circuit to convert the BT signal to USB. I confirm that I don't have electronics competence and tools. But I realized that sometime is not strictly necessary to solder anything. I see that there are connectors that can be used simply connecting and disconnecting the wires with the proper sockets. I want to understand if I can assemble the circuit that I need in the easiest way possible...I'm intrigued by the idea of using the "Adafruit KB2040 - RP2040 Kee Boar Driver",but I have no idea about how to connect it to the BT keyboard that I have already bought. Probably it goes beyond my possibitilies,but I don't want to leave any path untried...

PS : this keyboard :

https://www.adafruit.com/product/922

is not good for a mobile phone. It is too long. The form factor is not good. Thanks anyway.
 
I believe that the only way to 'convert the BT signal to USB' would be to pair it with a BT transceiver that then reaches your host device by USB - a Bluetooth dongle, basically.

The BT communications that come in and out of the radio on the MCU inside of the keyboard do so according to the distinct two-way protocol that is Bluetooth, and it's going to work differently based on the kind of relationship - the specification sets out a range of possible configurations for each 'scenario', and BT caters to many different scenarios.

What I mean is - as an example - when your keyboard pairs with a Bluetooth transceiver, they don't just greet and start speaking Bluetooth. Once they're in range and broadcasting that they're looking to pair, if they're doing so via compatible broadcast protocols then one, or both, or neither of them will present the user with the option. Some devices do a kind of dumb pairing where they'll automatically pair with any other nearby device that is also in pairing mode and of the appropriate general device type.

It only gets more convoluted as they pair and establish their various capabilities (things like frequency hopping), device class, type, how they're going to reconnect in the case of a time-out or lost connection, etc etc

The point is, while the Bluetooth HID framework does borrow a lot from (e.g. adopting a host-slave relationship in most cases) and in some respects directly mirrors USB HID (Bluetooth HID SDPs are conceptually the same as device and interface descriptors from USB HID and even use identical formatting and definitions, making the tables interchangeable), the underlying communication method of a bi-directional link between two radio transceivers is on Neptune when considered aside the earthly USB protocol - fundamentally a host-slave relationship that happens over a single two-wire data line.

I write all this mainly to illustrate that I wasn't being glib in the first line - without some absolute black magic, PhD-worthy logical/electrical simulation of BT communications, converting BT to USB basically means using a BT dongle in the normal way. (I also write it because articulating what I think I understand about this stuff helps me understand it better)

Anyway, as for a practical solution, in your shoes I would look at a QMK-based solution using a Pro Micro. Basically, you'll need to handwire each switch into a matrix of rows and columns with diodes at certain points along the signal path. Rows of switches soldered in series with diodes allows you to connect the 60-70+ keys to the controller's 17 pins electrically in a way that, once the matrix is defined in the QMK firmware, each key can be distinctly registered by the controller despite many keys sharing a pin. It sounds daunting, but all you really need to understand is that by defining this matrix and implementing diodes in the established way for QMK, you don't need a controller with 60 or more GPIO pins in order to have a keyboard with 60 keys. Thanks to stuff like QMK and all the brave keyboard hobbyists that came before us, wiring and defining a key matrix is a process that's surprisingly straight-forward, for which there are countless well-written guides available.

Here's a guide you can follow that should cover almost everything you need to know for this project: https://yarukizerogames.com/wp-content/uploads/2021/09/handwired-keyboard-guide.pdf

What isn't covered are the practical adaptations you'll need to make given the somewhat unique nature of what you're doing - rather than mounting switches into a plate and then hand-wiring the matrix to the controller, your switches are already soldered into a PCB (which you will use as a plate), you already have a case, and the terminals for your switches are likely going to be very different to standard mechanical keyboard switches.

Each switch will, I'm sure, have two terminals that you can wire up to, but without knowing/seeing the switches as they are on the board, it's impossible to say how difficult/unusual this will be to perform. If they're rubber-dome/membrane keys, then the key itself is just a silicone actuator with a conductive pad that gets pushed down to the PCB, bridging a connection between two flat terminals on the face of the PCB. In that case, you'll probably have to try to wire each key up by soldering your wires to the outer edges of each flat terminal on the PCB face in a way that doesnt interfere with the rubber-dome or its conductive pad. Dome comes down, bridges two terminals, connects your wires together - that functions electrically the same as a mechanical keyswitch.

The best-case scenario is one where the keys on the keyboard use a key/switch type that is soldered to the PCB using through-holes. The pins protruding out of the back-side of the PCB will then be your terminals for the purpose of hand-wiring.

There are other possible scenarios where your terminals will be on the face or back-side of the PCB and will be less or more accessible if at all, at the end of the day there are just so many ways to make a momentary switch - feel free to send some photos of the exposed PCB and I'll do my best to help you figure out how the keys work/how to wire to them.

Lastly (I know), because the keys are electrically connected already through the PCB, you may be in a situation where you need to rip up the traces on the board running between the keys in order for the matrix to scan and register keypresses properly in QMK. This would be a pain, but the alternative would be to forgo hand-wiring and instead reverse-engineer the existing matrix on the PCB, which could work any number of ways (including some that QMK doesn't cater to), and would probably require some truly painful solder work where you're splicing diodes into the existing circuit, by exposing and soldering to the delicate traces on the board without damaging them.

If it were me I'd go the comparatively idiot-proof route of bypassing the existing matrix circuitry altogether - put wires between the bits what need wiring together and chop wires between the bits what don't :)

Good luck!
 
Last edited:
I believe that the only way to 'convert the BT signal to USB' would be to pair it with a BT transceiver that then reaches your host device by USB - a Bluetooth dongle, basically.

The BT communications that come in and out of the radio on the MCU inside of the keyboard do so according to the distinct two-way protocol that is Bluetooth, and it's going to work differently based on the kind of relationship - the specification sets out a range of possible configurations for each 'scenario', and BT caters to many different scenarios.

What I mean is - as an example - when your keyboard pairs with a Bluetooth transceiver, they don't just greet and start speaking Bluetooth. Once they're in range and broadcasting that they're looking to pair, if they're doing so via compatible broadcast protocols then one, or both, or neither of them will present the user with the option. Some devices do a kind of dumb pairing where they'll automatically pair with any other nearby device that is also in pairing mode and of the appropriate general device type.

It only gets more convoluted as they pair and establish their various capabilities (things like frequency hopping), device class, type, how they're going to reconnect in the case of a time-out or lost connection, etc etc

The point is, while the Bluetooth HID framework does borrow a lot from (e.g. adopting a host-slave relationship in most cases) and in some respects directly mirrors USB HID (Bluetooth HID SDPs are conceptually the same as device and interface descriptors from USB HID and even use identical formatting and definitions, making the tables interchangeable), the underlying communication method of a bi-directional link between two radio transceivers is on Neptune when considered aside the earthly USB protocol - fundamentally a host-slave relationship that happens over a single two-wire data line.

I write all this mainly to illustrate that I wasn't being glib in the first line - without some absolute black magic, PhD-worthy logical/electrical simulation of BT communications, converting BT to USB basically means using a BT dongle in the normal way. (I also write it because articulating what I think I understand about this stuff helps me understand it better)

Anyway, as for a practical solution, in your shoes I would look at a QMK-based solution using a Pro Micro. Basically, you'll need to handwire each switch into a matrix of rows and columns with diodes at certain points along the signal path. Rows of switches soldered in series with diodes allows you to connect the 60-70+ keys to the controller's 17 pins electrically in a way that, once the matrix is defined in the QMK firmware, each key can be distinctly registered by the controller despite many keys sharing a pin. It sounds daunting, but all you really need to understand is that by defining this matrix and implementing diodes in the established way for QMK, you don't need a controller with 60 or more GPIO pins in order to have a keyboard with 60 keys. Thanks to stuff like QMK and all the brave keyboard hobbyists that came before us, wiring and defining a key matrix is a process that's surprisingly straight-forward, for which there are countless well-written guides available.

Here's a guide you can follow that should cover almost everything you need to know for this project: https://yarukizerogames.com/wp-content/uploads/2021/09/handwired-keyboard-guide.pdf

What isn't covered are the practical adaptations you'll need to make given the somewhat unique nature of what you're doing - rather than mounting switches into a plate and then hand-wiring the matrix to the controller, your switches are already soldered into a PCB (which you will use as a plate), you already have a case, and the terminals for your switches are likely going to be very different to standard mechanical keyboard switches.

Each switch will, I'm sure, have two terminals that you can wire up to, but without knowing/seeing the switches as they are on the board, it's impossible to say how difficult/unusual this will be to perform. If they're rubber-dome/membrane keys, then the key itself is just a silicone actuator with a conductive pad that gets pushed down to the PCB, bridging a connection between two flat terminals on the face of the PCB. In that case, you'll probably have to try to wire each key up by soldering your wires to the outer edges of each flat terminal on the PCB face in a way that doesnt interfere with the rubber-dome or its conductive pad. Dome comes down, bridges two terminals, connects your wires together - that functions electrically the same as a mechanical keyswitch.

The best-case scenario is one where the keys on the keyboard use a key/switch type that is soldered to the PCB using through-holes. The pins protruding out of the back-side of the PCB will then be your terminals for the purpose of hand-wiring.

There are other possible scenarios where your terminals will be on the face or back-side of the PCB and will be less or more accessible if at all, at the end of the day there are just so many ways to make a momentary switch - feel free to send some photos of the exposed PCB and I'll do my best to help you figure out how the keys work/how to wire to them.

Lastly (I know), because the keys are electrically connected already through the PCB, you may be in a situation where you need to rip up the traces on the board running between the keys in order for the matrix to scan and register keypresses properly in QMK. This would be a pain, but the alternative would be to forgo hand-wiring and instead reverse-engineer the existing matrix on the PCB, which could work any number of ways (including some that QMK doesn't cater to), and would probably require some truly painful solder work where you're splicing diodes into the existing circuit, by exposing and soldering to the delicate traces on the board without damaging them.

If it were me I'd go the comparatively idiot-proof route of bypassing the existing matrix circuitry altogether - put wires between the bits what need wiring together and chop wires between the bits what don't :)

Good luck!

Thanks very much for the efforts you did to explain,bro. I didn't understand very good,but I've appreciated.
 
One of the things I personally want to make is a device that can pair with any Bluetooth keyboard or mouse, recognize the information it reads as a USB standard HID, and hide the fact that it is Bluetooth from the system.

This would be one of the ways Mario wants to do it.
the circuit to convert the BT signal to USB

burntruers clearly explains the issues.
He also presents a more realistic approach, the same as the custom keyboard, of abandoning Bluetooth and physically taking over the target device and converting it to the desired USB HID behavior.

I think this is realistic, and I think I can probably do this.
(Just to clarify for Mario, this method requires soldering.)


Now, let's go back to the hard way of converting from Bluetooth to USB HID...o_O

I think it will be fine until I can get a device like Raspberry Pi PicoW to act as a Bluetooth host.

It seems that a minimum number of buttons and a small display will be needed to properly select and pair a device from the many Bluetooth devices around.
I can only imagine how it will implement general functions such as remembering devices that have been paired once, disconnecting them, and deleting registered information...

I understand that it's technically possible, but I realize that my knowledge is not up to date yet.


This is a bit off topic, but...
I'm also interested in developing a small device that can connect to any USB Audio Class compatible device or specific audio device and input/output audio from the 3.5mm line in or line out.

I want to convert my dedicated dongle headset, such as the Logitech G435, into a simple line in/out so that it can be used with any device.
With this, I could avoid the delay of Bluetooth and use it wirelessly. ;)
 
Using the Bluetooth and/or Wi-FI solution is the last resort if we put FreeBSD in the equation. Because only a small number of BT / Wi-fi / USB dongles are supported by this OS. For a more general compatibility USB is the best solution. Oh my god,I've got a new idea just right now..
 
Back
Top