In embedded systems, the only time I can think of ever needing to detect multiple button presses is for going into diagnostic modes. If a diagnostic mode is not required then you can easily program out the incidence of multiple button presses as invalid response.
I think this could be useful for implementing with small micros, its a different approach from the matrix keypad configuration typically used to reduce the number of pins used. The number of pins a matrix keypads uses is at least 2*sqrt(#_of_buttons).
When suggesting the 10K value for each resistor has you taken in account the maximum recomended output impedance according to the selected microprocessor specification? A PIC processor (PICAXE also) recommend a maximum value of 2.5k (the impedance/ohm resistance) going to V+ (5 VDC). This is important in order to charge the internal measuring capasitor in the mircoprocessor wtihin the in the microprocessor specified timeframe.
Let me know if more explanation is required.
Note: The similar circuit that birdmum has linked to is using an analog comparator as measuring device which does not have the capacitor issue.
Anyone who maybe know better and disagree please comment on this.
Yep, you’re right. 10k may be a little much for the ADC.
Tested this with 1k resistors and it works a treat, but anyway depending on which button you press the impedance to VCC is going to exceed 2.5k when you press button 3 or higher.
To make things even more complicated, there is probably no way around that you will need to do some debouncing of the switch, just like it was digital input.
It takes, depending on the microprocessor, approximately up to 30 uS to make an analog conversion
In this example taken from this excelent article by Ganssle (http://www.ganssle.com/debouncing.htm) it can take up to 150 uS before the switch deactivate (or activate).
So depending on when you program makes the convertion it might not be the right value (read: pressed switch) unless you read multiple times over several mS until you get values within acceptable ranges/zones. This goes for both activating and deactivating. It is easier to detect when deactivation because you will know that you should get a fairly stable 0V value on the input. It get more interesting when you need to detect the activating value. But that is just an exciting programming excercise.