Five Buttons On One Pin

Share on facebook
Share on twitter
Share on linkedin
Share on email
Share on print
Table of Contents
Schematic image is an animated gif of five pushbuttons being pressed in random sequences with a 5-bit binary pattern of numbers on the bottom. The image is generated from Propeller 2 debug statements that create a live visual graph, chart, or schematic from Propeller Tool. To wire this circuit, connect a 2.2K ohm resistor to 3.3V, then, with the resistors across the contacts of each button, a pushbutton with a 1.2K ohm resistor, a pushbutton with a 600 ohm resistor, a pushbutton with a 300 ohm resistor, a pushbutton with a 150 ohm resistor, and a pushbutton with a 75 ohm resistor, and then to ground. The schematic is vertically built with the 3.3V on top, ground on bottom. The buttons are actively moving up and down and the image was likely recorded with screen capture software watching Propeller Tool debug windows.
Description

This program demonstrates how to series-connect five pushbuttons over one I/O pin, so that they can all be read in parallel by taking an ADC measurement and scanning a threshold table to determine their binary pattern. The program includes automatic debounce, too.

This may be accomplished with two resistor values: (5) 150 ohm and (5) 1.2K ohm with 1% tolerance like this:

  • Two (2) 1.2K ohm in series for the 2.4K ohm (this is an acceptable substitute for the 2.2K ohm value)
  • One (1) 1.2K ohm for the 1.2K ohm 
  • Two (2) 1.2K ohm in parallel for the 600 ohm
  • Two (2) 150 ohm in series for the 300 ohm
  • One (1) 150 ohm for the 150 ohm
  • Two (2) 150 ohm in parallel for the 75 ohm value.   

Parallax will offer these resistors and five pushbuttons in a bag for those who wish to prototype with this circuit. Expected release date early March, 2021. 

Compile with DEBUG to run this program. The DEBUG features create the graphic shown above from the Propeller Tool software and simulate what you’ll observe when you build the circuit and press the buttons in any possible combination. 

Parts Used
Programming Language
Document Author
Source Code Author
Table of Contents
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Copyright © 2021 Parallax Inc. All Rights Reserved
Designed and Made in California, USA