Step 6: Extending It

As I mention in step 4, this could probably be extended to 12 buttons with minimal effort.

With the analog inputs having a 10 bit resolution, that gives us 1023 values between 0V and the reference voltage. If you divide that by 12 buttons, you can see that each button would have to be within a unique range of 85 points. I would call it no more than 40 - 50 to be safe.

If you do this, you would have to use fairly accurate resistors (Or measure them and use the ones that are close to the E12 vaues) and you would quite possibly need a better way to debounce the buttons.

From the fact that all my values are within a maximum range of 11 points, this seems completely doable.
Hi Riaan <br>Thanks for this Instructable. It makes a lot of sense, and I'd like to try it since the Uno (which I'm using) only supports 2 interrupts via the Arduino IDE. My project requires 3 buttons and a rotary encoder. The latter uses both interrupts and I really needed a dependable solution for the 3 buttons. <br>My question is this: will your system work with hardware debouncing? I have used the 74HC14 Schmitt Trigger very successfully for debouncing in the past and wondered if I can still use it when using your system to detect button presses. <br>Thanks <br>Christo (Pretoria) <br>
Really useful thank you. Just the line of thinking I was looking for. Now to see if i can extend that to read any combination of three buttons.
I have added 8 buttons. The resistors used are 1k, 2k2, 3k3, 4k7, 5k6, 6k8, 8k2,10k and a 10k pull down, The readings are:<br>1&gt; 517<br>2&gt; 566<br>3&gt; 610<br>4&gt; 660<br>5&gt; 701<br>6&gt; 773<br>7&gt; 843<br>8&gt; 930<br><br>I know things can be better but it works great (for me). Thank you again.
wow, nice way to get a lot more i/o pins
Thanks :) The cool thing is that it is so simple. It's no harder than wiring up a multiplexer of some kind.
Thanks, I just needed this.
This is Neat! Where do you get your schematic software?
Thanks. The software is Cadsoft Eagle Light. The freeware version works well enough for most hobby projects. The only real limitation is that you can only design boards smaller than 10 x 8 CM. <br><br>You can download it here:<br>http://www.cadsoft.de/freeware.htm
Cool! thanks for the prompt reply, man!
This article could benefit of a discussion in what direction this could go.<br><br>How many different buttons could you detect with this? What is the practical resolution of the AD-input (i.e. in how many practical segments would you be able to divide the digital input and still be sure).<br><br>In some projects, maybe you don't need to be completely sure.
I mention in Step 4 that you should be able to scale this up to 12 buttons fairly easily (and still be sure). I've also added that into the final thoughts (Step 6). <br><br>With the analog inputs having a 10 bit resolution, that gives us 1023 values between 0V and the reference voltage. If you divide that by 12 buttons, you can see that each button would have to be within a unique range of 85 points. I would call it no more than 40 - 50 to be safe. <br><br>If you do this, you would have to use fairly accurate resistors (Or measure them and use the ones that are close to the E12 vaues) and you would quite possibly need a better way to debounce the buttons.
I also added this information into a new step (Step 6: Extending it).