EveryCircuit
Contact
Reviews
Home
cygig
modified 3 years ago

Using analogRead for many buttons

2
1
135
01:52:28
Here are two ways to read the voltage to determine which button was pressed. On the top, current takes the shortest path so only one button will be registered by design. It is also cheaper to use many resistors of the same value. On the bottom,it is possible to detect combination presses: Button Press - Voltage / 10-Bit ADC (0-1023) / 12-Bit ADC (0-4095) ---------- Button 25K - 4V / 818 / 3276 Button 50K - 3.33V / 681 / 2727 Button 100K - 2.5V / 511 / 2047 Button 200K - 1.67V / 341 / 1367 Button 400K - 1V / 204 / 819 Button 25/50K - 4.29V / 877 / 3513 Button 25/50/100K - 4.38V / 896 / 3587 Button 25/50/100/200K - 4.41V / 902 / 3611 Button 25/50/100/200/400K - 4.43V / 906 / 3628 Button 50/100K - 3.75V / 767 / 3071 Button 50/100/200K - 3.89V / 795 / 3185 Button 50/100/200/400K - 3.95V / 808 / 3235 Button 100/200K - 3V / 613 / 2457 Button 100/200/400K - 3.18V / 650 / 2604 Button 200/400K - 2.14V / 437 / 1752 Arranged from low to high: Button 400K - 1V / 204 / 819 Button 200K - 1.67V / 341 / 1367 Button 200/400K - 2.14V / 437 / 1752 Button 100K - 2.5V / 511 / 2047 Button 100/200K - 3V / 613 / 2457 Button 100/200/400K - 3.18V / 650 / 2604 Button 50K - 3.33V / 681 / 2727 Button 50/100K - 3.75V / 767 / 3071 Button 50/100/200K - 3.89V / 795 / 3185 Button 50/100/200/400K - 3.95V / 808 / 3235 Button 25K - 4V / 818 / 3276 Button 25/50K - 4.29V / 877 / 3513 Button 25/50/100K - 4.38V / 896 / 3587 Button 25/50/100/200K - 4.41V / 902 / 3611 Button 25/50/100/200/400K - 4.43V / 906 / 3628 With the exception of the last three of the 10-bits ADC result, the other values are 10 values or more apart.
published 3 years ago
Radek2001
3 years ago
dobre

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy