Go Down

Topic: Help on momentary push switches in series. (Read 1 time) previous topic - next topic


Here a simple way to add 13 buttons all resistors are 220 ohm you'll only need Ground  and a A0 pin
and there code that works with the idea in the Playground

That circuit can tell if one switch is presses and tell which one is being presses. However it can not cope with multiple switches being presses which is what the OP wanted.


That's what I thought.
And I came to the conclusion that with a resolution of 1024 on the ADC in theory you could wire up the circuit to implement a binary progression for 12 buttons  (No button =0, button 1=1 button 2=2, button 3=4, button 4=8 etc.), in practice, that is unfeasible as the difference between button presses will be only 1 value, or 0.00488 V (e.g. buttons 1,2,3 pressed = 7 [0.034 V] ; button 4 only = 8 [0.039 V]) which even with very tight tolerance resistors will be sensitive to tiny supply voltage fluctuations.

If someone can prove my logic wrong and give me an example of such a circuit I will be very happy.

Incidentally, I read a long time ago that the very first digital computers designs were based on the decimal system (the most intuitive to us humans) but they never got to work in practice because of the unreliability of detecting those differences in voltage. The binary system was eventually used because it's much easier to detect No-voltage/voltage.

I feel like I re-discovered the wheel.
There are three kind of people in the world: Those who can count, and those who can't


If you do not have the 13 Arduino pins available, PISO shift registers were invented for your problem. Forget about the analog trick in your case.
┬ÁC is about serializing the physical world to handle it in a sequential processor ;)


R-2R networks only work with SPDT switches, not SPST push buttons.

Are you sure about that? :)

With a r2r type button, you can read multiple buttons from one pin, and you can detect simultaneous presses as well.


Why did you start a whole new thread on this keyboard?
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up