Go Down

Topic: An analog keypad. Will it work? (Read 1 time) previous topic - next topic

robtillaart

in theory with one analog pin and 48 very precize resistors, say 100 ohm + 5240 ohm

would give 48 steps from 0 to 500 in analogRead => so diff between 2 values is about 10  - just larger than noise (~2 bits)

advantage is that the SW would become very simple: button = analogRead(A0) / 10;

However in practice ....

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

fkeel

I had not even considered that. I *like* that approach....  :-)

liudr

Rob,

Thanks for the link. There's no code on the site though. I was a bit concerned when driving with a port extender but since this extender has an open-drain mode, there won't be problems. Still one needs to use it so inactive columns are not driven to opposite polarity. It would short if you drive column 0 to high and 1 to low and hold two buttons one from column 0 and one from 1. If I use arduino pins under tri-state mode, the problem is solved.

I think I will give my own schematic a try with a membrane matrix keypad. I have a bunch at home. Next time I order from digikey, I'll grab a few of those port extenders. :)

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

liudr


Go Up