Wiring 13 - 3 terminal toggle switches to arduino pro micro (help)

Hey guys, so, i've recently started a new arduino project, where my goal is to create a controller for a flight simulator.

I decided to start by trying to recreate the x-plane's cirrus SF-50 vision switch pannel, that consists of 15 toggle switches and a potentiometer.

I've done a lot of research on the topic, figured out how to code it, but i am struggling with the hardware. firstly i bought a toggle switch with 2 terminals, so when i hooked it up to xplane 11 i could only turn things on, but when i turned it off it didn't do anything (figured out why a little bit later), now i realized i need toggle switches with 3 terminals to turn things on and off.

My problem right now is that i would need 26 pins to properly wire this, and the arduino pro micro that i want to use for this project only has 17. I thought about doing a matrix like people do for push buttons, but since all the switches have to be toggled ON simultaneously, i dont think that it would work. Does anyone know a solution for this problem?

Im also sending the images of both the pannel and the matrix that i think will not work (but is the only thing i thought so far)
NOTE: on the image from the sim there are 15 switches but 2 of those are not "assignable", that's why im only trying to connect 13.

Those 12 switches.... Are they like On-Off-On or On-On. 3 posutions or 2?

2 positions, ON-ON

Okey. You need 7 I/O as I see. What us the oroblem with that?

Yes, with the matrix i would only need 7, but what i thought is that, for example, if i toggle the A1 switch, then the B1, then the A2, when i go and toggle the B2 switch it wouldn't be recognized because its line and column are alredy sending "signal" to the arduino, and i need all 13 of them to be ON simultaneously, so i thought that this matrix would not work. but, are you saying it does?
Also, excuse me for any begginer mistake, i am quite new to this. And thank you so much for the replies :slight_smile:

@jlancha

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

jlancha:
Yes, with the matrix i would only need 7, but what i thought is that, for example, if i toggle the A1 switch, then the B1, then the A2, when i go and toggle the B2 switch it wouldn't be recognized because its line and column are alredy sending "signal" to the arduino

That is a common problem with matrices that can be solved by adding diodes.

Indeed, add diodes, as is explained here, one of many button matrix tutorials.

Of course a matrix has to (and can) deal with multiple switches on at the same time!

In your case, if it is just on/on without an off, you can just approach every button as if it were a regular on/off switch. No difference here, really. That makes for 8 pins total in a matrix configuration (4x4 matrix, allowing for up to 16 switches).

Thanks you so much for the replies guys, i'll do my research on how to wire it with diodes. thank you for the link as well!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.