1
\$\begingroup\$

I have a number of 7 pole single throw switches that I need to connect together in some sort of grid configuration to a microcontroller, while minimizing the number of pins on the micro and the number of diodes/other elements I need.

The controller needs to be able to uniquely distinguish each switch regardless of how many of them are open or closed at a given time; presently there are 17 different switches.

I also do want to have some degree of redundancy on the mechanism - it is possible that one or two of the switch's poles might fail to make contact and remain open. (The other failure, accidental closure, is not an issue.) Ideally I would like to allow for up to two failures per switch without compromising the ability to register each input.

I have considered a few conventional methods: With a conventional switch matrix, \$n\$ pins gets you \$(\frac{n}{2})^2\$ switches and needs \$(\frac{n}{2})^2\$ diodes. Charlieplexing the switches would increase this to \$n^2 - n\$ switches while reducing the number of diodes to just \$n\$.

Both these have the advantage that I can just combine all the poles together and get my redundancy there. However, I would guess there might be a clever way to connect them taking advantage of the multiple poles to reduce or possibly eliminate the need for extra diodes.

How can I take advantage of the multiple poles to reduce the number of needed diodes while still maintaining some level of redundancy in the switch network?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Since accidental contact closure is not an issue the switch contacts can simply be wired in parallel for redundancy.

Using this arrangement any multiplexed configuration including charlieplexing can be used. I don't think you can use less than one diode per switch except for switch 17 (4 x 4 + 1) as it may be on it's own dedicated pin. That makes 16 diodes the minimum.

\$\endgroup\$
4
  • \$\begingroup\$ I already mentioned this exact configuration in my question. \$\endgroup\$ Sep 29, 2016 at 18:17
  • 2
    \$\begingroup\$ I read it twice before I answered. Schematics are better than words. This uses one diode per switch. Are you asking to improve on that? \$\endgroup\$
    – Transistor
    Sep 29, 2016 at 18:21
  • 1
    \$\begingroup\$ I already have a way to do this with \$\lceil\frac{1}{2}\sqrt{4 k+1}+\frac{1}{2}\rceil\$ diodes and \$\lceil\frac{1}{2}\sqrt{4 k+1}+\frac{1}{2}\rceil\$ pins just with putting the switches in parallel. I am trying to do better than that. \$\endgroup\$ Sep 29, 2016 at 18:51
  • 1
    \$\begingroup\$ What's "k"? Add a schematic to your question. Even if you don't get a decent answer it may help someone else. \$\endgroup\$
    – Transistor
    Sep 29, 2016 at 21:27

Your Answer

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

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