I'm building a switch that will power on / off a bunch of USB 2.0 ports. In order to avoid overloading the USB hubs (as has been an issue in the past) I would like to power and switch my peripheral device separately from the USB socket. The connection would look like this:

USB switch connection

I'm worried that there will be a difference in common mode voltages between the gnd / 5V from my power supply, and the D+/D- data. I have done some searching but I'm not sure what an allowable common mode voltage drift is, and how I could mitigate it.

Specifically my questions are

  1. How much do I need to worry about this common mode voltage?

  2. What should I do to compensate / protect this circuit, especially the USB socket?

EDIT: Thanks to the responses below, I will instead use this as a circuit:

Modified circuit

Hopefully this isn't pulling too hard on ground and overloading the USB socket!

  • 7
    \$\begingroup\$ Do not disconnect the ground. If you need to switch, switch Vcc only. \$\endgroup\$
    – Mark
    Commented Jul 19, 2016 at 2:22
  • \$\begingroup\$ @Mark is correct. Some USB control signaling (start of frame, as I recall) is actually single-ended, referencing ground. USB requires ground as well as D+ and D-. \$\endgroup\$
    – DoxyLover
    Commented Jul 19, 2016 at 5:44
  • \$\begingroup\$ Note: with the data lines connected straight through to the hub, the peripheral won't know it's not connected to the hub's power supply, which may or may not be important. \$\endgroup\$ Commented Jul 26, 2016 at 0:29
  • \$\begingroup\$ @immibis, sorry I'm not sure I follow. The peripheral will never be connected to the socket power supply, but I will "know" that it's not connected to the lower 5v supply when I switch it off. Am I missing something? \$\endgroup\$
    – MCM
    Commented Jul 26, 2016 at 15:25
  • \$\begingroup\$ @MCM I mean the peripheral might try to negotiate its allowable power usage with the hub, for example - if all your peripherals and the hub are well-behaved, you won't be able to supply more power than the hub allows, even though the power isn't actually coming from the hub. \$\endgroup\$ Commented Jul 26, 2016 at 21:09

1 Answer 1


Yes, your second schematics is correct, should cause no problem.

However, the remark about "start of frame" is not entirely correct. Start of frames are differential signals in FS and HS modes, and only LS "keep-it-alive" strobe is single-ended. However, the reference to ground is important when CONNECTING and disconnecting a USB device. Depending on which (D+ or D-) line goes to +3.3V at connect, the host determines if this is a FS or LS device, and acts correspondingly. If the connection goes via FS path, HS chirping protocol gets started. Therefore, you must maintain the reference to ground plane across all USB ports.

ADDITION: there could be only one issue. In USB, VBUS from host port is serving dual function - it also gives a logical signal to device that the port is connected, and it is time for connect handshake protocol. If you permanently supply VBUS to your device, it will think that it is always connected, and will pull D+ (or D-) high, regardless if the host is ready or not to accept it and start the connect handshake protocol. Some older USB hosts can be confused in this situation (connect signal is received BEFORE the port is initialized by host software), and hangs. To avoid this situation, you should connect the cable first to already active host, then plug the auxiliary power.


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.