Switching USB data lines with SSR doable?

I have a computer and raspberry and I want to share my USB HardDrive to both and control the direction from raspberry.

I think it's possible to that with SSR (Solid State Relay) ? If a use 4 channels SSR for both (data+ / data-) ? HardDrive GND/VCC powered from Raspberry.

I tought that because is only way I know, but this can working great ?

• Why would you want to do this? Wouldn't it be easier to connect your computer with your Pi using a network cable and set up file sharing? – slebetman Feb 8 '17 at 7:06
• No, because "computer" is not a real computer but is the TV decoder of my ISP. Only USB working on this ( no samba or something else ). And I want to keep my Raspberry as server ( no multimedia ) – kiki67100 Feb 8 '17 at 7:49
• @Nick This is not a shopping question, even if the title was border-line formulated. The actual question was: "Is switching USB data lines with SSR doable". Not "please give me the part number of a chip that switches USB data lines" – dim Feb 8 '17 at 20:07
• @dim The O.P. will edit the title, and the question will appear in the reopen queue. – Nick Alexeev Feb 8 '17 at 21:18
• @kiki67100: The picture of the SSR doesn't help. A link to the data sheet would be better. – Brian Carlton Feb 10 '17 at 1:32

Switching D+/D- USB lines with SSRs will mess up with the signals, especially if you're using high-speed USB (480MB/s). The bandwidth is not sufficient and the impedance will not be maintained, that won't work.

There are specialty chips that do just what you want, for example TS3USB30. Unfortunately, they are all very hard to solder by hand (QFN packages for most of them) because they are designed for mobile devices and avoid gull-wing leads to better maintain the impedance.

Also, if you build such a device, you need to really be careful about the layout of the traces (impedance matching, again), and you'll probably need a four-layer board. This is not straightforward.

The conclusion is: this is impractical (for a hobbyist, at least).

• Thanks for your long reply. I forget SSR for this and for electromagnetic relay ? This can be work ? – kiki67100 Feb 9 '17 at 13:01
• Small reed relays could maybe work for full-speed USB. For high-speed, this will also likely introduce significant impedance mismatch and I doubt it can work. Your best bet is to use (and eventually hack) devices made for that, for example: this one – dim Feb 9 '17 at 13:23
• If one doesn't feel like soldering tiny switch chips, USB "Peripheral Sharing Switch" is a consumer product category, a few of them even automatically controlled, in the sense that with the right setup either of two machines can apparently automatically claim a USB printer. Of course the bare ICs (some are even tinier than QFN since few pins are required) would be much cheaper. – Chris Stratton Feb 10 '17 at 16:16

Switching of USB data communication is doable with relays, but not with the selected G3MB SSR type. The G3MB SSR does not specify any parasitic capacitance of output contacts, and list minimum 100 mA as operating current.

For USB signals to work "great" at HS rates, the pin parasitic capacitance must be under 5pF, and ON resistance of the signal switch must be less than 2-3 Ohms.

There are relays that work for USB signaling, including SuperSpeed rates (5Gbps), like Coto 9800 series or Meder CFR05 or Panasonic ARJ or Teledyne S172 types. These relays are designed to provide 50 Ohm controlled impedance along the switched line. To make them work at USB speeds, the PCBs must be designed with controlled differential impedance of 90-100 Ohms, and the screw-in terminals (as shown) will definitely not work for HDD. In addition, this kind of relays are pricey, form $10 to$100+ each.

More, for this switch to really work with any USB, the VBUS also must be turned OFF and ON when switching, so the connected USB device (HDD) can go into non-enumerated state, and be freshly recognized/enumerated by new USB host after the switch. The VBUS switch can be done by any type of relay, since there is no high-speed requirements.

In short, the selected SSR will NOT work great for USB HDD.

• Thank you for your reply. This allowed me to see more clearly when you want to relay with the high frequencies. It's not as simple as making connections between two wires as I might think. I think I will unplug / reconnect my HDD. Or creates a relay "mechanical USB" – kiki67100 Feb 16 '17 at 15:56