0
\$\begingroup\$

I'm looking for a chip which could minimize ~45 button inputs down to an 6 pin input for use with Raspberry Pi.

I know this is a simple problem and it has likely been solved before, but as an absolute beginner, most of the responses were either too theoretical or too high-level for me to utilize effectively.

The cheaper the chip/easier the process, the better.

Thanks you for any help!

\$\endgroup\$
  • \$\begingroup\$ You are looking for a keyboard encoder. Take it from here. \$\endgroup\$ – Eugene Sh. Mar 27 at 15:19
  • 1
    \$\begingroup\$ What do you mean by "remaining bits"? Do you have 11 input bits for the buttons or not? \$\endgroup\$ – Elliot Alderson Mar 27 at 15:33
  • \$\begingroup\$ Sorry for the confusion. 45 Buttons, reduced to 6 bits for addressing purposes. The remaining 5 (out of 11) are used for program instructions. So yes I need 11-bit input to the Raspberry Pi in total. \$\endgroup\$ – DHLaurelT Mar 27 at 15:41
  • \$\begingroup\$ How these 5 are relevant to the question? \$\endgroup\$ – Eugene Sh. Mar 27 at 15:43
  • \$\begingroup\$ @EugeneSh. You're absolutely correct, I revised the question to avoid this confusion. \$\endgroup\$ – DHLaurelT Mar 27 at 15:54
0
\$\begingroup\$

You can do it with the gpio by scanning the buttons as shown in this example schematic. Modify to suit your needs.

enter image description here

UPDATE: As @DHLaurelT pointed out, this would require 14GPIO to get the job done. So it would have to be an intermediary circuit that scanned the buttons and then sent the results to the Pi.

\$\endgroup\$
  • \$\begingroup\$ This schematic is helpful, and I may be misreading, but wouldn't this require 7+7 = 14 GPIO pins for 45 buttons theoretically? (My apologies if I'm deeply mistaken) \$\endgroup\$ – DHLaurelT Mar 27 at 16:03
  • \$\begingroup\$ @DHLaurelT Doh! You are right. So it can not be done directly into the Pi, but would require an intermediary circuit. At that point though, then it could use a uart to tell the Pi what button was pressed. \$\endgroup\$ – Aaron Mar 27 at 16:07
0
\$\begingroup\$

Charlieplexing works just as well with switches as it does with LEDs. 8 bidirectional I/O lines can access up to 7 × 8 = 56 switches.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.