Author |
Message |
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Wed Aug 23, 2006 6:04 pm Post subject:
footswitch for your computer |
|
|
..i'm not sure what forum this should be in....
i wanted to emulate keyboard strokes with a footswitch for some of my speech recognition clients. all of the off the shelf options seemed very expensive, and because of their versitility (can send a number of keystrokes at a time, programable), required software to run the thing. since i'm often installing in hospital environments, i wanted to avoid adding another layer of software to their systems.
since each key is just 2 wires being connected, this is quite easy to do. in the past (before usb kbds), i've added 1/4" jacks to the kbd, and used a standard "sustain" pedal to do this.
since modern windows machines can operate multiple usb kbds, there is a better solution.
surplus usb kbds are cheap and plentiful, and the kbd encoders are tiny. allelectronics has them for about $8, and the encoders have large pads to solder to. i was able to mount the entire encoder inside a sustain pedal, and wire up the switch to the f3 key contacts.
there are programable kbd encoders available, but they are expensive ($80)...and i couldn't find an encoder that was nearly as cheap as buying the kbd and stealing the guts.
i'll take some photos the next time i do this...but for those of you using laptops, this could be a real advance.
deknow |
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Aug 25, 2006 1:51 am Post subject:
|
|
|
Great idea deknow!
As it happens I'm working on stuff like that - you'll put me out of business No... just kidding, the devices we work with are a bit more specialized with dedicated software and so on.
Doing as you suggest could enable folks to build cheap custom control surfaces, transport controls and such What kind of encoder did you find inside that keyboard? Got any datasheets or did you just 'play it by ear'?
DJ
-- |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 2:40 am Post subject:
|
|
|
...no datasheets, but in this particular kbd ("cherry", which seems to be a very high quality kbd made in germany), it is easy to take apart (no screws, each key is individually mounted so they don't fall all over the floor), and has wide unmasked header contacts so it's easy to solder to (not true of every kbd).
i was able to remove the encoder board (2 torx screws), and then i used a pair of visegrips to hold the key i needed to emulate down. i was then able to use an ohm meter to find which of the 2 pins on the header were shorted together (it's worth noting here that on my fancy meter there was too much resistance in the kbd to trigger the continuty "beep").
also, using a dpdt switch (the footswitch i'm using has one inside, even though it only uses one pole), you could send key combinations (ctr v or anything else). what is most suprising is that the kbd protocall doesn't seem to be straightforward (at least the things i read made it seem that generating kbd data from a pic or basic stamp isn't as easy as one would think), and that i couldn't find cheap kbd encoders without buying a kbd. the programable encoders available (i think mostly for the casino gaming industry) are nice, but at more than 10 times the price of a kbd from all electronics (7.50), they are prohibative unless one thinks they will want differant keystrokes in the future.
mostly, i like the idea of not having to load any software (other than standard windows usb kbd drivers that load automatically without needing to go out to the net), and the high profit margin
this is as easy a diy project as you will find (especially since i found the kbd with the easy to solder to encoder), and could have all kinds of uses for anyone that does any kind of repetitive computer work.
deknow |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Fri Aug 25, 2006 5:24 am Post subject:
|
|
|
Way cool. I was thinking about doing something like this except with a old Nintendo NES controler (for Ableton clip triggering while looking cool). The bit I was woried about was figuring out the keyboard matrix.
Particularly, I ran into dealing with the keyboard in ChucK and the cursor keys (which I'd need) send out two ascii values (0 and 72 to 74 if memory serves). This would be dealt with *after* the keyboard's matrix, right?
So, basically, what we would be doing is figure out what pins of the encoder the matrix ends up at, then figure out what keys put a short over those.... So if I understand that corectly this could be done with the keyboard not even attached to the computer? Also; I'm going to need 8 or so keys, to avoid messups this would probably require diodes? _________________ Kassen |
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Aug 25, 2006 5:35 am Post subject:
|
|
|
Kassen wrote: | Particularly, I ran into dealing with the keyboard in ChucK and the cursor keys (which I'd need) send out two ascii values (0 and 72 to 74 if memory serves). This would be dealt with *after* the keyboard's matrix, right? |
If you locate the matrix x and y lines for the keys you need, the rest should happen by itself, with the correct ASCII codes being sent to the application. As you mention, you'd need a diode in series with each switch, at least if you want to be able to press several keys simultaneously without the encoder getting confused.
DJ
-- |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 6:44 am Post subject:
|
|
|
...i'm not sure i grok what you are talking about.
if there is a key for what you want to do on the kbd you are hacking (cursor keys), then you just connect the two wires that pressing that button connects. i understand that the cursor keys use control characters, but the kbd encoder attached to a kbd that has these keys handles this automatically.
if you wanted to have a pedal for windows paste (ctrl v), you could use both poles of a dpdt switch...i've done this and as i recall it works fine. if you are nervous about timing issues (the ctrl must be down before the v is pressed), you could either design some timer circut, or be quick and dirty by having 2 switches under a common actuator plate (that you step on), and have their shafts at differant heights, or put them at differant distances from the fulcrum so that one actuates before the other.
as for diodes, i didn't use any, and i don't think there are any in the kbd (although there was a voltage drop across the closed switch...enough that it didn't activate my continutiy "beep"...perhaps there are diodes built in, but i don't think so). if diodes are required, they are on the encoder board.
this whole project is both "quick and dirty" and "elegant" (imho).....anything you can press on the kbd you can wire up. and with this particular kbd, the soldering pads are big (on the last one i did, the traces were hairline, and i had to put on optivisors despite good eyesight and a history of making piccolo keywork for a living).
finding a cheap metal footpedal housing is the hard part. for the one i just built, it is only for one key, so i built it into a clamshell style "sustain" pedal....only now it has a usb connector on the end instead of the 1/4" plug.
now, if there were only something to do with the rest of the kbd instead of sending it to the landfil!
deknow |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Fri Aug 25, 2006 6:55 am Post subject:
|
|
|
DrJ;
Ok, so that's not *that* bad. Yeah, I'm going to need the diodes, it would be kind of inconvenient if hitting two buttons by accident would result in several others getting triggered with potentially anoying resuls, especially as this would be a extra controler next to more stuff. It'd suck to have to try out all posible combinations, sort out what hit would be generated and define all other shortcuts to avoid those...
Deknow;
I just need simple stuff, stuff that's already under a single button or that can be mapped to one. I don't think a KB reader will fit in a NES joypad so that'll mean using a external little box and some ten wire cable.
Just a question; don't hospitals have rather high requirements on what technology can be used? _________________ Kassen |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 7:06 am Post subject:
|
|
|
...this particular encoder is very small (2 5/8 x 1 3/8 in inches)....yet has big solder pads.
as far as hospital requirements, i'm not interfacing with mri machines or anything, just with pc's being used for speech recognition/documentation. hospital it departments are picky about stuff, which is why i didn't want to use any of the off the shelf solutions that require custom drivers...i can convince anyone that this is litterally a kbd, and if there are objections, i can always use a kbd supplied by the it dept. it does need to look like a real device (and not made of plywood).
deknow |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 7:08 am Post subject:
|
|
|
...i'm not clear why you think you need diodes. remember, pressing multiple keys on the kbd doesn't cause the problem you are describing, so why would such a footpedal do this just becasue the switches are external? again, i think this is all handled in the encoder board.
deknow |
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Fri Aug 25, 2006 7:25 am Post subject:
|
|
|
deknow wrote: | ...i'm not clear why you think you need diodes. remember, pressing multiple keys on the kbd doesn't cause the problem you are describing, so why would such a footpedal do this just becasue the switches are external? again, i think this is all handled in the encoder board.
|
Well, if you just short 2 points then all is well. If you short a few pairs of points and anyone of those is also in another pair then then this introduces a third pair which could lead to issues. I don't fully understand how those matrixes work but I always read that if you don't have diodes you get issues with multiple keys (or polyphony). those mini-kyboard modding freaks are always going on about that.
I think that normally those might be somehow build into the keyboard? DrJ?
For just one button on a otherwise unused encoder this shouldn't be a issue. _________________ Kassen |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 7:31 am Post subject:
|
|
|
...the encoder board attaches directly to the matrix traces that get connected by pressing keys. i have a feeling that the diodes are built into the encoder (either on the board, or on the chip). here are some pics...i used a bottle cap for size referance, as i figured you would be more familliar with that than a us quarter
deknow
Description: |
|
Filesize: |
70.15 KB |
Viewed: |
315 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
Description: |
|
Filesize: |
61.1 KB |
Viewed: |
318 Time(s) |
This image has been reduced to fit the page. Click on it to enlarge. |
|
|
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Fri Aug 25, 2006 7:58 am Post subject:
|
|
|
deknow wrote: | i used a bottle cap for size referance, as i figured you would be more familliar with that than a us quarter
|
Apreceated. I nominate this for the "EM international picture reference standard", CD's would also be good. I think there should still be some US quarters around here but I have no idea where those might've gone....
Anyway, I suspect the diode may need to be in the short itself, meaning that all shorted conection have their own diode but I'm realy not sure; that's just the impression I got.
Say X1 got connected to Y1, as well as Y2.
X2 would get connected to just Y1, ok?
With regular shorts, wouldn't that mean Y2 also got connected to X2 if the diodes are before instead of inside of the matrix itself? Not a issue for you at all.
I suspect some computer keyboard might take shortcuts there. In my Quake days I sometimes ran into problems when pressing more then three buttons at once... For musical keyboards it's different since we wouldn't want then to give up before ten keys were pressed at once.
If the encoder asumes such shortcuts my diodes would be completely useless (though thtey shouldn't do any harm either. I bet Jan knows, he buildlots and lots of hardware. _________________ Kassen |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 8:12 am Post subject:
|
|
|
...the keypad matrix reads about 180ohms in both polarities.
using the same digital meter (i'd prefer analog for this), i get about .7Mohms in one polarity, and open in the other. i don't think there are diodes in the kbd, everything must be handled in the encoder board. as i said, despite the low price (surplus), it seems to be the highest quality kbd i've ever taken apart.
deknow |
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Aug 25, 2006 10:34 am Post subject:
|
|
|
Kassen wrote: | I think that normally those might be somehow build into the keyboard? DrJ? |
It's a long time since I last took apart a PC keyboard, but switch matrices like this normally have diodes near the switches on the PCB. BTW, synth keyboards are also made this way. The diodes are needed to be able to correctly detect several simultaneous keypresses. The diodes (one per switch) prevents the wrong rows from affecting the wrong columns (or vice versa) as the matrix is scanned; here is a nice illustrated explanation. One can do away with the diodes, but the encoder would get confused if several keys are pressed - one possible solution to that is to do a scan and reject the result if more than one switch is closed, but this would prevent rollover from working and is clearly not an option for a polyphonic keyboard.
DJ
-- |
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 10:54 am Post subject:
|
|
|
....but ohming out the keyboard matrix (when one switch is closed) does not show a diode. i think this is a pretty high end keyboard (discontnued surplus, but high end).
deknow |
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Aug 25, 2006 11:08 am Post subject:
|
|
|
That keyboard can't do n-key rollover then; it will probably reject the scan result if many keys are held. As Kassens observation indicates, not all keyboards can handle this. Diodes cost money, and so does the PCB stuffing, so they may well be left out in cheap computer keyboards. Incidentally Cherry keyboards are not particularly high end as I remember them - but they are still useful for this type of application since the firmware in the encoder will reject scan results that is ambiguous.
DJ
-- |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri Aug 25, 2006 11:34 am Post subject:
|
|
|
DrJustice wrote: | Cherry keyboards are not particularly high end as I remember them - |
Not too expensive but still above average quality I'd say - but it's been over five years ago I had such a keyboard.
Well, Kassen I guess the Dr just answered the PM you sent me ... the thing is, this afternoon I wos working pretty hard on some key debouncing routines :D
How about this one BTW ? Humour ? _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Aug 25, 2006 12:42 pm Post subject:
|
|
|
Blue Hell wrote: | How about this one BTW ? Humour ? |
Ouch! Humor as in a bad joke then? If that's a real patent I'm ready to cry.... whaddya say Jan?
Oh, and when I think of high end keyboards, that's IBM and Tandberg of a few years back, IMHO. I have big problems finding good keyboards to suit my old school tastes these days.
DJ
-- |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri Aug 25, 2006 1:32 pm Post subject:
|
|
|
DrJustice wrote: | whaddya say Jan? :D |
Well actually the "keyboard" I was working on this afternoon would violate the patent I'm affraid .. having a plurality of keys with mechanical contacts where one side is connected to a common voltage ... the keys are door contacts really in this case, but the processor did have pins enough to not have to use multiplexing.
Or did it ? I wonder, would this still be a keyboard matrix maybe, be it a one by many thing and the scanning being realy simple, so simple even that the column can be on a fixed voltage (which could of course be supplied by a processor pin, should I file for a patent here ?)
Its pretty sad indeed, this is not a patent, its plan theft. That's why I'm not too woriied, it will not hold for a judge, not in europe, I hope ... ? _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
seraph
Editor
Joined: Jun 21, 2003 Posts: 12398 Location: Firenze, Italy
Audio files: 33
G2 patch files: 2
|
Posted: Fri Aug 25, 2006 2:02 pm Post subject:
|
|
|
deknow wrote: | I used a bottle cap for size referance, as i figured you would be more familliar with that than a us quarter
|
very thoughtful of you _________________ homepage - blog - forum - youtube
Quote: | Don't die with your music still in you - Wayne Dyer |
|
|
Back to top
|
|
|
deknow
Joined: Sep 15, 2004 Posts: 1307 Location: Leominster, MA (USA)
G2 patch files: 15
|
Posted: Fri Aug 25, 2006 6:58 pm Post subject:
|
|
|
you can see the full abstract here
...seems to me that it wouldn't hold up in court for many prior art reasons, but they seem to be restricting it to keyboard inputs, not sensors in a device, so i think you are in the clear jan .
deknow
Editor's note - I edited your post with a clickable link Seraph |
|
Back to top
|
|
|
|