Does a component exist that functions as a switch for multiple connections at once, 3 in my case.

So power, ground, and data are coming in from the top. When the switch is in the left position (as pictured) they will get connected to the power, ground, and data lines on the left side. When the switch is flipped to the right position all 3 power, ground, and data are moved over to their respective matches on the right side.

Essentially it's like having a 3 switches, one each line and flipping them all at the same time.

3 lane switch

  • 1
    \$\begingroup\$ A 3P3T switch? (3 Pole 3 Throw) \$\endgroup\$ – Wesley Lee Feb 8 '17 at 2:17
  • 7
    \$\begingroup\$ @WesleyLee: I think he only wants a 3PDT (three pole double throw). These (and 4PDT) are readily available as toggle switches from many suppliers. Three (or more) switches are generally available as rotary switches, although there are some multi-position slide switches. \$\endgroup\$ – Peter Bennett Feb 8 '17 at 2:23
  • \$\begingroup\$ Note that in some applications, regulations may require that the contacts make or break in a particular sequence - e.g. neutral makes before live(hot), but live breaks before neutral. [I'm remembering this from UK regs, but sorry I can't give a reference.] \$\endgroup\$ – Dreamer Feb 8 '17 at 10:36

Each of your "lanes" is a "pole" in switch terminology. 1P (or SP), 2P (or DP), 3P, 4P...

The number of ways you can connect those to outputs is a "throw" (T) - Single being ST, double being DT and after that, numbers. 3T, 4T...

Some switches add "center-off." Single-throw switches are "off" one way and "on" the other, while DT are always on in one direction or the other UNLESS they are "center off."

3P DT will do. Input goes to common.

3PDT from StewMac

I have some lovely old modem A/B switches that switch all 25 pins (though most do fewer pins, all 25 being overkill for the average modem) so those are 25P-DT


NKK M-2033 3PDT switch - This 3PDT switch may meet your needs. Se datasheet for connection and ratings information.

Switch (bottom) Switch (top)

This is the relevant pole & circuit table from the datasheet:

Switch diagram table

  • \$\begingroup\$ Adding the internal diagram helps others to quickly check your answer too. \$\endgroup\$ – User323693 Feb 8 '17 at 2:41
  • \$\begingroup\$ link \$\endgroup\$ – mad_fish Feb 8 '17 at 2:56
  • 2
    \$\begingroup\$ @mad_fish Link should be in answer and noticeablly identified - easily missed in notes and more likel;y to vanish with time. \$\endgroup\$ – Russell McMahon Feb 8 '17 at 6:22

You might only need to switch the data pin, since even with power and ground this will switch data between devices with no harm.

This type of switch would be a "SPDT switch" (1 pole 2 throws)

If you really do wish to switch off the bus power too, then leave the ground connected as it is of no consequence (there are even positive reasons to not break and reconnect ground lines)

This would require a "DPDT switch" (2 poles, 2 throws)

To kill all three lines (almost certainly not necessary) then use a three pole two throw switch... but like I say, there's almost never a good reason to do so.

Now, consider whether you need to ask for a three position double pole switch with a "centre off position" ... This would cut the connection to both devices simultaneously.

A 'centre off' could also be achieved by upgrading the above switches to triple-throw (1P3T/SP3T, 2P3T/DP3T) ... this gives three outputs. To use this you'd connect the first set of outputs to Device 1, leave one set of output pins unconnected, and connect the last set of outputs to Device 2. This is basically what a "centre off" switch does, except they simply miss out the un-needed pins from the package, making the pinout simpler.

Unless there is a strong reason not to, I'd go with the SPDT switch on the data line.

Also, bear in mind that switching data on and off whilst the devices are talking may result in errors and bad data... depending on the error correction available on the devices, this data might be acted on - resulting in unintended consequences.

A better procedure entirely is to use a digital switch, these will let you swap data lines cleanly and without mechanical bounce between multiple sources using cheaper switches. With a little extra circuitry you can delay actual switching till a '1' has not been detected on the line for over a threshold period - set this close to your inter-message delay and you'll never be able to 'chop' messages in half. Ask an electronics hobbyist to help with the design of such a digital switch as it requires some thought.

Also, the protocol is important. Some messages might set context for future messages, and switching between devices can result in the wrong registers being written to and potentially stop the device from working, possibly even permanently (called 'bricking')

Whichever way you do this, if the devices are important - it may be advisable to turn off the devices before switching paths, then start them back up again. This isn't always necessary, but devices with complicated configurations and protocols may well benefit from this safeguard.

  • \$\begingroup\$ considering the question, OP might have already assumed the alternatives too. The answer is not to the point. Any suggestions shall go as a comment. \$\endgroup\$ – User323693 Feb 9 '17 at 10:17
  • \$\begingroup\$ @Umar actually, this answer gives more hints to address the core problem of OP. Because it is not clear whether OP has actually "assumed the alternatives", as you say. I don't think he has a strong electrical background and indeed, switching all three lines is unlikely to be really necessary. \$\endgroup\$ – dim lost faith in SE Feb 9 '17 at 11:29
  • \$\begingroup\$ @dim yes I agree about the design approach put in the answer. It is just a great answer for a moderate question. \$\endgroup\$ – User323693 Feb 9 '17 at 11:48
  • \$\begingroup\$ I had considered just switching the data line, but ultimately the project may end up being battery powered and In that case I'd rather not be sending power to the component that isn't being actively used. Excellent point about using a DPDT and leaving ground connected. As well as the warning about switching while powered on. I figured this could probably cause issues, and my intention is to only switch while the entire unit is turned off. And lastly dim is definitely right Im pretty green towards this kind of stuff. \$\endgroup\$ – FoamyGuy Feb 9 '17 at 14:53

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