geekhack

geekhack Projects => Making Stuff Together! => Topic started by: karakum on Thu, 07 November 2019, 06:41:29

Title: WASD keyboards custom controller: USB+BT
Post by: karakum on Thu, 07 November 2019, 06:41:29
Hi guys! I have 104-key WASD keyboard about more 3 years. And last years I can’t leave thoughts about making it Bluetooth wireless.

At beginning, I had try to make usb-2-bt converter like https://github.com/juancgarcia/HID-Relay. It worked success except that my WASD-keyboard don’t turn on leds when it was connected to usb-host. I checked my hid-relay with other USB-keyboards, they worked properly, and their leds worked. However, not with my WASD.

Then I had decide to make own custom controller. I have made reverse engineering of board wiring. Keys board has two header-connector for controller board.
[attach=1][attach=2][attach=3][attach=4]
[attachimg=5]

Totally, this keyboard has 8 rows and 18 columns. I decide to union Win_R & Win_L single columns with other. It reduce columns to 16. In addition, board has 6-key DIP-switch to configure (layouts, mode…) and 3 led.

Total 8+16+6+3=33 I/O ports. It is too much for typical Arduino/teensy boards. It can be reduce by using bi-directional multiplexor. 8 rows can be reduced by 74HC4051 to 3-bit line. 16 columns – to 4-bit line by 74HC4067.

So 3+4+6+3=16 I/O ports – it is enough to choose any arduino/teensy compatible board.

It need to say that also RX/TX lines required for communicate with rn-42(hc-05). Wireless mode can be turned on/off by one of DIP-switch or just additional switcher on keyboard’s cover.

Now I can’t choose and ask for help of community - which one of teensy-compatible board to select?
Title: Re: WASD keyboards custom controller: USB+BT
Post by: yui on Thu, 07 November 2019, 07:45:02
Teensy would be best, otherwise the pro micro has is quite popular around here and is cheaper but the bootloader is not as good and it has 1 less usable pin, there is also the goldfish project but you would need to order the boards and parts yourself and solder them and it is closer to the pro micro, just with a usb C and lower profile.
Title: Re: WASD keyboards custom controller: USB+BT
Post by: Findecanor on Thu, 07 November 2019, 09:12:19
If you want Bluetooth and USB, you could consider the Nordic nRF52840 microcontroller. It has 48 configurable GPIO pins, both USB and Bluetooth. There is a fork of QMK firmware (https://github.com/sekigon-gonnoc/qmk_firmware/tree/nrf52) for it.

However, boards suitable for hand-soldering that expose many GPIO pins are a bit more unusual.
There are those with Pro Micro pinout (https://github.com/joric/nrfmicro/wiki) and then there is the Adafruit Feather nRF52840 Express (https://www.adafruit.com/product/4062) and Sparkfun's Particle Xenon (https://www.sparkfun.com/products/15070) in feather pinout, but neither has that many pins.

However, there are tiny modules out there, that fit onto a larger circuit board, and which should expose enough GPIO pins and the USB. Those tend to not have battery charging built-in though, and you would have to design the main PCB for it yourself.

I suspect also that the WASD as-is runs on 5V from VBUS directly, and that the module would need a voltage regulator for 3.3V (or lower).
Title: Re: WASD keyboards custom controller: USB+BT
Post by: karakum on Fri, 10 July 2020, 14:41:45
I did it! :cool:

Thanks to fork of QMK firmware (https://github.com/sekigon-gonnoc/qmk_firmware/tree/nrf52) author!
Thanks to joric (https://geekhack.org/index.php?action=profile;u=47054) for great work of project (https://github.com/joric/nrfmicro/wiki)! It was my guidebook.

New features:
- Bluetooth LE & USB HID with QMK powered keyboard
- Nordic nRF52840 microcontroller
- USB Type-A & Type-C connectors
- Li-Po 250mAh Battery with power switch

Firmware source: https://github.com/karakum/qmk_firmware/tree/wasd_custom (https://github.com/karakum/qmk_firmware/tree/wasd_custom)
Schematic & pcb: https://easyeda.com/karakum/wasd-custom-controller (https://easyeda.com/karakum/wasd-custom-controller)

[attach=1][attach=2][attach=3][attach=4][attach=5][attach=6]

(two wires on pcb - temporary serial tx-gnd for debug)
Title: Re: WASD keyboards custom controller: USB+BT
Post by: Pylon on Fri, 10 July 2020, 17:47:25
Nice work!

Did you mean 2500mah for the battery? Those little blue TP4056 charging board are usually 1A charging by default. Unless you mod the current set resistor that's way too much current for charging a 250mah battery.
Title: Re: WASD keyboards custom controller: USB+BT
Post by: karakum on Sat, 11 July 2020, 01:12:32
Nice work!

Did you mean 2500mah for the battery? Those little blue TP4056 charging board are usually 1A charging by default. Unless you mod the current set resistor that's way too much current for charging a 250mah battery.
No, 250. Prog resistor in TP4056 was replaced accordingly.
Now I'm watching energy consumption. But it is very impressive. Approximately 1-2% per day. If the battery lasts for a month, then it will be more than excellent. :thumb: