keyswitches

42 views
Skip to first unread message

Noel Cragg

unread,
Feb 9, 2012, 6:36:24 PM2/9/12
to diykeyboard
Greetings, folks. Paul mentioned this group to me when I met with him
a few weeks ago. From reading the old posts, it seems that people
were trying to get in touch with me a while back -- I apologize for
the non-response, but the red-bean.com email servers went through a
long period of being blacklisted, so I didn't receive any of those
inquiries. Anyways, I've finally made it here.

Let's talk keyswitches.

0) For velocity-sensing keyboards, one sensor per key or two? One-per-
key results in a lower part count, but means that one needs to perform
ADC on each sensor in order to determine depth/rate of key travel.
Two-per key is more parts, but key scanning is more straightforward
(e.g. sensor output sent through a schmitt trigger allows one to wire
up a simple matrix keyboard). Thoughts?

1) Paul, in his patents, mentions a spring + busbar switch. I haven't
been able to find pictures of this mechanism anywhere. (Before
anybody tells me, "don't use those, they're terrible," let me assure
you that I have no intention of doing so. I'm just curious about the
relationship of the parts inside of the switch mechanism.) If I had
to guess, two arragements jump to mind.

One would be something that looked essentially like the old "j-wire"
or Pratt & Read mechanism. In that, two busbars run the length of the
keyboard (under and perpendicular to the keys, stacked one above the
other in the plane normal to the key surfaces). There's a space
between the two busbars. Each key controls the end of a wire, each of
which pass through the space beween the two busbars (each wire is
essentially parallel to the key controlling it). When the key is in
the up/rest position, the end of the wire is pulled against one
busbar. As the key is depressed, the wire is breaks contact with one
busbar and is pulled towards the other busbar. The wire contacts the
other busbar as the key reaches the end of its travel.

The other would be a captive spring in a box, along the lines of the
Cherry keyswitches that were modified to sense velocity (as mentioned
in this group some months back).

2) Photointerrupters. Reflective or not? Discuss.

3) Hall-effect sensors. The wiki page asserts that "it is a lot
harder to prevent magnetic interference between keys than it is to
prevent optical interference." That claim seems unfounded to me,
given that sensors exist with a whole range of sensitivities. Is
there a story behind the assertion?

Paul Vandervoort

unread,
Feb 10, 2012, 1:45:04 AM2/10/12
to diyke...@googlegroups.com
Comments below.

On 2/9/2012 3:36 PM, Noel Cragg wrote:
> 0) For velocity-sensing keyboards, one sensor per key or two? One-per-
> key results in a lower part count, but means that one needs to perform
> ADC on each sensor in order to determine depth/rate of key travel.
> Two-per key is more parts, but key scanning is more straightforward
> (e.g. sensor output sent through a schmitt trigger allows one to wire
> up a simple matrix keyboard). Thoughts?

I recommend one sensor per key. You can know exactly where the key is
at all times, including poly aftertouch. As I wrote on the site, I
recommend reviewing U.S. patent 5,231,283. This invention is public
domain. The shutters can be modified to provide increased modulation at
the bottom of the key stroke for reading poly aftertouch. There are
lots of microprocessors and A/D converters and microprocessors with
on-board A/D converters available which can perform the needed scanning
at the needed speed.

> 1) Paul, in his patents, mentions a spring + busbar switch. I haven't
> been able to find pictures of this mechanism anywhere. (Before
> anybody tells me, "don't use those, they're terrible," let me assure
> you that I have no intention of doing so. I'm just curious about the
> relationship of the parts inside of the switch mechanism.) If I had
> to guess, two arragements jump to mind.
>
> One would be something that looked essentially like the old "j-wire"

> or Pratt& Read mechanism. In that, two busbars run the length of the


> keyboard (under and perpendicular to the keys, stacked one above the
> other in the plane normal to the key surfaces). There's a space
> between the two busbars. Each key controls the end of a wire, each of
> which pass through the space beween the two busbars (each wire is
> essentially parallel to the key controlling it). When the key is in
> the up/rest position, the end of the wire is pulled against one
> busbar. As the key is depressed, the wire is breaks contact with one
> busbar and is pulled towards the other busbar. The wire contacts the
> other busbar as the key reaches the end of its travel.

Yes, this is what I was referring to.

> The other would be a captive spring in a box, along the lines of the
> Cherry keyswitches that were modified to sense velocity (as mentioned
> in this group some months back).

This might work too.

> 2) Photointerrupters. Reflective or not? Discuss.

I use reflective because they are smaller and cheaper.

> 3) Hall-effect sensors. The wiki page asserts that "it is a lot
> harder to prevent magnetic interference between keys than it is to
> prevent optical interference." That claim seems unfounded to me,
> given that sensors exist with a whole range of sensitivities. Is
> there a story behind the assertion?

Makes sense to me, but I don't really know. It would depend on the
mechanical design. There may be patent issues with magnetic sensors.
Also, the sensors and magnets may be expensive. They were the last time
I checked.

Paul V.

Noel Cragg

unread,
Feb 10, 2012, 3:38:17 PM2/10/12
to diyke...@googlegroups.com
> I recommend one sensor per key. You can know exactly where the key
> is at all times, including poly aftertouch.

I have a few IR sensors in the project box, so I'll give that a try.

> There are lots of microprocessors and A/D converters and
> microprocessors with on-board A/D converters available which can
> perform the needed scanning at the needed speed.

I agree that they'll support an appropriate sampling rate, but I worry
about the hysteresis in the system when performing analog muxing
between the CPU and sensors. Perhaps I shouldn't be worried?

>> 3) Hall-effect sensors. The wiki page asserts that "it is a lot
>

> Also, the sensors and magnets may be expensive. They were the last time
> I checked.

Mouser and Digi-key agree. Compared to the IR parts, the hall-effect
themselves are a bit more expensive, and those costs don't include the
required magnets...

bogru...@gmail.com

unread,
Feb 10, 2012, 5:19:26 PM2/10/12
to diyke...@googlegroups.com
Hi, I once managed to get a brief look at Paul's newfangled keys (he stopped briefly in Vancouver Airport on the return leg of a trip).

I've fiddled with keyboard construction to know that he has solved a number of problems that plague attempts to construct a 2-D array keyboard with the same "feel" as that of a Piano. (see older parts of my blog www.MusicScienceGuy.com)
I particularly like the movement and the friction-free (and nearly fool-proof) optical switches he employs.

For what it's worth I advise: don't re-invent the wheel. Paul has already solved the problems and has a working design and debugged designs are pure gold (for every problem you and I can see he will have solved a couple more). If you can, use Paul's work, if he is willing and able at this point to supply kit, keeping in mind that the last thing he needs is distractions and time-consuming side-tasks.

Ken Rushton.
> --
>
>
> You are subscribed to the Google Groups "diykeyboard" group.
>
>
> To post to this group, send email to diyke...@googlegroups.com
>
>
> To unsubscribe from this group, send email to diykeyboard...@googlegroups.com
>
>
> For more options, visit this group at http://groups.google.com/group/diykeyboard?hl=en
>
>
> Also see the DIY Keyboard Google Code Repository and Wiki: http://code.google.com/p/diykeyboard/

Paul Vandervoort

unread,
Feb 10, 2012, 6:49:31 PM2/10/12
to diyke...@googlegroups.com
On 2/10/2012 12:38 PM, Noel Cragg wrote:
There are lots of microprocessors and A/D converters and
microprocessors with on-board A/D converters available which can
perform the needed scanning at the needed speed.
I agree that they'll support an appropriate sampling rate, but I worry
about the hysteresis in the system when performing analog muxing
between the CPU and sensors.  Perhaps I shouldn't be worried?

Assuming you don't actually mean "hysteresis", but A/D input voltage stabilization lag time:  Of course you should be worried.  There is typically some capacitance in an A/D input circuit.  You can greatly reduce the lag time by buffering each A/D input with an OP-amp.  I'm using Digi-Key part # MCP604-I/SL-ND.

Here are some other conclusions I arrived at with after much thought, consulting with engineers, and trial & error: 

First of all, don't strobe the infrared LEDs as a means of multiplexing.  It takes too long for the phototransistors to stabilize.  Leave the LEDs on all the time.

Don't put any resistors (other than multiplexer chips) in series between the phototransistors and the A/D inputs.  This will reduce lag time.

I'm using two layers of analog multiplexers (e.g., Digi-key part 296-14271-1-ND).  In other words, the signal from each phototransistor goes through two multiplexers.  Hence, a large array of phototransistors can be multiplexed into a small # of A/D inputs. 

Run the phototransistors with as much voltage (e.g., 6V) and as much voltage swing as possible to minimize signal noise.  If the maximum voltage you can place across the phototransistors is greater than the maximum A/D input voltage, reduce the voltage after the Op-amp, or use a circuit with the op amp.   You can also reduce signal noise by putting a small ceramic capacitor (e.g., 0.0039uF) in parallel between each A/D input and ground.  Use a scope to determine the ideal capacitor value.  Of course you can also reduce signal noise by placing the A/Ds as close to the phototransistors as possible, and making the signal lines as short as possible.

Drive the LEDs with a constant-current circuit to minimize variations in the amount of light from each LED.  You can put several LEDs in series, which will further equalize the current.

Of course you're still going to have to provide a way of accommodating variations in the response curve for each key.  This can be done in software.

Paul V.

Paul Vandervoort

unread,
Feb 10, 2012, 6:49:49 PM2/10/12
to diyke...@googlegroups.com
Golly gee. Thanks for the nice words Ken. I think my new key action
feels real good. (What do you think, Noel?) But I don't claim that it
feels like a piano.

Noel Cragg

unread,
Feb 10, 2012, 7:06:48 PM2/10/12
to diyke...@googlegroups.com
> Golly gee. Thanks for the nice words Ken. I think my new key action
> feels real good. (What do you think, Noel?) But I don't claim that it
> feels like a piano.

I liked it. The keys don't tilt or rock if you hit them off-center,
they're quiet when they hit the key bed, they were easy to
differentiate by feel, and the whole package was visually appealing.

Andrew Wagner

unread,
Feb 13, 2012, 3:26:04 PM2/13/12
to diyke...@googlegroups.com
Welcome Noel!

On Fri, Feb 10, 2012 at 12:36 AM, Noel Cragg <noel....@gmail.com> wrote:
> Let's talk keyswitches.
>
> 0) For velocity-sensing keyboards, one sensor per key or two?  One-per-
> key results in a lower part count, but means that one needs to perform
> ADC on each sensor in order to determine depth/rate of key travel.
> Two-per key is more parts, but key scanning is more straightforward
> (e.g. sensor output sent through a schmitt trigger allows one to wire
> up a simple matrix keyboard).  Thoughts?

Analog measurement of key height does buy you some more flexiblity in
how you generate keypresses releases, not to mention the aftertouch
stuff synth people do. As a classical pianist, I would be more
interested in enabling multiple keydown events per keyup event, for
legato playing. Two thresholds isn't enough for that; you need at
least thresholds (or an analog measurement).

> 2) Photointerrupters.  Reflective or not?  Discuss.

It's hard to get analog with a photointerrupter (where the package has
a slot and the LED and phototransistor face each other across the
gap); I think a reflective object sensor (the led and phototransistor
point out the same side of a package) is more suitable if analog.

> 3) Hall-effect sensors.  The wiki page asserts that "it is a lot
> harder to prevent magnetic interference between keys than it is to
> prevent optical interference."  That claim seems unfounded to me,
> given that sensors exist with a whole range of sensitivities.  Is
> there a story behind the assertion?

I wrote that, along with pretty much everything else that is on the
wiki. That's just sort a truism about electromagnetics. DC magnetic
fields go through just about any material, not so with light. Of
course you could probably get both to work, i.e. with small weak
magnets close to the hall effect sensors.

Cheers,
Drew

Andrew Wagner

unread,
Feb 13, 2012, 3:35:14 PM2/13/12
to diyke...@googlegroups.com
Thanks for telling us about the electronics architecture of your
keyboard, Paul! Your post obviously contains a lot of hard-won
information. Even though I'm not working on a keyboard for the time
being, I found your post interesting, and am grateful for the advice.

Cheers,
Drew

Reply all
Reply to author
Forward
0 new messages