# How to connect a large number of multi-throw switches efficiently?

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? • 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. Sep 29, 2016 at 18:51