• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

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

Joined
Sep 11, 2020
Messages
225 (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.
 
Joined
Dec 25, 2020
Messages
8,110 (5.20/day)
Location
São Paulo, Brazil
System Name "Icy Resurrection"
Processor 13th Gen Intel Core i9-13900KS
Motherboard ASUS ROG Maximus Z790 Apex Encore
Cooling Noctua NH-D15S upgraded with 2x NF-F12 iPPC-3000 fans and Honeywell PTM7950 TIM
Memory 32 GB G.SKILL Trident Z5 RGB F5-6800J3445G16GX2-TZ5RK @ 7600 MT/s 36-44-44-52-96 1.4V
Video Card(s) NVIDIA RTX A2000 (5090 shipping to me soon™)
Storage 500 GB WD Black SN750 SE NVMe SSD + 4 TB WD Red Plus WD40EFPX HDD
Display(s) 55-inch LG G3 OLED
Case Pichau Mancer CV500 White Edition
Audio Device(s) Sony MDR-V7 connected through Apple USB-C
Power Supply EVGA 1300 G2 1.3kW 80+ Gold
Mouse Microsoft Classic IntelliMouse (2017)
Keyboard IBM Model M type 1391405
Software Windows 10 Pro 22H2
Benchmark Scores I pulled a Qiqi~
Isn't this achievable with an Arduino or similar microcontroller board capable of acting as an USB host?
 

silentbogo

Moderator
Staff member
Joined
Nov 20, 2013
Messages
5,647 (1.36/day)
Location
Kyiv, Ukraine
System Name WS#1337
Processor Ryzen 7 5700X3D
Motherboard ASUS X570-PLUS TUF Gaming
Cooling Xigmatek Scylla 240mm AIO
Memory 64GB DDR4-3600(4x16)
Video Card(s) MSI RTX 3070 Gaming X Trio
Storage ADATA Legend 2TB
Display(s) Samsung Viewfinity Ultra S6 (34" UW)
Case ghetto CM Cosmos RC-1000
Audio Device(s) ALC1220
Power Supply SeaSonic SSR-550FX (80+ GOLD)
Mouse Logitech G603
Keyboard Modecom Volcano Blade (Kailh choc LP)
VR HMD Google dreamview headset(aka fancy cardboard)
Software Windows 11, Ubuntu 24.04 LTS
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.
 
Joined
Aug 19, 2024
Messages
629 (2.78/day)
Location
Texas, USA
System Name Obliterator
Processor Ryzen 7 7700x PBO
Motherboard ASRock x670e Steel Legend
Cooling Noctua NH-D15 G2 LBC
Memory G.skill Trident Z5 Neo 6000@CL30
Video Card(s) ASRock rx7900 GRE Steel Legend
Storage 2 x 2TB Samsung 990 pro nmve ssd 2 X 4TB Samsung 870 evo sata ssd 1 X 18TB WD Gold sata hdd
Display(s) LG 27GN750-B
Case Fractal Torrent
Audio Device(s) Klipsch promedia heritage 2.1
Power Supply FSP Hydro TI 1000w
Mouse SteelSeries Prime+
Keyboard Lenovo SK-8825 (L)
Software Windows 10 Enterprise LTSC 21H2 / Windows 11 Enterprise LTSC 24H2 with multiple flavors of VM
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:
Joined
Sep 11, 2020
Messages
225 (0.14/day)
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.
 
Joined
Jul 22, 2021
Messages
6 (0.00/day)
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:
Joined
Sep 11, 2020
Messages
225 (0.14/day)
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.
 
Top