EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: eeguy on May 24, 2020, 01:35:29 pm

Title: What does the usb hub do?
Post by: eeguy on May 24, 2020, 01:35:29 pm
Hi, on the market there are some hubs that are powered and there are some they don't. I read that if I want to drive hard disks or power hunger devices, powered hub is recommended. Just curious:

1. Given that usb devices are connected together either directly or indirectly to the laptop, why we need to supply power to the hub?
2. Besides offering more ports, what is the purpose of hub? Does the number of hubs matter? Given that I need to drive several power hunger devices, what is the different between using 1 powered hub vs. 2 or more powered hubs?
3. If one hub is powered and it is connected to other hubs and all these hubs are connected to power hunger devices. Do I need to power the other hubs or that one powered hub will share the power with the others?
Title: Re: What does the usb hub do?
Post by: ataradov on May 24, 2020, 04:50:01 pm
1. Because USB port on the laptop itself can only supply limited amount of power by itself. The power supply is not to power the hub, but to power the connected devices.
2. Makes no difference as long as total consumption is within the specs of everything.
3. All hubs that have high-power devices connected to them must be powered on their own.

Each USB port has maximum current specification. Even if the hub is powered, you still can't draw more than a certain amount from each individual port. So connecting more hubs hoes not magically replicate that power to all ports of the new hub.
Title: Re: What does the usb hub do?
Post by: eeguy on May 24, 2020, 06:30:28 pm
Thank you.

1. Buy limited amount of power, you mean limited current from your last statement. Please correct me if I am wrong.
3. Supposing that I have two hubs each of which has four ports. Each port connects to four power hunger devices. In this case, what are the differences between the following two approaches? What are the pros and cons of each? Is approach b) not being able to provide as much current as approach a) and if I use the same fully charged batteries for each hub, approach b) can only supply half as much current as approach a)?

a) separate power source for each hub (seems to be the one you suggested in 3)
b) both hubs share the same power source.
Title: Re: What does the usb hub do?
Post by: ataradov on May 24, 2020, 06:35:12 pm
Current. Voltage is fixed in USB (if you don't consider more recent standards, which are completely nuts). In USB 2.0 each port can supply up to 500 mA.

If you have 4 ports, each consuming 500 mA, you would need a 2 A power supply. If you share it between the hubs, it would need to be 4 A power supply. If your power supply can deliver 4 A, then there should be no issues sharing it between the hubs.
Title: Re: What does the usb hub do?
Post by: Nusa on May 24, 2020, 06:40:17 pm
https://en.wikipedia.org/wiki/USB_hardware#Power
Title: Re: What does the usb hub do?
Post by: eeguy on May 24, 2020, 06:45:32 pm
Current. Voltage is fixed in USB (if you don't consider more recent standards, which are completely nuts). In USB 2.0 each port can supply up to 500 mA.

If you have 4 ports, each consuming 500 mA, you would need a 2 A power supply. If you share it between the hubs, it would need to be 4 A power supply. If your power supply can deliver 4 A, then there should be no issues sharing it between the hubs.

Thanks. Since for LIPO less mAh means smaller and lighter, perhaps better to use two smaller mAh but higher C value LIPO for each hub rather than one big mAh but smaller C value LIPO shared by more than a hub? Since all the devise are somehow connected either directly or indirectly, will there be issues if the batteries are of different capacities? Perhaps better charge them at the same time?
Title: Re: What does the usb hub do?
Post by: ataradov on May 24, 2020, 06:47:55 pm
What batteries? There is no configuration where you directly connect batteries to the USB. Also mA and mAh is not the same thing.
Title: Re: What does the usb hub do?
Post by: Nusa on May 24, 2020, 07:10:40 pm
Sounds like you might be confusing USB charging ports that can deliver 1 or 2 amps (something industry did outside of the USB spec) with computer USB ports that are only required to deliver 500 milliamps. You only use USB hubs with computer ports, since that's the specification they're designed for.
Title: Re: What does the usb hub do?
Post by: Raj on May 25, 2020, 04:27:54 am
sounds like an xy problem http://xyproblem.info/ (http://xyproblem.info/) (got the link from some other eevblog user...Thank you )
Title: Re: What does the usb hub do?
Post by: eeguy on May 25, 2020, 11:28:47 am
What batteries? There is no configuration where you directly connect batteries to the USB. Also mA and mAh is not the same thing.

Thanks.

I mean LIPO batteries that can charge devices through a usb cable.

Yes, I was talking about mAh. If I recall correctly, the larger the mAh the larger and heavier the batteries while larger C means higher discharge rate. So if I don't like heavy batteries and I only use the devices for a short period of time, I wonder if it is better to get two smaller batteries with smaller mAh and larger C rather than one larger mAh battery with smaller C.
Title: Re: What does the usb hub do?
Post by: Nusa on May 25, 2020, 12:58:31 pm
So long as whatever you select meets the demand of the devices you haven't specified, you're the only one who can decide what's best for you.
Title: Re: What does the usb hub do?
Post by: ataradov on May 25, 2020, 05:20:15 pm
Can you actually describe what are you doing? The whole conversation about battery capacity is pointless, you don't connect batteries directly to the USB connector.  There is usually a boost converter with a regulator. And this changes things a lot.

So read that XY problem site, and describe your actual final goal.
Title: Re: What does the usb hub do?
Post by: eeguy on May 25, 2020, 05:26:14 pm
Current. Voltage is fixed in USB (if you don't consider more recent standards, which are completely nuts). In USB 2.0 each port can supply up to 500 mA.

If you have 4 ports, each consuming 500 mA, you would need a 2 A power supply. If you share it between the hubs, it would need to be 4 A power supply. If your power supply can deliver 4 A, then there should be no issues sharing it between the hubs.

Hello, what are you referring "it" to when you wrote "If you share it between the hubs..."? Could you please explain why 4A?
Title: Re: What does the usb hub do?
Post by: ataradov on May 25, 2020, 05:28:35 pm
Hello, what are you referring "it" to when you wrote "If you share it between the hubs..."? Could you please explain why 4A?
I meant the power supply. And 4A is the current it should be able to deliver to fully power 8 USB ports.
Title: Re: What does the usb hub do?
Post by: eeguy on May 27, 2020, 06:51:17 pm
Thanks. I have a usb hard drive that requires plugging in of two usb cables from a laptop. Very inconvenience.


Now I am considering a project to control many motors from a PC. I know that the USB port is not powerful enough to drive the motors. I will use LIPO batteries. What are the pros and cons of the following power distribution approaches:

1) PC to USB adapter to a central hub with X ports. Each of the X ports connects to a separate smaller hub that has Y ports. Each of the Y ports connect to some motors. For example, if X is 4 and Y is 2, there will be four smaller hubs each has 2 ports.

2) PC to USB adapter to a smaller hub with Y ports. Each of the Y ports connects to a larger hub which in terms connects to some motors.
Title: Re: What does the usb hub do?
Post by: ataradov on May 27, 2020, 06:56:49 pm
What does motor power has to do with USB power? You can power the control MCUs from the USB and they will control the power to the motors from the battery. Use whatever configuration of hubs you like, it does not matter.
Title: Re: What does the usb hub do?
Post by: eeguy on May 27, 2020, 07:26:34 pm
Thanks. No relation between motor power and usb power. In 2), will there be different between supplying external power to the smaller central hub from supplying individual external power separately to each of the larger hubs?
Title: Re: What does the usb hub do?
Post by: ataradov on May 27, 2020, 07:31:24 pm
You don't need powered hubs for that. If all you are attaching is just a few MCUs controlling motors, then you should be fine with a plain port power.
Title: Re: What does the usb hub do?
Post by: Raj on May 28, 2020, 04:36:42 pm
Thanks. I have a usb hard drive that requires plugging in of two usb cables from a laptop. Very inconvenience.


Now I am considering a project to control many motors from a PC. I know that the USB port is not powerful enough to drive the motors. I will use LIPO batteries. What are the pros and cons of the following power distribution approaches:

1) PC to USB adapter to a central hub with X ports. Each of the X ports connects to a separate smaller hub that has Y ports. Each of the Y ports connect to some motors. For example, if X is 4 and Y is 2, there will be four smaller hubs each has 2 ports.

2) PC to USB adapter to a smaller hub with Y ports. Each of the Y ports connects to a larger hub which in terms connects to some motors.
Hopefully, you'll post us a schematic so we can mitigate some explosions from happening.