Bluetooth mod for HHKB

User avatar
Muirium
µ

01 Oct 2013, 11:01

Right enough, they don't mention anything at all about rollover. Ominous!

User avatar
cookie

01 Oct 2013, 11:59

This thing looks interesting, but is a rollover realy that neccessary?
As long as the modifyers don't ghost I wouldn't care much about rollover for a BT keyboard.

User avatar
Muirium
µ

01 Oct 2013, 13:32

That's the thing: maybe the modifiers are ghosted and you can't even press Shift+1 to get !

Seems to be a very simple solution indeed, quite possibly not for real keyboards at all but a way to receive input from other sensors.

User avatar
cookie

01 Oct 2013, 15:51

I think it is worth a try!
If you can trust the product description it seems possible to write your own code on that thing.
Maybe you can connect the pbc or wires directly to this and write your own matrix (Similar to teensy)?

nourathar

01 Oct 2013, 20:11

Hi,

i'm fairly new to this and I have to read up on keycodes and rollover to know better what i'm talking about, but from the product description I gather that:
- it has a couple of digital inputs that can be mapped to certain keys: very limited indeed
- it has a serial port via a pair of tx/rx pins through which you can send any keycode, which made me think that in combination with some kind of producer of serial codes (which is what I think Soarer's converter is ?), this would potentially make a bluetooth board.

see here:
http://learn.adafruit.com/introducing-b ... via-serial

How I understand it is that the list of keycodes they give is an example, there is nothing on that page that indicates only these codes can be sent (and to my unschooled eye it seems pretty exhaustive ?).

The reason I can not comment further on how this works with rollover etc is that I have not yet read/understood what the difference is between keypress and keyrelease events in terms of what bits or bytes get sent through the wire or air. But from the point of view of the adafruit people, I would see no reason whatsoever to limit that serial port in any way ?

hasu mentioned some other modules which I'll check out..
But I understand this is not a very common mod ?

ciao,

J.

User avatar
Muirium
µ

01 Oct 2013, 20:56

Soarer's converter, and Hasu's firmware for custom keyboard controllers, sends out USB data in the form of the USB HID specification. I don't understand the details either, but essentially there's a lot of difference between a simple serial stream of characters and the way USB actually represents keyboard state. Soarer devised an advanced system (he calls the bitmap method) to achieve full NKRO over USB, which is awesome. But even standard 6kro over USB is quite different to what this board seems to support.

Anyway, we're getting more Bluetooth hardware to play with all the time. Good news! This particular one probably isn't intended for us, but should be a sweet entry level for people up to whole different stuff. The more the merrier.

User avatar
ne0phyte
Toast.

01 Oct 2013, 22:17

Maybe it is easier to send the raw usb hid keycodes (or the whole keyboard state) and have the controller on the other end do the keycode -> usb communication?
Without using a specialized controller but with 2 Teensies or maybe just a smaller ATmega on the keyboard side and a Teensy on the receiving end.

nourathar

01 Oct 2013, 22:22

aha, I get an idea of the complications :roll: :oops: :roll: ; I guess I was hoping too much for things to be simple !

hmm, but when i look at this page it does actually seem to say 6kro without using that term:
You can have up to 6 switches pressed at once and it will be like they were pressed all at the same time. 6 is a strict limit of Bluetooth.
that is mentioned at the start of the explanations:

http://learn.adafruit.com/introducing-b ... ser-manual

so that is interesting ?

I was reading this to understand how press and release events work:
http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html

and I while I do understand that Hasu and Soarer have been doing very advanced work, to me it still seems this simpler device could work with a controller of sorts that would generate the appropriate key codes ?
where would this fail ? It could ofcourse be the Ada people implemented 6kro for the direct inputs and not for the serial input, since that is so much more complicated ?

I'm very tempted to give it a go and see if I can send press as well as release codes via the serial input of this thing...

ciao,

J.

User avatar
hasu

01 Oct 2013, 23:33

I was concerning about how it sends a report when two keys are hold down.
For example, when you want to move to top right a bit in action game, you will press down UP and RIGHT keys and then release them. In this case key events could be like: UP[press], RIGHT[press], RIGHT[release] and UP[release].

How can we send these via Serial of the Adafruit module?
This code is not enough to represent the key event sequence above. I guess this will register UP[press], UP[release], RIGHT[press] and RIGHT[release].

Code: Select all

BT.write(UP Arrow);
BT.write(RIGHT Arrow);

User avatar
Muirium
µ

02 Oct 2013, 02:03

Something worth a look / stripdown:

http://handheldsci.com/kb

I read about this some months ago (and mentioned it on page 1 of this thread) but still haven't investigated further. Looks like a way to get the components, already programmed too. Just in a bulky package.

User avatar
matt3o
-[°_°]-

02 Oct 2013, 08:18

Muirium wrote:Something worth a look / stripdown:

http://handheldsci.com/kb

I read about this some months ago (and mentioned it on page 1 of this thread) but still haven't investigated further. Looks like a way to get the components, already programmed too. Just in a bulky package.
I think I saw it mentioned a couple of times here and on GH. I can't tell it's a discreete solution :)

http://geekhack.org/index.php?topic=43173.0;nowap

they need serious miniaturization

nourathar

02 Oct 2013, 09:25

Hi,

was reading a bit more and looking at their remapping code, and you guys are right: the Adafruit device does not implement any roll-over; what they mean on the page I quoted earlier is that you can associate keypress-combinations of up to 6 keys to any of the digital inputs.

Which still doesn't explain what is going on with their serial, but it doesn't look too promising...
I might be ordering from them soon anyway and then I'll pick up one of these and give it a try...

ciao,

J.

User avatar
matt3o
-[°_°]-

02 Oct 2013, 10:03

keep us posted!

User avatar
cookie

02 Oct 2013, 11:56

I was reading a little bit through the adafruit documentation and I must say it is relly well written and pictured!
I will definately buy one and give it a try!

6kro is totally enough for me and the usual business, even for some gaming this shouldn't cause problems.
If it is possible to set a function key without sending a signal (A internal function key) you are pretty much good to go and build a wireless BT 60% board :D

I have some cherry stuff around to start such a project!

User avatar
Muirium
µ

02 Oct 2013, 12:20

Yes, I like how learner-friendly Ada's stuff is. If you get a functional Bluetooth keyboard out of it, let us know the details!

6KRO is indeed no problem in reality. (I like watching NKRO in action with my IBM Model F and Soarer's converter, but I can't even think of a practical use for it where 6KRO wouldn't do.) And this board does support standard rollover via Bluetooth. The trouble is the input side. It doesn't take a matrix (like a Teensy) and its serial mode might not do any rollover at all.

Could be a good idea to ask them. They're learner-friendly. You might get a good answer to a good clear question: is this thing any good for making real keyboards?

User avatar
cookie

02 Oct 2013, 13:03

It's currently out of stock but I will order one asap!

How you mean it doesn't take a matrix? I didn't get through all the documentation but from the first impression I got this thing looks like a "Bluetooth Teensy".

User avatar
Muirium
µ

02 Oct 2013, 13:33

A matrix is two dimensional: an x-y grid. You use some pins for rows and other pins for columns. Then you "strobe" along one axis and "sense" on the other. You're actively scanning the whole keyboard that way, using far less pins than you have switches.

This one supports one pin: one switch, so you'd run out very quick indeed.

User avatar
ne0phyte
Toast.

02 Oct 2013, 13:55

You can send ASCII characters via serial.
http://learn.adafruit.com/introducing-b ... via-serial

BUT it looks like it only takes ASCII, not USB keycodes which makes it pretty much unusable since your OS should take care of the keycode->symbol mapping. Ada seems to hide that part for convenience at the cost of flexibility :/

User avatar
cookie

02 Oct 2013, 14:49

I have the hope that this behaviour is programmable, otherwise you need a Teensy infront of this like Neo said. But this is overkil for my taste. I will ask them directly.

I could imagine that you have the possibility to programm your own matrix but due to simplicity they programmed it like this by default so that anyone could use it simply without detailed knowledge about how a keyboard matrix actually works.

I need to try this out, it is so promising for me :(

User avatar
Muirium
µ

02 Oct 2013, 18:26

Let's see how they respond to your feedback. If you happen to convince Ada that DT users alone would buy dozens of "Bluetooth Teensies" the moment we hear they exist, the better the chances that they actually make one. We aren't the most demanding users in the world, as we basically all want the same thing: scan a matrix, (play with layers) and send the result as HID codes over Bluetooth.

One of the best things about this board is how forgiving it is about voltage. You don't have to carefully control a battery's output just to please it. Ada seems to have 2/3 of our solution already!

User avatar
ne0phyte
Toast.

02 Oct 2013, 18:33

Indeed. I would take at least 2-3 :D

User avatar
justcallmecrash

18 Jun 2014, 10:31

Forgive me resurrecting this zombie thread, but I have one of these EZ-key units on the way (before I read all this *sigh*) and was wondering if anyone has gotten any further with it. Maybe written a replacement firmware?

User avatar
cookie

18 Jun 2014, 10:46

Nono I think it's fine to ask here, I haven't had the time to try this out myself and to be hones I was to busy to ask them.

But if you have already one on your way, you could try it out yourself and share the results with us here!

User avatar
matt3o
-[°_°]-

18 Jun 2014, 11:05

now that I have a deeper understanding of capacitive switches I doubt a wireless version is even possible (or at least practical). You have to constantly drive 5v and 3v on the circuit to check the voltage differential. To get satisfactory battery life we would need to re-engineer the circuitry (I dunno maybe switching from 5/3v to 1.5/3v but I don't know if and how that would be possible).

User avatar
cookie

18 Jun 2014, 13:40

Verry good point! I absolutely forgott about this point :(

Sadly that means that ths thing will suck out the battery pretty fast, a other way to go would be a custom cherry board with HHKB Layout.

User avatar
Muirium
µ

18 Jun 2014, 13:59

My guess is that a controller designed around power saving (with aggressive sleep modes, like Kile's) could make wireless capsense a reality. NKRO diode matrices draw power every time you scan them, too. The art is in slowing down those scans, until you find you need them.

Of course, I don't know much about how well a capacitative matrix handles power up and down. Soarer's documentation for his (non-capsense) controller explains there's a lot of waiting around for things to level — even in a simple diode matrix, and on every single probe — without sleep even being involved. Maybe capsense is like that, too, and the nature of a matrix is to be constantly waking and sleeping in series?

User avatar
matt3o
-[°_°]-

18 Jun 2014, 14:58

the core factor here is "5v". Remove that from the equation and I'm pretty sure you can reach decent battery life.

User avatar
Muirium
µ

19 Jun 2014, 12:38

Talking this through with Xwhatsit, who knows a thing or two about capacitative sensing, he doesn't reckon there's a fundamental problem between us and a capsense wireless board with good battery life:
Xwhatsit wrote:It's not necessarily terrible. My implementation wasn't specifically designed to run off a battery, so won't be particularly power efficient (I was more concerned about stuff on the 10mA scale rather than down to saving a few µA). That said, it won't be too bad. There will be a milliamp wasted here and there in voltage dividers; however the DAC should be pretty power efficient. My choice of the cheap and available LM339 as the analogue comparator isn't ideal; it's a very old-school part and isn't particularly efficient by today's standards.

The two main issues around power consumption of capsense vs ohmic are:
  • Charging and discharging the caps uses more power than just hooking an output straight to an input (which will be really high impedence)
  • The analogue stuff will necessarily use a bit of juice
I'm confident that with some careful design, both of those things could be managed to a level where you could pretty much ignore the slight extra bit of power. Clearly on a board where you're that worried about power consumption, whether ohmic or capacitive you're going to have to eliminate all of your Lock LEDs as that will suck an order of magnitude more power than anything else :D (each LED will use between 5 and 20mA).

Charging/discharging of caps—they're only a few pF, many of the matrix designs I've seen for ohmic keyboards would have more than that in parasitic capacitance between traces;

Analogues—if you pay a bit more and choose carefully, there's a wealth of low-power analogue DACs and comparators these days.

All that being said, I see HHKB in the title, and I will guess that the creators of that 30-gram-keyboard-snack didn't put too much design (or BOM cost) into keeping power consumption down. There will be, like with my controller, careless milliamps wasted here and there.

In terms of firmware—my firmware already spends a lot of time sleeping (between columns); it could easily be redesigned to properly sleep in a low-power state instead of busy-waiting like it does currently. Variable polling rate would potentially save a tiny bit of power. I agree that having diodes in a matrix would suck way more juice than anything else discussed here (0.6V drop with a non-Schottky, even at a few µA that's still way more power than charging/discharging a few pF). There's no reason (with my design at least, I don't know how Topre scan) why you need to scan more frequently or more regularly with a capsense board, although it does make debouncing easier and faster.
So, how does the HHKB's controller attach to the PCB? If it's a removable module, like so many of IBM's capsense boards, we could be onto something. If it's not, well, we'd have to make a whole PCB. Not too difficult, nowadays; I asked!

User avatar
matt3o
-[°_°]-

19 Jun 2014, 12:40

the main controller is on a daughter board, but all the capacitive sensing circuitry is on the main PCB.

User avatar
Muirium
µ

19 Jun 2014, 12:44

According to my understanding from what Xwhatsit said, the controller is the wasteful part. The actual sensing should be inherently power efficient, if driven more intelligently by a better controller.

His IBM controllers are full replacements, which is something the HHKB's split design won't allow without also replacing the whole sensing PCB. But perhaps we're on to something.

Post Reply

Return to “Workshop”