ARES 1.3 · Episode 1 · The board

5 buttons on 1 pin: the resistor ladder

Five buttons, one single pin. Here's how.

ARES 1.3 · 5 → 1
Video in production

Summary

  • A voltage divider does the trick.
  • 10k pull-up to 3.3 V. Each button grounds a different resistor.
  • The ADC reads a different voltage per button.
  • Minimum margin between buttons: 0.46 V.
  • At 12 dB attenuation, the ADC's calibrated range reaches ~2.9 V. With no button it saturates. That's fine: it's still distinguishable.
  • Thresholds are calibrated in firmware, from real readings.
  • Honest limit: one button at a time.

«Five buttons. One pin. Nobody got hurt.»

The math

V = 3.3 · R / (R + 10k)
  • Talk 0 Ω → 0 V · Yes 2.2k → 0.60 V · No 4.7k → 1.06 V
  • Back 10k → 1.65 V · Knob 22k → 2.27 V · None → 3.3 V

Ladder calculator

Talk—
Yes—
No—
Back—
Knob—
None∞—
Minimum margin—

One button at a time. Two together give an in-between value that looks like another button.

ARES Lab scene L3
ARES Lab scene · L3

Engineer's rule

One well-planned pin beats five badly used ones.