Close
0%
0%

Wireless BLE Kinesis Advantage (Custom Controller)

Replaces the stock controller with an nRF52 BLE SOC and MCP23S17 io expander. BLE Kinesis with great (few months) battery life.

Similar projects worth following
Turns a Kinesis Advantage keyboard into a wireless BLE keyboard by replacing the stock controller with an Arduino running custom firmware.

Keyboard
Comes with my own settings but you can easily change it in the code to your own.
- Custom mapping
- Multiple Layers
- Layer key tap = normal key press


Running off a 3,000 Lipo:

V4 (SPI) = 100-130 days (keyboard only) & 50-70 days (with Power Button LED). Does NOT have RGB button.

V3 (SPI) = Power drain issue from serial chip. Last about 16 - 20 days.

V2 / V1 (i2c) = 25-30 days


Power States
- Keyboard Only = i2C (7mA) / SPI (2mA)
- Battery LED = 0.06mA x 4 = 0.24mA (Turns off after 3 mins)
- Power Button LED = 1ma (on whenever keyboard is on)
- Sleep = 0.05mA to 0.1mA

Other Features
- keyboard LEDs as battery-life indicator and charge status
- Sleep mode after 15 mins of idle time
- Auto wake-up on key press

I previously made my Kinesis wireless using a USB host, Adafruit's Powerboost and a nRF52 Feather but the battery life was terrible (1-2days). As soon as I finished that project, I set out to find a way to make the Kinesis wireless and have battery life that could last months. As the stock controller consumed around 26mA on idle, the controller needed to be replaced.

This is probably my 4th Arduino project, and first time routing a board, so expect it to be a little rough but it's still in development so let me know if you come across any bugs.

Boards were ordered from PCBgogo. I found their service to be great, price was reasonable, shipping and production was blazing fast. I ordered on Saturday night and by Tuesday afternoon the boards arrived in Japan. 

sch - 201.21 kB - 10/28/2018 at 06:27

See BOM
Download

brd - 103.58 kB - 10/28/2018 at 06:27

Download

kinesisBLE V2.sch

i2C / TWI

sch - 207.36 kB - 10/06/2018 at 06:39

See BOM
Download

kinesisBLE V2.brd

i2C / TWI

brd - 104.24 kB - 10/06/2018 at 06:39

Download

  • 1 × Adafruit nRF52 Feather Keyboard controller with bluetooth SOC. Link: https://www.adafruit.com/product/3406
  • 1 × MCP23S17 or MCP23017SP SPI / i2c i/o expander (not enough pins on our Arduino!)
  • 5 × 100 Ohm Resistors
  • 1 × Lipo battery Any size, just make sure the dimensions fit in the case. I used 3,000 mah. Wouldn't recommend going over 10,000 mah as charging would take a very long time.
  • 1 × 47 Ohm Resistor

View all 15 components

  • New Firmware

    Mike W06/09/2019 at 06:15 0 comments

    So after getting tired of messing around with the delay & loop count and running into latency or key chatter, I came across Matt Vilim's Kinesis Controller project. His firmware could handle multiple key state changes, where previously I was sending a HID report per state change.

    After porting his firmware the keyboard latency was fixed without incurring any key chatter.

    However, I was occasionally getting stuck keys due to debouncing. Luckily I found Stapelberg's more recent project, KinX controller and ported the debouncing algorithm and that seems to have fixed it for now.

  • Figured out source of keys getting stuck - Not the keyboard!

    Mike W05/15/2019 at 17:45 0 comments

    Turns out after creating a new board, modifying firmware & hours debugging hardware, firmware, and mac os, the issue was due to (Karabiner)[https://github.com/tekezo/Karabiner-Elements/issues/1828] and mac os clashing on keyboard control and not the Kinesis BLE's fault at all.

    I've since removed Karabiner and have fixed the issue completely.

    I suppose it wasn't a total waste of time, the debugging revealed that at the previous setting of 7ms delay, I could potentially run into key chatter if I type at upwards of what I assume to be 300wpm+ (me smashing keys as fast as I can). This is something I can't replicate at 2ms delay so I'll stick with 2ms delay and loop debouncing 3 times for now, depending on actual battery life (expecting a drop from 6 to 2+ months).

    Diving back into the firmware also let me fix a bug that resulted in inconsistent rest timer alerts.

  • Eliminate Chatter & Increase Responsiveness

    Mike W05/13/2019 at 06:07 0 comments

    Noticed that I was still getting some key chatter intermittently during intense bursts of typing (130wpm+). Which was rare but still still resulted in stuck keys.

    To fix the issue:

    - Decreased the delay from 7ms -> 4ms per loop.

    - Increased the Debouncing loop count from 2 -> 3

    Resulting in a delay per key event of...

    1 + 4 + 1 + 4  = 10ms

    Where previously it was...

    1 + 7 = 8ms

    The decrease in delay inevitably means we'll see higher power consumption but since I'm running on 6 months without a charge (4,400mA LiPo), losing a few months for more consistent performance doesn't seem like a big deal.

    Estimated increase in power consumption

    1/4 = 0.25, where previously it was 1/8 = 0.125 -> 2x more power consumption.

    3+ months of heavy usage is fine, considering I have to charge my mouse (MX Ergo) every 2 weeks!

  • V4 tested and a note on Adafruit nRF52 Arduino Board Lib Ver

    Mike W05/11/2019 at 16:31 0 comments

    Finally got around to actually building a V4 Board and it works. *master* branch requires no modifications.

    If you're building this board, note that you need the following:

    - nRF52 Feather Express (nRF52832 *not nrf52840*)

    - Install *version 0..8.6* of Adafruit nRF52 board lib for Arduino. Any later version contains API changes and a different bootloader version. So your best bet is 0.8.6.

    *Reason for building a V4*

    My previous V3 board worked flawlessly for 6 months and then decided to randomly start getting stuckkkkkkkkkkkkkkkkk keys. It was infrequent in the beginning, maybe once every 2 days but eventually turned into once every 2-3 hours. That's just  unacceptable. I would clean the PCB and that works for a while but it comes back after a few days.

    To make sure it isn't firmware related I decided to build a fresh board.

  • Newer != Better - Stick with V4 & nRF52832

    Mike W04/28/2019 at 06:38 0 comments

    Just spent 3 hours converting a V3 board to work with the new feather (nRF52840)[https://www.adafruit.com/product/4062]. The conversion worked but it was utterly pointless.

    TL;DR - Stick with V4 board + nrf52832. 840 offers no extra benefit while consuming a ton more power.

    Pin Changes

    - Physical pin location change - A6 to AREF

    - Lost a second 3.3V OUTPUT - Only get one on the 840

    - Can't seem to use designated pins for GPIO - TX/RX, SCL/SDA etc. 

    The differences was enough to require changes in the firmware as well as cutting 4-5 traces and re-wiring the board. Unfortunately after all that, we still don't get extra pins when compared to the 832 because the 840 doesn't let you use all the pins as GPIO.

    At this stage, I invested a good 2 hours of my Sunday, so I may as well finish it and see if there might be any benefits in performance / power consumption.

    nRF52840 Eats A Lot More Current

    The 832 only used about ~2.4mA when powered (ready to type). Whereas the 840 used a mind-boggling ~4.1mA. Over 70% increase in power consumption. Looking at the forums (adafruit, nordic, nrf52 github), it appears that I'm not the only one puzzled (and annoyed) by this surprise.

    In other words...

    I wasted a Sunday morning so you didn't have to. Get your hands on the (old feather)[https://www.adafruit.com/product/3406] if you're trying to build this. 

  • Battery Going on 118 Days + nrf52840 Update Coming Soon

    Mike W04/22/2019 at 10:14 0 comments

    TL;DR -- From this point forward if you are building *master* branch, use V3 board. 

    Keyboard has been working almost flawlessly for the past 6 months. Battery has exceeded expectations and currently going on 118 days since last charge. I've only plugged it in a few times (less than 10) to flash new firmware, without charging it for any extended period of time.

    No issues with key responsiveness / input delay. I can type at 120wpm without any skips. Unfortunately that's the upper limit of my typing speed so if anybody types faster, let me know!

    2 minor issues that have come up:

    • Keyboard pairing issue - Intermittently (once every 3-4 weeks) requires clearing nrf52 paired devices. I haven't had an issue with this since turning off FireVault on my mac. Nonetheless the combo key exists which makes this a 10 second process.
    • Occasionally keys get stuck - Happens maybe once every 2-3 days and I end up typing ssssssssssssssome key. Easily fixed by restarting the keyboard. I suspect it's due to my soldering or the hole in the keyboard (where the cable use to be) allowing air in.

    With those 2 issues in mind I've decided to upgrade to the recently released nrf52840 feather by Adafruit.

    nrf52840 doesn't require a separate USB serial chip so it should result in even better power consumption! This also means we get the TX/RX pins back so we get enough pins to get RGB for the power LED back!


  • 4,400 mAh Battery going on 53 days!

    Mike W02/16/2019 at 08:52 0 comments

    This is currently the longest time I've gone without a charge and so far real life battery consumption is line with expectations.

    Although the battery measurements need to be re-calibrated. Currently it shows the battery losing the first 50% in a week or so but hangs on at over 50% for over a month. But even after calibration, the measurement accuracy would be dependent on too many factors anyway (battery capacity, temperature, make etc.). So the only take-away is that the battery consumption is accurately 1-2mA during usage.

    The keyboard has been under moderate usage (8-12 hours) per day and is currently still going.

  • New Feature: Clear Bluetooth Pairing via Keycombo

    Mike W02/15/2019 at 00:28 0 comments

    Ran into connectivity issues again recently. This is the 2nd time in 4 months or so. I have a feeling it's to do with Mac OS' bluetooth not playing nicely with the nrf52 when it sleeps. But since it's such an easy fix and happens so sporadically, I'm not too inclined to investigate further.

    Anyway, as promised I just implemented a key-combo to reset bluetooth pairing:

    RIGHT SHIFT + LEFT CMD + ESC

    The keyboard LEDs should flash three times to indicate all bluetooth pairings have been cleared.

    Then just delete the keyboard from your computer's bluetooth and re-pair. 

  • New Feature: Rest Timer

    Mike W11/19/2018 at 02:06 0 comments

    A rest timer that uses the Kinesis' LED(s) to let you know when it's time to take a break. 

    You're probably here because you own a Kinesis, and you probably own a Kinesis because you've run into some strain issues due to prolonged usage of your keyboard. As much as the Kinesis helps in reducing discomfort, it doesn't alleviate the need for frequent rests in between work. I've tried several timers, phone, software, sound alerts, haptic alerts on watches, but I haven't found the perfect timer that doesn't break me out of my flow while I work.

    I wanted a timer that was:

    - Easy and quick to set up

    - Clear but unobtrusive

    - Repeats

    I've been thinking about building my own LED timer that syncs to my computer for a while, but yesterday I realized I could just build it straight into the keyboard! I've only been using this for a few hours, but this is by far my favorite feature of this firmware. I hope you guys find it useful too.

    Settings

    Everything is configured in config.h

    It's on by default but you can turn it off by commenting out

    #define REST_TIMER

    You can set how long you'd like to work continuously for until a break

    #define WORK_INTERVAL_MINS    20

    Finally,  the keyboard assumes if you've been inactive for this long, you're already on a break so it'll reset the timer

    #define WORK_TIMEOUT_MINS     5

    Manual vs Auto Breaks

    I originally had the keyboard assume we're on break if we need to take one and we were inactive for more than some time.

    #define REST_INTERVAL_SECS    60

    I realised this ended up cancelling breaks unintentionally, because believe it or not sometimes I went a whole minute without typing!  

    That kind of defeats the purpose, so the default is to now require you to manually  enter break mode by pressing a key combo.  Of course you can uncomment this to bring back auto-breaks.

    //#define REST_AUTO_BREAKS


    Manually entering break mode:

    Press DELETE + PROGM to let the keyboard know you're going on break. You can change this in the matrix of course. 

    Summing Up 

    The result of all this is a timer that is inherently always on, smart enough to track whether you need a break without knowing the time and get's out of your way when you don't want to break focus. Just look down every once in a while, and if your keyboard is blinking, take a break!

  • New Feature: Shut-down on Keypress

    Mike W11/17/2018 at 12:41 0 comments

    I already drilled a hole in my keyboard to install a power button from a previous project, but I realize some of you might be a little hesitant to do that but you still need a way to manually put your keyboard to sleep (to save power / reboot). You'd be glad to know that I just pushed a new version onto master branch for you guys.

    New Key Functions:

    - 'progm' key = shutdown (deep sleep)

    - 'keypd' = show battery level (useful if timeout has expired)

    Enjoy your super stealth Kinesis BLE! 

View all 21 project logs

  • 1
    Get the PCB made

    Eagle files attached to this project. I used PCBGogo to make mine.

  • 2
    Download Firmware

    Clone the repo, open in Arduino. Straight-forward stuff.

    https://github.com/forkeverything/KinesisBLE

  • 3
    Assemble

    I tried to label all the parts on the PCB and everything lines up so it should be pretty easy.

    If you're having trouble soldering the pins on the flex connectors, get a better iron! I upgraded to a fx-888 and my soldering time for the board went from 1 hour to about 15 mins.

View all 3 instructions

Enjoy this project?

Share

Discussions

Mike W wrote 07/23/2019 at 06:00 point

Hi, sorry for the late reply. Sure, the one I'm currently using is this one.

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

Anything around 3,000 - 4,000 mAh would be ideal in terms of charge time (6-8 hours) and usage (~ 6 months). I once tried a 20,000 mAh lipo and it took forever to charge.

Since you're new to working with batteries. Just buy pre-made ones. Do NOT join batteries together creating larger packs yourself.

  Are you sure? yes | no

David Balatero wrote 06/25/2019 at 22:29 point

Hi Mike - can you recommend a battery for this project? As someone new to ordering batteries and working with them (and not clear on the dimensions internally or any other "gotcha" specs that I might need to know about) it's really helpful to just have a sample link alongside the battery part with "you can just buy this one and it'll work pretty good." Thanks!!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates