How to make the Hardware ...

32 views
Skip to first unread message

J.Gluch

unread,
Feb 6, 2009, 6:35:10 PM2/6/09
to GKOS
Hello,

today I discovered the GKOS stuff. First thanks for the great idea.
Second,
I was confused by the clustered web resources - here a page, there a
wiki,
some google pages - it does not yet look very structured... But it
appears
to me that GKOS gains more interest in the last months, so lets see
how it
evolves. I'd like to participate and that is were my post really
starts:

How to built an up-to-date hardware? My Laptop does not have an serial
port
anymore, so I would like to make a USB or Bluetooth model. To attract
other
makers the design must be fairly simple and cheap. I do not spent
100USD
for a Bluetooth Microcontroller.
The cost of parts should not exceed 20USD for an USB cable version.
Lets start with a USB variant.
The device than should conect to the PC like any other USB keyboard,
standard driver of course. Is it possible?

I am no hardware freak, I can solder things together, but I have no
idea
how to design a circuit. That is where I need your help.

How about the PICs available here?

http://www.atmel.com/dyn/resources/prod_documents/doc3313.pdf
http://www.sprintek.com/products/SK5100.aspx
http://www.maxim-ic.com/appnotes10.cfm/ac_pk/14#31

I had good experience with maxim-ic, they sometimes also provide free
samples.

Next, how to programm the PIC? Is it correct to assume that the GKOS
software logic can be packed into the PIC, so that no additional
driver is
required.

Is it also possible to include a pointing device, a thumb-joystick
and
something like the mouse scroll wheel plus mouse keys ?

produkt.conrad.de/45973183/alps-stick-kontroller-rkjxp1224002.htm

Looking forward to an exiting project, and hoping for your help for
circuit
design and programming.

CU Juergen

seppo

unread,
Feb 17, 2009, 11:22:08 AM2/17/09
to GKOS
Hi Juergen,

Thanks for your interest in GKOS. What is now ready and avilable for
USB is the COM port IR solution by using a USB/Serial port adapter
cable. That is how I use my demo device.

It would be the best solution to have a USB or Bluetooth keyboard with
standard drivers.

The ultimate goal in my mind is a tiny Bluetooth keyboard (matchbox
size) that uses standard HID protocols so that it could be used for
the PC, Mobile phones and all...

It is possible to use PIC code to read the keys and the pointer
control and generate the necessary signals for transmission to the
device (PC etc). Some microcontrollers today have USB or Bluetooth
protocols integrated ar easily available so that can be done.

But we need help from people like you who can contribute to reach that
goal.

Hope to come back to this.

Welcome tho the GKOS world!
Seppo
> http://www.atmel.com/dyn/resources/prod_documents/doc3313.pdfhttp://www.sprintek.com/products/SK5100.aspxhttp://www.maxim-ic.com/appnotes10.cfm/ac_pk/14#31

jdha...@comcast.net

unread,
Feb 17, 2009, 11:53:40 AM2/17/09
to gk...@googlegroups.com
Juergen & Seppo,

I have a design that works with USB/HID.  In other words it's a driverless solution.  Plug the USB cable from my GKOS implementation into the computer and it sees it as a USB keyboard.  Thus it works anywhere a USB keyboard works.  Unfortunately I never got my design further than the breadboard (I've since got really busy with other stuff) - however it was working on the breadboard.  One strangeness that I couldn't figure out was that if I plugged the GKOS directly into the host computer's USB socket it wouldn't recognize it.  But if I plugged it in to a USB hub and then that hub into the computer it worked fine.

I also got a Bluetooth module so that I could do a Bluetooth/HID version (i.e. another driverless version that would just use BT rather than USB).  But I haven't done anything with that yet - I have two of the modules so if someone wants to buy one from me just let me know (I think I paid $40 plus s+h).

My design is based on the Arduino Nano (http://arduino.cc/) development board and a software based USB implementation (i.e. no additional USB driver chip required).  I can provide the code and schematics if you're interested.  You can build a tethered USB version for about $30 - $40 (maybe less!).  A wireless Bluetooth version would be at least twice that.  My ultimate goal was to make a BT version that was the size of a credit card.

Just before I quit the project (because of time constraints) I had obtained a cheap ($4) twelve-key numeric pad (like on a push button phone - http://www.sparkfun.com/commerce/product_info.php?products_id=8653).  I did this because I hadn't yet found a button setup that I liked the feel of.  However, it also got me thinking of how to use 12 buttons (turn the pad through 90 degrees so it's 3x4 not 4x3) to the best advantage.  On the one hand I can understand a desire to not change standard GKOS from a six key solution.  However, I wondered if there could be some form of GKOS+.  In terms of ergonomics although the typing fingers now need to move they would only be choosing between two positions so I don't think it would detract from the basic GKOS goal (I think the GKOS goal could be simplified to be: easy to type in a two handed portable way and easy to integrate with a device with a small portable device with a screen).

All the best - and good luck with the project.  Let me know if you want those files.

John H.

Robb Bates

unread,
Feb 17, 2009, 12:19:36 PM2/17/09
to GKOS
I have the skills and resources required to turn that breadboard
design into a semi-production quality device. If you want to post the
schematics and code, I can start working on that. Seppo and I
actually met in San Antonio, TX (We called it the First International
GKOS Conference!) and the idea of migrating to an Atmel device (i.e.
Arduino) came up. I'd like to see how you've implemented it.

We also talked about a 12 key GKOS-type device. When I get more time,
I'll post more of our discussions.

Robb

seppo

unread,
Feb 18, 2009, 3:18:06 AM2/18/09
to GKOS
After having been typing on GKOS for some years now, I'm not really
missing any more keys. The only case I could find it useful is to have
a parallel set of characters (1,2,3,...) on new inner keys so that it
would be 3+3 parallel sets for each hand. Moving to the inner keys
could be faster than using the SYMB modifier.

But there is also the downside: the space required would be doubled.
It the target is e.g. a thin universal GKOS of the size of half a
credit card, 12 keys might be too many. But we could keep the set
harmonized in both cases so it would not harm the 'universal typing
skills'.

In case there would be 4+4 keys altogether, the bottom keys could be
operated with pinkies to have the parallel set and upper case (left
and right pinky respectively). But there is again the size problem
arising. 3+3 seems to fit all applications quite well (small cell
phones etc).

Seppo

jdha...@comcast.net

unread,
Feb 18, 2009, 9:01:25 AM2/18/09
to gk...@googlegroups.com
Personally, I like the idea of a 3+3 parallel set for "GKOS+".  As Seppo points out this just means that on GKOS+ you don't need the SYMB modifier and it keeps GKOS and GKOS+ nicely harmonized.  It would be relatively straightforward for a user to switch between the two.

I don't see the need for 8 or 16 keys.  In my limited time with this layout I liked the fact that the thumbs and the pinkies can be quite effectively used to stablize a device with a screen with the 3+3 keyboard on the back - it makes for a very comfortable setup.  However, if one were making a portable keyboard that's not attached to the device then maybe 4+4 makes more sense.  However, that starts to get further away from GKOS.

One additional thing I could see doing with a 3x4 layout would be the ability to switch into an all numeric keypad mode for cases when the user wanted to use the keypad as a calculator, phone dialer etc. 

All of the above of course is just my 2 cents worth.  Using an Arduino it was really easy to create the hardware (and this comes from a software engineer - so you KNOW it was easy!) and the software is straightforward as well (again thanks to standing on the shoulders of the Arduino project).  So, it's easy to try out different formats and make one that suits your individual needs and preferences.

Robb - I'll dig up the software and create a simple schematic to post to the group.  Give me a couple of days and then please start bugging me for it.  If you do turn it into a semi-production quality device then sign me up for one! ;-)  Also, let me know if you want one of these BT/HID modules to tinker with.

All the best,

John H.


----- Original Message -----
From: "seppo" <seppo....@gmail.com>
To: "GKOS" <gk...@googlegroups.com>
Sent: Wednesday, February 18, 2009 3:18:06 AM GMT -05:00 US/Canada Eastern
Subject: Re: How to make the Hardware ...


seppo

unread,
Mar 10, 2009, 3:54:09 PM3/10/09
to GKOS
John H,

Did you manage to dig up the software and schematic? It would be
interesting to study your implementation of GKOS.

Regards,
Seppo

jdha...@comcast.net

unread,
Mar 11, 2009, 9:24:22 AM3/11/09
to gk...@googlegroups.com
Hi Seppo,

Attached is my code.  As far as the hardware is concerned I just wired six pushbuttons to Arduino digital inputs 7 through 12 via pullup resistors (I also put in six LEDs that lit up with each key).  The USB connection was made by stripping one end off of a USB cable and then using the diagram that can be found here: http://code.rancidbacon.com/ProjectLogArduinoUSB (you'll also need to grab the USBKeyboard.c & .h from here as well).

It's not a complete implementation - you can only type lower case and you can only do numbers.  But as a proof of concept it does everything it needs to do - the rest is just a bit more software ;-)

I never got around to trying the twelve key number pad.  And, as discussed the best approach is probably a bluetooth interface - but then you've got to mess with batteries and power management and all that jazz.  The direct attached USB was surprisingly simple (thanks to the previous hardwork of others!)

BTW, I never got the USB to work correctly when connected directly to a PC - however, when I connected a hub in-between then things worked fine.

Hope you find it helpful,
John H.

Here's the code:

/*
  Six button USB HID Keyboard based on the hard work of others:
 
  -- GKOS - Global Keyboard Open Standard see http://www.gkos.com by Seppo Tiainen
  -- UsbKeyboard - USB HID driver for Arduino see http://code.rancidbacon.com/ProjectLogArduinoUSB by "Rancid Bacon"
  -- AVR/USB - AVR/USB HID driver for ATMega see http://www.obdev.at/products/avrusb/index.html by Objective Development
  -- Arduino see http://arduino.cc
 
  Many thanks to all of the above folks.
 
  This implementation by John Harding, Harding Technology Ventures, LLC see http://www.htvllc.com/cckb
 
  NOTE: this is an incomplete WIP.
 
  */

// 3rd party implementation of a software based USB HID keyboard
#include "UsbKeyboard.h"

// Define MYDEBUG to output ASCII to the serial console rather than USB keycodes over the USB interface
#undef MYDEBUG
#include "MyDebug.h"

// I was experimenting with Normally Open and Normally Closed switches
#define BUTTON_PRESSED          0   // 0 for NO switches; 1 for NC switches
#define DEBOUNCE_TIME          20   // Debounces individual button inputs (in msec)
#define LOCKOUT_TIME          200   // Time to wait before considering a chord pressed
#define FIRST_BUTTON            7   // the first button is wired to Arduino input 7 (the next to 8, then 9, 10, 11 & 12)
#define LED_PIN                13   // the LED on the Arduino is always on pin 13

// !!!JDH!!! TODO - move chord mappings to PROGMEM
#ifdef MYDEBUG
byte alphaChords[] = {0,
   'a','b','o','c', 0 ,'s', 8 ,'d', 0 ,'.', //10
   'p','?', 0 ,'t', 0 ,'e','_', 0 ,'q',',',  //20
   '.','u', 0 ,'g','h','i', 0 ,'j', 0 ,'´',  //30
    13,'f','~',':','r', 0 , 0 ,'v', 0 ,'w',  //40
   'x','y', 0 ,'z', 0 , 0 , 0 ,'k','l','m',  //50
   '`','n','|', 0 , 0 ,' ', 0 , 0 , 0 , 0 ,  //60
   0,0,0};

byte numericChords[] = {0,
   '1','2','+','3',')','*', 8 ,'4', 0 ,'.', //10
   '%','?',']', 0 , 0 ,'5','-', 0 ,'=',',', //20
   '>','$', 0 ,'0','7','8', 0 ,'9', 0 ,'/', //30
    10 ,'6','?','.','^', 0 ,'}','£', 0 ,'(',//40
   '[','<', 0 ,'{', 0 , 0 , 0 ,'#','½','&', //50
  '\\','@', 0 , 0 , 0 ,' ', 0 , 0 , 0 , 0 , //60
  0,0,0};
#else
byte alphaChords[] = {0,
   4,  5, 18,  6,  0, 22, 42,  7,  0, 55,
  19,156,  0, 23,  0,  8,145,  0, 20, 54,
   0, 24,  0, 10, 11, 12,  0, 13,  0,  0,
   0,  9,153,151, 21,  0,  0, 25,  0, 26,
  27, 28,  0, 29,  0,  0,  0, 14, 15, 16,
  53, 17,149,  0,  0, 44,  0,  0, 40,  0,
   0,  0,  0};
byte numericChords[] = {0,
  30, 31,146, 32,139,137, 42, 33,  0, 55,
 134,156, 48,  0,  0, 34, 45,  0, 46, 54,
 155,133,  0, 39, 36, 37,  0, 38,  0, 56,
   0, 35,156, 55,135,  0,148,  0,  0,138,
  47,154,  0,147,  0,  0,  0,132,  0,136,
  49,131,  0,  0,  0, 44,  0,  0, 40,  0,
   0,  0,  0};
#endif


#define ABC123  63
#define SHIFT   18
byte controlChords[] = {ABC123,SHIFT, 0};

byte  current = 0;                      // the current keychord
byte  previous = 1;                     // the previous keychord
byte  chord = 0;                        // the chord to be processed
byte  keyModifier = 0;                  // NYI, will track the state of the shift and control keys
byte* pCurrentChords = alphaChords;     // the currently selected chordset (alphas or numerics)
unsigned long lockoutStart = 0;         // lockout timer for detecting complete chords


// reads in the individual button states and puts them in a single bytes (top two bits are always zero)
byte readKeyStatesRAW() { 
  // read all keys into a single byte
  byte result = 0;
  for (int i=0; i<6; i++)
    if (digitalRead(i+FIRST_BUTTON) == BUTTON_PRESSED)
      result = result | (1<<i);
  return result;
}

// debounces the button states
byte readKeyStates() {
  byte raw1 = readKeyStatesRAW();
  delay( DEBOUNCE_TIME );
  byte raw2 = readKeyStatesRAW();
  raw1 == raw2 ? raw1 : previous;
}

// checks for a key being released
bool isKeyUpEvent() {
  byte mask = 0;
  for (int i=0; i<6; i++) {
    mask = 1 << i;
    if ( (previous & mask) && !(current & mask) ) {
      // button was down and is now up
      return true;
    }
  }
  return false;
}

// checks to see if the chord just entered is a control chord
bool isControlChord() {
  int i=0;
  while (controlChords[i]!=0) {
    if (controlChords[i] == chord) {
      return true;
    }
    i++;
  }
  return false;
}

// process control chord (swiches between alphas and numerics)
void processControlChord() {
  switch (chord) {
    case ABC123:
       dbgln("\nChanging Modes");
       if (pCurrentChords == alphaChords)
         pCurrentChords = numericChords;
       else
         pCurrentChords = alphaChords;
       break;
    case SHIFT:
      break;
  }
}

// process the just entered chord
void processChord() {
  if (isControlChord())
    // if it's a control chord then we don't send anything down the wire
    // we just change the state of the keyboard itself
    processControlChord();
  else {
    // for a normal chord lookup the chord value in the currently active
    // array of USB keycodes and send it down the wire. 
    byte key = pCurrentChords[chord];
    if (key==0) return;
#ifndef MYDEBUG
    if (key > 100)
      // For USB keycodes that require a SHIFT (such as a ?) these USB codes
      // are shifted up by 100 so we shift them back down by 100 and send the
      // MOD_SHIFT_LEFT modifier
      UsbKeyboard.sendKeyStroke(key-100, MOD_SHIFT_LEFT);
    else
      UsbKeyboard.sendKeyStroke(key, keyModifier);
#else
    char k[] = {0,0};
    k[0] = key;
    /*
    dbg(chord, DEC);
    dbg(" : " );
    dbg(chord, BIN);
    dbg(" : " );
    */
    dbg(k);
#endif
  }
}

// checks whether the chord has been held down for at least
// LOCKOUT_TIME msecs
bool ready() {
  return (lockoutStart + LOCKOUT_TIME < millis());
}


//////////////////////////////////////////////////////////////////////////////
// START HERE
//////////////////////////////////////////////////////////////////////////////

// Standard Arduino initialization routine
void setup() {
#ifdef MYDEBUG
  turnOnMyDebug(9600);
#endif   
  // set up pins D12 thru D7 as our six buttons
  for (int i=FIRST_BUTTON; i<FIRST_BUTTON+6; i++) {
    pinMode(i, INPUT);      // make it an input
    digitalWrite(i, HIGH);  // turn on the internal pullup resistor
  }
  // set up pin D13 as output (LED)
  pinMode(LED_PIN, OUTPUT);
}

// Standard Arduino program loop
void loop(){
#ifndef MYDEBUG
    UsbKeyboard.update();
#endif
  current = readKeyStates();
  if (current != previous && ready() && isKeyUpEvent()) {
    lockoutStart = millis();
    chord = previous;
    processChord();
  }
  previous = current;

}

----- Original Message -----
From: "seppo" <seppo....@gmail.com>
To: "GKOS" <gk...@googlegroups.com>

J.Gluch

unread,
Mar 11, 2009, 4:45:16 PM3/11/09
to GKOS
Very impressive, thanks for the effort to put all together here.
I did not start hardware work on my project, but it will be a one-hand
design like the chordite (see blog.russnelson.com/chordite/).

Juergen

-----------------------------

jdhard...@comcast.net schrieb:

seppo

unread,
Mar 12, 2009, 8:41:00 AM3/12/09
to GKOS
Juergen,

Any reason you need a one-hand keyboard?

Ref.
http://koti.mbnet.fi/gkos/gkoscom/universal_sixback/gkos_sixback_universal.html
http://koti.mbnet.fi/gkos/gkoscom/disadvantage_of_gkos.html

Seppo


On Mar 11, 10:45 pm, "J.Gluch" <juergen.gl...@gmx.de> wrote:
> Very impressive, thanks for the effort to put all together here.
> I did not start hardware work on my project, but it will be a one-hand
> design like the chordite (see blog.russnelson.com/chordite/).
>
> Juergen
>
> -----------------------------
>
> jdhard...@comcast.net schrieb:
>
> > Hi Seppo,
>
> > Attached is my code. As far as the hardware is concerned I just wired six pushbuttons to Arduino digital inputs 7 through 12 via pullup resistors (I also put in six LEDs that lit up with each key). The USB connection was made by stripping one end off of a USB cable and then using the diagram that can be found here:http://code.rancidbacon.com/ProjectLogArduinoUSB(you'll also need to grab the USBKeyboard.c & .h from here as well).
>
> > It's not a complete implementation - you can only type lower case and you can only do numbers. But as a proof of concept it does everything it needs to do - the rest is just a bit more software ;-)
>
> > I never got around to trying the twelve key number pad. And, as discussed the best approach is probably a bluetooth interface - but then you've got to mess with batteries and power management and all that jazz. The direct attached USB was surprisingly simple (thanks to the previous hardwork of others!)
>
> > BTW, I never got the USB to work correctly when connected directly to a PC - however, when I connected a hub in-between then things worked fine.
>
> > Hope you find it helpful,
> > John H.
>
> > Here's the code:
>
> > /*
> > Six button USB HID Keyboard based on the hard work of others:
>
> > -- GKOS - Global Keyboard Open Standard seehttp://www.gkos.comby Seppo Tiainen
> > -- UsbKeyboard - USB HID driver for Arduino seehttp://code.rancidbacon.com/ProjectLogArduinoUSBby "Rancid Bacon"
> > -- AVR/USB - AVR/USB HID driver for ATMega seehttp://www.obdev.at/products/avrusb/index.htmlby Objective Development
> > -- Arduino seehttp://arduino.cc
>
> > Many thanks to all of the above folks.
>
> > This implementation by John Harding, Harding Technology Ventures, LLC seehttp://www.htvllc.com/cckb
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages