Author Topic: keyplus: Modular wired and wireless split keyboard project  (Read 3381 times)

0 Members and 1 Guest are viewing this topic.

Offline spindle

  • Thread Starter
  • Posts: 25
keyplus: Modular wired and wireless split keyboard project
« on: Sun, 23 July 2017, 20:56:14 »
Hi, I've been working on a modular split keyboard firmware and controller. I've posted this elsewhere, but I thought it would be good to post it here as well.

The idea is you can have split keyboards connected together via I2C, and when you disconnect them you can use them as
wireless keyboards using Nordic's nRF24 receivers. You can use one keyboard as a wireless receiver connected via USB, or use an nRF24lu1+ USB dongle for a wireless only setup. Also, since logitech unifying mice also use nRF24 transceiver I've managed to add support to connect to them as well. This image demontrates the connectivitiy options:



Here's a setup I have so far that has 5 keyboard devices and a mouse all connected together. Three of the keyboards are wirelessly connected to the keyboard on the right which has the usb cable. The TRRS cable connects the two devices in the middle.



Some of the Logitech Unifying receiver dongles use the nRF24Lu1+ microcontroller and with a bit
of work I was able to reverse engineer the firmware update process to flash my code to them. So I can use my keyboards and mouse wirelessly just with a unifying dongle that is flashed with my firmware:



Hardware:
The main hardware components I'm using are:

  • ATxmega32A4U as the main usb keyboard controller connected to an nRF24L01+ for wireless communication
  • nRF24LU1+ for the wireless dongle
  • My early wireless only prototypes use ATmega8pa and nRF24L01+, but there's pretty much no reason to use them over the ATxmega32A4U.
  • cr2032, 2xAAA, or any other 3V battery for wireless operation.
Firmware:
For firmware, I've written my own that supports upto 64 keyboards that can be used in a split layout or act independently. The firmware works by transmitting the matrix state from the slave devices to the receiving device which combines the matrices together and figures out which key is pressed. This allows you to have layer keys that work across a split keyboard. The only disadvantage to this method is you need to store all the keyboard layouts on all the receiving devices, this is only a minor drawback and can actual be taken advantage of to have different layouts stored on different receivers.

Another advantage of this method is that the wireless devices use very little power because they only need to scan than matrix and transmit it. I managed to get nearly 6 months off one of my early ATmega8 based prototypes with a cr2032 battery, but of course this will all depend on how much you use it. With 2xAAA you could probably get about 2 years battery life.

I've designed the firmware such that you can configure via a USB interface, so you don't have to compile it to update your layout. Here's a configuration file (wip) for the firmware that demonstrates the basics of how the layouts are setup. I haven't released the the firmware yet because there's still a few things I need to work on.

I've also been posting updates to this project on my website: http://blog.seethis.link.

Edit: Hardware and firmware files now on github:
 
« Last Edit: Sun, 17 September 2017, 04:12:20 by spindle »

Offline Parva Ovis

  • Posts: 78
Re: Modular wired and wireless split keyboard project
« Reply #1 on: Sun, 23 July 2017, 21:17:14 »
Seeing stuff like this that improves on standard keyboard technology is always really cool. Is it possible to have two or more receivers plugged into different computers and have the keyboards switch which receiver they're connected to on the fly?

Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #2 on: Sun, 23 July 2017, 21:48:46 »
Is it possible to have two or more receivers plugged into different computers and have the keyboards switch which receiver they're connected to on the fly?

I got this feature to work: http://imgur.com/a/Cgdgs. The current implementation is a bit hacky, so it might only register the change key combination the second time it's pressed. To make it work better, I need to make the two receivers talk to each other as well, which shouldn't be too hard, I just never got around to doing it.


Offline Malachor

  • Posts: 19
Re: Modular wired and wireless split keyboard project
« Reply #3 on: Mon, 24 July 2017, 20:39:12 »
Thank you for posting this here.
I've been wanting to convert a mechanical keyboard to wireless by using a logitech control board, but this is so much better.
How would I determine which dongle has a nRF24Lu1+ microcontroller?

Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #4 on: Tue, 25 July 2017, 01:19:19 »
How would I determine which dongle has a nRF24Lu1+ microcontroller?

I pretty sure unifying receivers with firmware version 12.XX.XXXXX are nRF while 24.XX.XXXXX are TI. You can check the firmware version from the Logitech Unifying software (or solaar on linux). Also, you should be able to tell from the products S/N on the metal sheath of the USB connector, however since there's lots of different versions, I haven't got a comprehensive list yet.

When flashing the device, you can tell which chip it uses by the bootloader USB ids. The nRF24LU1+ uses "046D:AAAA", while the TI CC2544 uses "046D:AAAC". So you wouldn't end up bricking it if you have the wrong one.

Offline hanya

  • Posts: 83
  • Location: Japan
Re: Modular wired and wireless split keyboard project
« Reply #5 on: Tue, 25 July 2017, 05:01:35 »
What protocol are you using to connect between each other, Nordic Gazell? If so, you can use nRF51 Gazell with nRF24Lxx Gazell mixed since it has backward compatibility (its user guide says so).
We can obtain nRF51 module with certification easily but not for nRF24. If we can choose nRF51 modules, that makes easy to make devices.
PFU HHKB JP, Sanwa MA-TB38 trackball

Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #6 on: Tue, 25 July 2017, 07:30:01 »
What protocol are you using to connect between each other, Nordic Gazell? If so, you can use nRF51 Gazell with nRF24Lxx Gazell mixed since it has backward compatibility (its user guide says so).
We can obtain nRF51 module with certification easily but not for nRF24. If we can choose nRF51 modules, that makes easy to make devices.

Currently I don't have Gazell support, but it's something I'm planning to add. I haven't integrated it yet because Nordic's license for the Gazell SDK on the nRF24 devices is not compatible with open source licensing. However, this might change with their switch to BSD licensing. If the code in the nRF24go SDK does not end up with a BSD license, I will have to reimplement it which shouldn't be too hard as it's only a thin layer above the nRF24 protocol. I still should be able to support Logitech mice as they appear to use Gazell as well. I can currently interface with them because technically my code is a Gazell device with only one frequency in its channel table.

Another reason I want to support this is the upcoming nRF52840 which can support USB + BTLE + Gazell on one chip.

Edit: it looks like it nRF24go SDK won't be relicensed:
Quote
All new software releases developed in-house by Nordic will be released with one of the new licenses. Previously released software with “legacy” licenses will not be updated with a new license.
So I will need to reimplement it.

Edit2: After further examination the nRF51822 has a software device for Enhanched Shock Burst (the base protocol of nRF24), so it should be possible to use nRF51 modules without needing to implement Gazell. However, I will still look into implementing Gazell because frequencing hoping seems like a diserable feature. https://developer.nordicsemi.com/nRF5_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00139.html
« Last Edit: Tue, 25 July 2017, 07:45:12 by spindle »

Offline tristinDLC

  • Posts: 49
  • Location: Seattle, WA
Re: Modular wired and wireless split keyboard project
« Reply #7 on: Thu, 27 July 2017, 06:19:56 »
Wow, great project! This is something I could end up using for sure on one of my future custom builds. I had some ideas on a setup that needed similar connectivity and this project shows its potential first-hand. Not only is it a great physical build, but amazing work on the reverse engineering and custom firmware.

Hopefully by the time the nRF52840 is readily available, the BLE issues between Logitech and macOS is fixed. I'll be keeping an eye on this project for sure.

Offline le-37

  • Posts: 7
Re: Modular wired and wireless split keyboard project
« Reply #8 on: Thu, 27 July 2017, 09:43:49 »
Fantastic work. My wallet is ready when someone can implement this and sell it to me :)

Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #9 on: Mon, 14 August 2017, 16:15:01 »
I made a small controller for use with this project:


Here it is in action:



Some more pics of the build here: http://imgur.com/a/jzdZO. I hope to do a beta run of the new controller soon once I fix up a couple things with the firmware/bootloader.

Offline Malachor

  • Posts: 19
Re: Modular wired and wireless split keyboard project
« Reply #10 on: Mon, 14 August 2017, 19:42:28 »
I like the design of your case, with the holes for the switch clips.
I'm interested in a controller when it's ready.

Offline saucybulgogi

  • Posts: 11
Re: Modular wired and wireless split keyboard project
« Reply #11 on: Sat, 02 September 2017, 00:04:35 »
Any update on this project? I知  rebuilding my dactyl and would love to use some of these controllers to make it wireless. If not I値l have to go the bluefruit feather + IO expander route.


Sent from my iPhone using Tapatalk

Offline saucybulgogi

  • Posts: 11
Modular wired and wireless split keyboard project
« Reply #12 on: Sat, 02 September 2017, 00:06:08 »
Any update on this project? I知  rebuilding my dactyl and would love to use some of these controllers to make it wireless. If not I値l have to go the bluefruit feather + IO expander route.


Sent from my iPhone using Tapatalk

I知 also wondering, would your controller be able to power some RGB strips?


Sent from my iPhone using Tapatalk

Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #13 on: Sun, 03 September 2017, 08:13:49 »



Any update on this project? I知  rebuilding my dactyl and would love to use some of these controllers to make it wireless. If not I値l have to go the bluefruit feather + IO expander route.


Sent from my iPhone using Tapatalk

I've started uploading the code here: https://github.com/ahtn/keyplus. It still needs a bit of cleanup, and I need to finish the host software and layout uploading code.


I知 also wondering, would your controller be able to power some RGB strips?

Sent from my iPhone using Tapatalk

This should be possible when running from USB power with wired split over I2C. Since the xmega uses 3V logic and the RGB led strips need 5V logic signals, you need a level shifter to conver from 3V -> 5V.  On my other test PCBs I've used these as level shifters: https://www.diodes.com/assets/Datasheets/74LVC1G07.pdf to control ws2812 LEDs. I should be able to fit one on the next revision of the PCB.

I'll start working on LED support once I have the all the core firmware features working.

Offline woodkeys

  • Posts: 13
  • Location: College Station, TX
    • WoodKeys.click
Re: Modular wired and wireless split keyboard project
« Reply #14 on: Sun, 03 September 2017, 09:08:55 »
I've run the RGB strips on a 3.2v microcontroller. Shouldn't need the level converter.

Sent from my Nexus 6P using Tapatalk


Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #15 on: Sun, 03 September 2017, 17:36:54 »
I've run the RGB strips on a 3.2v microcontroller. Shouldn't need the level converter.


Based of one ws2812 datasheet, the min threshold for logic high is 0.7*VCC, so that's 3.5V @ VCC=5V. My boards would output about 2.9-3.0V, so I'm not sure if that's going to work. But since you mention it, I'll try it and see what happens.

If your board had a reverse polarity protection diode on the 5V supply, then that'd probably drop VCC to ~4.5V, which would mean V_high = 0.7*4.5 = 3.15, so maybe that's why it worked in your case.

Offline woodkeys

  • Posts: 13
  • Location: College Station, TX
    • WoodKeys.click
Re: Modular wired and wireless split keyboard project
« Reply #16 on: Sun, 03 September 2017, 17:44:44 »
I've run the RGB strips on a 3.2v microcontroller. Shouldn't need the level converter.


Based of one ws2812 datasheet, the min threshold for logic high is 0.7*VCC, so that's 3.5V @ VCC=5V. My boards would output about 2.9-3.0V, so I'm not sure if that's going to work. But since you mention it, I'll try it and see what happens.

If your board had a reverse polarity protection diode on the 5V supply, then that'd probably drop VCC to ~4.5V, which would mean V_high = 0.7*4.5 = 3.15, so maybe that's why it worked in your case.

VCC is 3.3V on my board. I haven't actually looked at the spec sheet to see what the valid range for VCC is. Threshold would be 2.3V with VCC=3.3V. As long as the 3.3V VCC is in spec it should work find, and empirically it does.

Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #17 on: Sun, 03 September 2017, 18:20:49 »

VCC is 3.3V on my board. I haven't actually looked at the spec sheet to see what the valid range for VCC is. Threshold would be 2.3V with VCC=3.3V. As long as the 3.3V VCC is in spec it should work find, and empirically it does.

When I was using VCC I was refering to the supply voltage for the ws2812 diodes. Are you saying that you are running the ws2812 from a 3.3V supply?


Offline woodkeys

  • Posts: 13
  • Location: College Station, TX
    • WoodKeys.click
Re: Modular wired and wireless split keyboard project
« Reply #18 on: Sun, 03 September 2017, 18:29:35 »
That's correct. I'm running it from the 3.3v supply on the Adafruit Feather BLE 32u4. It's running on battery so that's the only supply available.

Sent from my Nexus 6P using Tapatalk


Offline spindle

  • Thread Starter
  • Posts: 25
Re: Modular wired and wireless split keyboard project
« Reply #19 on: Sun, 17 September 2017, 03:55:21 »
Here's my new controller, the keyplus mini that I made for this project:



Also, I've now put the hardware and software files for this project up on github:


Still need to add more documentation though.

Offline rm-rf

  • Posts: 336
  • Location: Bellingham, WA
Re: Modular wired and wireless split keyboard project
« Reply #20 on: Sun, 17 September 2017, 04:14:45 »
Here's my new controller, the keyplus mini that I made for this project:

Show Image


Also, I've now put the hardware and software files for this project up on github:


Still need to add more documentation though.


damn, i like that controller.

Offline lishi

  • Posts: 157
  • Location: N O V A
  • Luxury Taste Buds
    • Personal Website
Re: keyplus: Modular wired and wireless split keyboard project
« Reply #21 on: Sun, 17 September 2017, 19:41:25 »
Absolutely stellar work spindle!!  :thumb:
Duck Viper V2 - 68g Cherry RGB Silent Red | Noxary X60 Dark Gray HHKB x2 | Revo RJ Pink + Blue Soon(TM)

Offline deprecatedcoder

  • Posts: 2
Re: keyplus: Modular wired and wireless split keyboard project
« Reply #22 on: Mon, 18 September 2017, 14:18:54 »
This is so beyond my level, but even I can see it's going to open up the possibility of some really amazing builds.  Keep up the good work!

Offline saucybulgogi

  • Posts: 11
Re: keyplus: Modular wired and wireless split keyboard project
« Reply #23 on: Sun, 15 October 2017, 10:34:59 »
Hey spindle. I just started working on getting keyplus setup on my mac and I've got some questions.

If I'm understanding this correctly, to make the keyplus mini controller work for my board I'd only need to send my layout.yaml file to the controller using the configurator correct? The built firmware on the controllers doesn't need to change?

Also, if you've got any advice on how to get the Configurator up and running I'd greatly appreciate it. Looking forward to rebuilding my dactyl with these!
Thanks!