Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pulling 500mA from USB port

Status
Not open for further replies.

hadoque

New Member
Hi, I'm working on a project where I need to get a 5V 500mA power source from the computer. Usually no problem, just connect it to the hard-drive power cables. The problem is I wan't to use my laptop, which only has a couple of USB ports.
Does anyone have any experience in doing this? I know 100mA is easy to get, but I'm probably gonna need all 500mA.
 
It technically violates the USB specs, the USB device is supposed to 'request' more power units with the HOST and the HOST has to authorize it. No idea what happens if you just try to draw the current without asking for it. Try it and find out, but don't be surprised if it doesn't work or your hurt something.
 
AFAIK, if you just try and draw more than 100mA the host will shut down the port.

You must first draw less than 100mA, then request full power. If the host can allow this, it will be granted and you can start using the extra. If the host does not grant it, the slave MUST NOT try and draw it, otherwise it will be shut down.

The actual process of requesting the extra current I don't know though. :(

Edit: A quick google brought up this:
https://www.beyondlogic.org/usbnutshell/usb6.htm
On the same site I also found this:
https://www.beyondlogic.org/usbnutshell/usb5.htm#ConfigurationDescriptors
I'd suggest you research about Offset 8, bMaxPower in the Configuration Descriptors table. (Second link)

Good luck.
 
Last edited:
Laptops often don't support the full 500mA spec for usb ports.
Better to use a powered usb hub.
It is bad design to draw the full power rating from usb ports.

A good example of the problems that it can cause was highlighted by a usb DAB digital radio made by Psion, called a "Wavefinder" that was sold in the UK several years ago.
It was notoriously unreliable on pcs with some usb chipsets that either would not work at all or kept shutting-down the ports after a while.
 
picasm said:
Laptops often don't support the full 500mA spec for usb ports.
Better to use a powered usb hub.
It is bad design to draw the full power rating from usb ports.

Well, I don't think I'm going to use all of the 500mA. The device I'm building has a 500mA fuse on the power cord, so aiming towards the possebility of getting 500mA should give me enough power. I guess I'll just have to try if the laptop can handle it.
 
And it will shut down at 200ma for sure. You have to build an intelligent USB device that can request more current. An external powered Hub will often supply the full 500ma or more as they usually ignore the current request.
 
I found an IC, LM3525, that seems to be the thing. I've just ordered it, so I'll get back to ya when I've experimentet some with it.
**broken link removed**
 
that IC has nothing to do with how much power a usb host will give you, it is merely a power switch for a usb port, most likely designed to be installed on the host side.

everyone has pretty much spelled it out to you - the HOST controls how much current you can have, no manner of circuitry external alone will yield the device more current from a single connection. The device can ask for more power, and must accept whatever the host is willing to give it, that is; the device must fail gracefully if the host will not provide the current the required.

one work around is to connect to multiple ports in parallel ... lets say you have two ports where the unenumerated over current limit is 100%, therefore each port provides up to 200ma. Those two ports in parallel will give you 400mA.
 
justDIY said:
that IC has nothing to do with how much power a usb host will give you, it is merely a power switch for a usb port, most likely designed to be installed on the host side.

everyone has pretty much spelled it out to you - the HOST controls how much current you can have, no manner of circuitry external alone will yield the device more current from a single connection. The device can ask for more power, and must accept whatever the host is willing to give it, that is; the device must fail gracefully if the host will not provide the current the required.
Ok, I get that the host controls the power. What I'm asking is how to construct a device so that it asks for more power. I thought that IC did that, but I guess I missunderstood.

I found this kit that might fit though.
https://www.sparkfun.com/commerce/product_info.php?products_id=8376
That must work, right?
 
It looks like that kit will only work from powered hubs - I.e. It won't request the extra power, it only seems to have a regulator for the 3.3V.
 
yngndrw said:
It looks like that kit will only work from powered hubs - I.e. It won't request the extra power, it only seems to have a regulator for the 3.3V.
Yeah, you're right. Well, this whole thing seems difficult. Better do my homework properly. Thanks for the help everyone.
 
the easiest way is to get the current:

buy a four port usb 2.0 hub and build it into your project. it will request 500mA from the host as it is a bus powered hub and that is what they're allotted ... 100ma for the hub logic and 100ma x 4 for the downstream ports. you can then steal probably 450ma from the hub and it won't care - more than that and the hub logic could lose power and reset the bus or something else funky.

if that doesn't work for you, you'll need a USB microcontroller (pic 18f2550) and program it to do the 500ma handshake.
 
justDIY said:
the easiest way is to get the current:

buy a four port usb 2.0 hub and build it into your project. it will request 500mA from the host as it is a bus powered hub and that is what they're allotted ... 100ma for the hub logic and 100ma x 4 for the downstream ports. you can then steal probably 450ma from the hub and it won't care - more than that and the hub logic could lose power and reset the bus or something else funky.

if that doesn't work for you, you'll need a USB microcontroller (pic 18f2550) and program it to do the 500ma handshake.
Ok, thanks alot for the advice. Seems like it's a lot of work in any way, maybe I'll just buy a net adaptor instead... :)
 
I'm not sure about how much current you can get from it but you can use power from a mouse or keyboard ps2 port.
 
blueroomelectronics said:
What's a "net adaptor"?
Oh, I guess it's a faulty direct translation from swedish. I'm not sure what it's called in english, but it's the little black box that transforms 220V AC to , for example, 5V DC.
 
Yeah, a DC power supply would be the most intelligent idea. ;)
 
hadoque said:
Ok, I get that the host controls the power. What I'm asking is how to construct a device so that it asks for more power. I thought that IC did that, but I guess I missunderstood.
The amount of current is requested by setting a value in one of the descriptors.
 
Status
Not open for further replies.

Latest threads

Back
Top