# USB on/off switch

## grant123

Does anyone know of a USB on/off switch like this but which does connect the data lines?

https://www.adafruit.com/products/1620

----------

## chithanh

Do you want a hardware switch or is software switch also ok?

Many USB hubs (even cheap ones) have the ability to do per port power switching.

If you have any lying around, connect and run lsusb -v, look for "wHubCharacteristic" and "power switching".

Else you can buy USB hubs with hardware switches like these:

http://www.amazon.com/Insten-7-Port-USB-Switch-Black/dp/B007S642BW

http://www.amazon.com/Sabrent-4-Port-Individual-Switches-HB-UMLS/dp/B00BWF5U0M/

----------

## grant123

It must be hardware.  I'd rather not use a powered device for this (bus-powered or otherwise).  I'm looking for something mechanical like the Adafruit device but one that passes data through.

----------

## chithanh

These should work if you leave the second uplink disconnected.

http://www.amazon.com/EEEKit-Printer-Scanner-Keyboard-Protective/dp/B00B2IC0VQ/

http://www.amazon.com/Sharing-Switch-Port-Printer-Scanner/dp/B00CGWQLHG/

http://www.amazon.com/Tek-Republic-TUS-200-Sharing-Switch/dp/B00FEM3OKM/

----------

## Syl20

There's probably something I don't understand, but why looking for such a stange workaround, when you can just unplug the USB device ?

----------

## chithanh

Pluggin/unplugging puts stress on the connectors, the electronics behind them, and also on the soldering joints on the boards.

USB Type-A is specified for 1,500 plug cycles I think.

----------

## frostschutz

You could probably build your own cable. Or just use a cheap extension cable (un)plug that, if it breaks you just need a new cable.

There are a few offers on cable with a data/power switch, not sure if you're allowed to use that while it's connected though.

----------

## chithanh

If you look at an USB plug, you will notice that some pins are longer than others. This is important, because it enforces the order in which they are connected and disconnected. If you build a switch yourself, you need to ensure keeping that order too, which might not be trivial.

----------

