I made the original Instructible that this is based on over a year ago (You can see it here to see some of the theory around how this works:https://www.instructables.com/id/How-to-access-5-buttons-through-1-Arduino-input ). To make a long story short, I moved to a different country a few weeks after that and have not played with any electronics since.

I'm starting a project to build a clock that will display multiple timezones (And a bunch of other stuff too), and I need some inputs to set the time and manage the menu options. Since I'd already done the research (Albeit a year ago..) I figured I'll use the same setup to create a 4 or 5 button panel to navigate the settings and change the relevant values.

What I found though is that the original Instructable was a good proof of concept, but it wasn't good enough to put in practice. After working on this the whole night I now have a more practical solution.

Step 1: Parts List

1 x Arduino (Or Arduino compatible board. I use the BBB from moderndevice.com)
1 x 100K Resistor (Brown Black Yellow)
1 x 1K Resistor (Brown Black Red)
1 x 10K Resistor (Brown Black Orange)
1 x 22K Resistor (Red Red Orange)
1 x 33K Resistor (Orange Orange Orange)
1 x 68K Resistor (Blue Gray Orange)
5 x Push button switches
A Breadboard
Some wires to connect it all
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).

About This Instructable




More by riaancornelius:Controlling 20 Led's from 5 Arduino pins using Charlieplexing Accessing 5 buttons through 1 Arduino pin - Revisited How to access 5 buttons through 1 Arduino input 
Add instructable to: