Apologies for the terrible ASCII art, and the fact I can't figure out how to draw the symbols for ground or a switch in ASCII art.

Code: Select all
[Controller]
|
|
*----||----[switch]--*
| |
| |
*----||----[switch]--*
| |
| |
*----||----[switch]--*
| |
| |
*----||----[switch]--*
| |
| |
*----||----[switch]--*
|
[possibly a diode to prevent feedback]
|
[ground]
The trick is that each of the capacitors is a different value, most likely in a powers-of-two arrangement. You could then read all the switches in a "column" by reading the capacitance off the controller line and A/D converting it to a bit pattern.
Note that I use capacitors simply because the math's easier with them in series-- you could do resistors in series instead, in values designed to make the math easy.
Now, what benefits does this have?
* Potentiallly simpler wiring, especially on one-layer PCBs.
* Uses fewer controller pins. I figure it's probably feasible to do 6 switches per column, if we can reliably read the circuit with 1-2% accuracy.
At six switches per column, a 104-key layout requires only 18 controller lines. A conventional rows-and-columns layout would probably be 16x7, if not more, requiring 23 lines. For some of the project boards, where we're at the limits of the signal lines available on the controller, it might be valuable.
The drawbacks, however:
* It turns a largely digital problem into a much more analogue problem-- the switch sticks part way open and it acts like another switch is held down.
* It's doubtful most off-the-shelf microcontrollers are designed for this model of sensing.
Has it ever been done before? Any further discussion?