0
\$\begingroup\$

Sorry if this a very basic question for you here. My background in electrical engineering is self-taught only and quite limited.

Basically, I wanted to design a simple device which does allow me to control (using a Raspberry Pi or Arduino) which "input" is connected to which "output".

For example, having one USB 3.0 input, and two USB 3.0 outputs (A, B), the Raspberry Pi should be able to control if the input is electrically connected to output A or output B or to none of both. Also the solution should not be limited to USB ports, e.g., it should in a similar way also work with RJ45 ports. If an input is not connected to an output it should not be powered.

I am basically looking for which electronic components I can used for the switching of the signals. My first idea has been to use (solid-state) (bistable) relays, but, using nine 9/18 relays to switch a USB 3.0 signal (9 pins) seams a little strange to me.

Happy for any suggestions you might have!
Thanks a lot & all the best!

\$\endgroup\$
1
  • \$\begingroup\$ You can't use relays (solid state or mechanical) to switch USB 3 signals. You need to treat the pairs as the high-speed differential transmission lines they are and use ICs which are made specifically for the purpose of switching them. \$\endgroup\$
    – brhans
    Commented Mar 14, 2022 at 14:30

1 Answer 1

2
\$\begingroup\$

design a simple device which allows me to control (using a Raspberry Pi or Arduino) which "input" is connected to which "output".

This is possible of course, but may not be particularly easy or newcomer-friendly. "The devil is in the details."

Also the solution should not be limited to USB ports, e.g., it should in a similar way also work with RJ45 ports. If an input is not connected to an output it should not be powered.

There is a lot more to this than may first appear.

RJ45 ports are (erroneously?) used for a plethora of things these days. Ethernet is still most common, but other (incompatible) uses exist, such as PoE, CAN bus, or even in-system-programming. Plug in the wrong thing (or design for only one thing), and poof.

Video can largely be "hot-swapped" (big can of worms here), but some keyboards (PS/2, older) do not like this and can actually be damaged. Hence, why an "active" role is taken in connecting and disconnecting devices - usually via some IC (integrated circuit) designed specifically for this task.

I am basically looking for which electronic components I can used for the switching of the signals. My first idea has been to use (solid-state) (bistable) relays, but, using nine 9/18 relays to switch a USB 3.0 signal (9 pins) seems a little strange to me.

As Brhans notes, USB3 are very high-speed signals. As such, even the length of the the wires matters because a longer wire introduces a tiny delay (which becomes critical at high speeds and will cause errors or failure.) So the wiring is length-matched. The details don't stop there... they also have to be a controlled impedance, to prevent reflections, and are considered a transmission line. Research these terms for more info.

I suggest you find an existing KVM switch (or a couple different ones, cheap, maybe eBay, old ones and new ones), take them apart, and study them. Research the datasheets for the IC's found inside and see what they do and how they are wired. Also study the history and current state of USB, video, keyboards, and anything else you'd like to switch. And once you've identified some IC's which could be used, search for Application Notes and examples for those ICs, even development boards.

\$\endgroup\$
1
  • \$\begingroup\$ Hi, rdtsc. Thank you very much for providing such a detailed and clear answer! I guess I underestimated the task, but I will have a look at your suggestions. \$\endgroup\$
    – raisyn
    Commented Mar 14, 2022 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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