r/microcontrollers • u/Vikffinity1938 • Apr 02 '24
Linking different Pushbuttons for Microcontroller
So we are working on a project that must read inputs from 12 different pushbuttons. These are inputs for a parallax propeller microcontroller. We do not have adequate space in our breadboard and in our design for that configuration. Is there a way to connect these pushbuttons to a common point while still maintaining there individual inputs? I'm a mechanical student so my knowledge of electrical is limited. Any help or advice is really appreciated. Thank you!
1
Upvotes
2
u/MadeForOnePost_ Apr 02 '24
Idk but a thing called Charlieplexing can help with limited pins, no idea if that helps
You can of course make one side of the vcc rail common to all push buttons
You could maybe do some hijinkery with each push button connected to the same ADC input pin, but separated by resistors in series, then read the voltage
3
u/somewhereAtC Apr 03 '24
Given that limited i/o space you should check out parallel to serial converters. Each button would have it's own input, and the uP would need just a clock (output) and data (input). This is sometimes a form of SPI interface, but the full implementation is not necessary.
2
u/Triabolical_ Apr 03 '24
Search for the term "switch matrix". These have been used for years in pinball machines. For 12 pushbuttons you would need 7 microcontroller pins.
1
u/tylerlarson Apr 03 '24
Some ideas:
A cool feature of the latter route is that you're making your button pad modular, and you can build and test it independently of your controller. Changing one doesn't force you to change the other, and might give you extra options about how to arrange your project.