Electrical – How to detect 3 way slide switch positions

digital-logicposition;switches

With one of this 3 position 8 pin slide switches, I want to detect all three positions:

slide switch

Required function:

  • Position 1: Node1 to ground
  • Position 2: None
  • Position 3: Node2 to ground

If I pull an digital I/O pin HIGH and connect it after SW2, HIGH means position 1 and LOW means position 2:

schematic

simulate this circuit – Schematic created using CircuitLab

Can't connect another digital I/O pin to any of the nodes (I have spare I/O pins but nodes voltages are higher than 5V. even if I use a voltage divider, I can't get an Ideal HIGH from them because their voltages will vary) and nodes shouldn't be connected to each other.

How can I detect all third positions?

Best Answer

I think you're misunderstanding how the switch operates.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Each pole of the switch consists of a common wiper contact, 'C', which can touch one of the other contacts, 1, 2 or 3, at a time. The switch is shown in position 1.

I think you're ON-OFF-ON requirement can be satisfied as shown on the right using only one half of the switch.


After details of switch added:

schematic

simulate this circuit

Figure 2. Does this arrangement using one pole of the switch satisfy your requirments?

Table 1. Truth table assuming pullup resistors on GPIO.

Posn   1     2
  1    Low   High
  2    High  High
  3    High  Low