# Drawing 100mA / common ground for a bus-powered USB hub

I am trying to provide an external 5V power supply to a (previously) bus-powered USB hub.

My first attempt at this was to just connect the USB host's data pins to the hub's data pins, and the external 5V to the hub's power pins, like so:

PSU 5V  ----- Hub VCC In
PSU GND ----- Hub GND In
Host D+ ----- Hub D+
Host D- ----- Hub D-


However, the hub (and attached devices) were not detected by the host PC. My assumption was that as the Host GND and Hub GND were no longer connected, the levels were off, so I added that connection:

PSU 5V  ----- Hub VCC In
PSU GND ---=- Hub GND In
Host GND--/
Host D+ ----- Hub D+
Host D- ----- Hub D-


Still no luck. I then read that a USB host expects a device to draw around 100mA in order for it to be detected, so assuming that the host would output 5V, I added 50R of resistance between it and the host GND so that 100mA would always be drawn:

PSU 5V  ------ Hub VCC In
PSU GND ----=- Hub GND In
Host GND -=/
|
50R
|
Host 5V -/
Host D+ ----- Hub D+
Host D- ----- Hub D-


In this configuration, with the host PC and the PSU turned on, I measure 70 mV across the resistor and zero resistance. When I unplug the USB cable from the host, I measure the 50R properly.

Am I missing something here? Why would the USB host not detect the hub, and why would it appear to short its own 5V and GND pins?

Note: I have read this question, in which the answers suggest that just connecting the ground lines would be enough, and this one, which confirms my belief that it's OK for the USB hub to just draw 100mA and not negotiate for its current requirements.

USB doesn't have Tx and Rx, it has D+ and D-. These need to be connected by name (so D+ to D+ and D- to D-)

If you connected these the wrong way round it's possible the host will shut the port down to prevent damage. You shouldn't need a resistor from Vcc to GND anyway, the host doesn;t need to have 100mA drawn to detect a device, it detects it with a pulldown of one of the datalines)

If the hub has a separate supply, then you just need to connect the ground lines - you don't want to connect Vcc together. Obviously if it doesn't you need to power it from the host supply (i.e connect both)

• On the D+/D- thing, I used the wrong terminology in my question - too much RS232 on the brain. I'll update it. I haven't manually crossed the wires over, so I'm confident that they are the same way around now as they were before I hacked the cable apart. The hub is a bus-powered type, so the only power input was from the USB host, and now is from the external PSU. I haven't connected the Host 5V and the PSU 5V in any way. Thanks for letting me know that the resistor is unnecessary, that at least removes one potential cause of the problem! – Ian Renton Aug 20 '12 at 13:37

Any USB device that connects to a computer tells the computer about its power requirement and generally USB HUB is bus powered. This is hard programmed in firmware. After connecting to the host computer long data stream flows bet hub & host. Only after proper information is exchanged bet the two, host recognizes the hub. So I think it will be difficult to change the situation just by changing connections.

I then read that a USB host expects a device to draw around 100mA in order for it to be detected

Plain wrong. A device may draw up to 100mA without telling the host. A self-powered Hub should draw next to nothing from the Host (Upstream) port.

an external 5V power supply to a (previously) bus-powered USB hub

The Hub will still tell the (Windows) Host that it is Bus-Powered. So the Host will power it down once the sum of the connected devices (including the Hub itself) is over 500mA.

You should really use a self-powered Hub.

• Ah okay, I didn't realise that bus-powered and self-powered hubs actually report themselves differently to the host. That being the case, it's definitely a good idea to try a self-powered hub! – Ian Renton Aug 22 '12 at 21:40