Wow I just stumbled on this, you guys have to check this out!
This is just so cool I'm gonna have to quote him right here so you don't have to click the link ;D
This is such a resistor matrix. The columns are connected to ground, in between the column connections are three stacked resistors. The rows are connected via four such stacked resistors to the operating voltage (e.g. 5 V). The AD converter input is blocked by a condensator of 1 nF because the ADC doesn't like high frequencies, that could be caught by the keys, the resistors and the more or less long lines in between all this.
If the key "5" is pressed, a voltage divider gets active:
- 1 k + 820 [ch937] = 1,82k to ground,
- 3,3 k + 680 [ch937] + 180 [ch937] = 4,16k to plus.
At an operating voltage of 5 Volt a divided voltage of
5 * 1,82 / (1,82 + 4,16) = 1,522 Volt
is seen on the AD converter input. If we consider 5% tolerance of the resistors, the resulting voltage is somewhere between 1,468 and 1,627 Volts. The 10-bit AD converter converts this (at 5 V reference voltage) to a value between 300 and 333. If we ignore the lower two bits of the result (e.g. divide the AD result by four or left-adjusting the result - if the ADC provides that function) this yields an 8-bit-value between 74 and 78.
Each key pressed produces a typical voltage range, to be converted to the key code.
Well ok I lied, you will have to check the site to get it all
I'm moving soon and have most of my stuff packed or getting ready to so I won't be able to try this for a bit. I just can't wait, this is so ingenious! On top of saving a 12 ports for a direct connection, it saves the very costy 74C922 16 Key encoder ~8$ (iirc) all with a few cents worth of resistors!