-1
\$\begingroup\$

updated button box schematic

I'm building a button box with many momentary push buttons to control several raspberry pi zeros via gpio input. I'd like to be able to have each button have two functions by using a selection button. The schematic shows the selection button at the top and two function buttons below it but the final product will have at least 10 function buttons. A high 3.3v input would be connected to each transistor to the left and right of each function button. When the selection button gate is open the function button completes the path to the +5v, activating the NPN transistor on the left and pulling that input to ground. When the selection button gate is closed and the function button is pressed, the shortest path is to ground, so the NPN deactivates and the PNP activates, pulling the other input to ground.

I have built this on a breadboard and it seems to work mostly as expected. Tested it with a few different pieces of hardware, including one with 5v logic and everything seemed fine. I'm here wondering if I'm missing anything important or if there are any issues with this design that I've missed.

Edit: changed schematic image for clarity.. again

\$\endgroup\$
2
  • \$\begingroup\$ i see no inputs in the schematic \$\endgroup\$
    – jsotola
    Commented Dec 16, 2020 at 6:01
  • \$\begingroup\$ What is a multi function button box? What is it meant to do? Your schematic doesn't really hint at anything useful. \$\endgroup\$
    – Andy aka
    Commented Dec 16, 2020 at 10:45

1 Answer 1

0
\$\begingroup\$

No, if "select" switch is ON, any "function" switch will short all the power line behind 10K via 2 diodes to the ground, so the second.....third.... functional buttons will not work this time (during pressing one)

GPIO inputs should be programmed with pull-up resistors ON

Some example to fix: enter image description here

Couple thoughts:

  1. All diodes looks could be safely excluded (shorted).
  2. All transistors could be, for example, n-p-n - and connected the same way - left and right side, do not see the reason to use different (PNP)
\$\endgroup\$
8
  • \$\begingroup\$ Are you sure? This isn't the behavior i witnessed either in simulation or on a breadboard. Originally I didn't have the function buttons isolated from eachother with diodes, and they would interfere with eachother and gave odd behavior, but adding the diodes seems to have brought that under control. They still do interfere with eachother (due to leakage i guess?) but it's in the mV range and acceptable for 3.3v logic. \$\endgroup\$
    – Spezz42
    Commented Dec 16, 2020 at 20:37
  • \$\begingroup\$ It depends of diodes, it really could still somehow work. Just switch "selection button" to the ground, and any of "functional" buttons simultaneously and control "to more functional buttons" line (the left one) - you will see it's huge drop voltage on it \$\endgroup\$
    – Pinelab
    Commented Dec 16, 2020 at 20:49
  • \$\begingroup\$ I mean, you're right, closing the selection switch creates a short from the +5v. About 2.5mA flows through when the selection switch is closed. It's that short that stops the NPN being supplied it's control voltage, and creates the path for the PNP's base to ground. Is that too much current? Will it be an issue? \$\endgroup\$
    – Spezz42
    Commented Dec 16, 2020 at 20:56
  • \$\begingroup\$ It just could make to stop operate other buttons right - if you, for example, want to press two functional buttons or three simultaneously - could be troubles in recognition - which functional buttons pressed - because all the power line gone down by any one single \$\endgroup\$
    – Pinelab
    Commented Dec 16, 2020 at 21:02
  • \$\begingroup\$ Got ya, i see what you're saying. Fortunately, in actual usage, these buttons will be used mostly to issue one time commands. I should never have to hold more than 1 or 2 at a time. So it's limited in how many function buttons can be pressed simultaneously by the voltage available to the transistors... I wonder if there is a way around that. \$\endgroup\$
    – Spezz42
    Commented Dec 16, 2020 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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