1
\$\begingroup\$

I want to add an on/off switch to a USB cable as easy alternative to plugging/unplugging a keyboard.

What difference between:

  1. Adding a switch only to a red (VBUS) wire.
  2. Adding a switch to a red (VBUS) and a black (GND) wires.
  3. Adding a switch to all wires (VBUS, DATA-, DATA+, GND).

What is the safest solution?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

Usually this is implemented in (cheap) USB hubs by switching VBUS. (in fact I have a hub that does just that). Since most keyboards designs will most likely shut down (because they use VBUS as a power source) if VBUS voltage drops or is disconnected that is the best way.

Adding a switch to ground is unnecessary and could create common mode noise through extra resistance.

Adding a switch to all wires is also complicated because the switch would need to preserve the 90Ω characteristic impedance of the data lines (if not you get reflections noise and data loss. You would need to be able to find a 90Ω switch for both data lines (or transistor switches/buffer)

\$\endgroup\$
2
  • \$\begingroup\$ for low speed devices impedance matching is less critical. \$\endgroup\$ Commented Jun 30, 2021 at 23:22
  • 1
    \$\begingroup\$ I've got low speed designs that have a hard time communicating with good matching. \$\endgroup\$ Commented Jun 30, 2021 at 23:25

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.