0
\$\begingroup\$

My apologies for not such a great description.. so I will clarify here.

I have a rotary switch from an old aircraft panel that has 4 positions and two outputs.

Using my voltmeter's resistance mode I can see the following on the outputs:

OFF
OUTPUT1: OPEN OUTPUT2: OPEN

ALIGN
OUTPUT1: CLOSED OUTPUT2: OPEN

NAV
OUTPUT1: CLOSED OUTPUT2: CLOSED

ATT
OUTPUT1: OPEN OUTPUT2: CLOSED

enter image description here
I am just beginning into transistors and associated ICs, so let's say I am quite green in this area.

What I want to do is run +5V into the switch and then somehow determine which of the four modes is active and then pass that back to one of four pins (or really 3 due to the OFF condition) on a microcontroller so it knows which one is selected.

Would I use some kind of logic gates for this or some kind of transistor array?

\$\endgroup\$
2
\$\begingroup\$

Simply connect the two outputs to two microcontroller inputs. Software can easily determine the switch position from the states of the inputs.

If you apply +5V to the switch input, you will need pull-down resistors of 5K - 10K from each microcontroller input to ground, so the inputs will be Low when the switch is not pulling them High.

\$\endgroup\$
  • 1
    \$\begingroup\$ Or, more conventionally, tie the common terminal to ground as shown and use pullups on the two outputs. \$\endgroup\$ – Dave Tweed Oct 11 '15 at 17:04
  • \$\begingroup\$ Thanks for the quick reply... if I was writing the software myself, it would be easy to implement as per your recommendation. Unfortunately the simulator software talks directly to the card and most people are using three discrete inputs, so there is a large chance that the software isn't written to handle this case when it sees both outputs as closed... hence my need to separate them. \$\endgroup\$ – frischky Oct 11 '15 at 17:06
  • \$\begingroup\$ You could use a decoder IC, like the 74LS138. That is a threee-line to eight-line decoder, but you can just ground the unused input. You would need the pull-up resistors on the inputs of the '138, but not on the microcontroller inputs, in that case. \$\endgroup\$ – Peter Bennett Oct 11 '15 at 17:10
  • \$\begingroup\$ Thanks the 74LS138 looks like the easiest solution for me. I'll mark this one as solved. \$\endgroup\$ – frischky Oct 11 '15 at 17:13

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.