How to get more than 100mA from a USB port
I heard that the current limit for a USB port is 100mA. However, I also heard that some devices can get up to 1.8A from a port. How do you get past the 100mA limit?
I added a long post trying to explain what goes into each group. If you need 1.8A the short answer is that a computer will not do it.
@reemrevnivek, this was discussed down below, every computer I have used will **not** deliver 1.8A. I have used a couple that would even shutoff the port if there was too capacitive of a load and you violate the input rush current.
I think I can attempt to clear this up.
USB by default will deliver 100mA of current (it is 500mW power because we know it is 5v, right?) to a device. This is the most you can pull from a USB hub that does not have its own power supply, as they never offer more than 4 ports and keep a greedy 100mA for themselves.
Some computers that are cheaply built will use an bus-powered hub(all of your USB connections share the same 500mA source and the electronics acting as a hub use that source also) internally to increase the number of USB ports and to save a small amount of money. This can be frustrating, but you can always be guaranteed 100mA.
When a device is connected it goes through enumeration. This is not a trivial process and can be seen in detail on Jan Axelson's site. As you can see this is a long process, but a chip from a company like FTDI will handle the hard part for you. They discuss enumeration in one of their app notes.
Near the end of enumeration you setup device parameters. Very specifically the configuration descriptors. If you look on this website they will show you all of the different pieces that can be set. It shows that you can get right up to 500mA of power requested. This is what you can expect from a computer. You can get FTDI chips to handle this for you, which is nice, as you only have to treat the chip as a serial line.
This is where things get interesting. You can purchase a charger that does outlet to USB at the store. This is a USB charging port. your computer does not supply these, and your device must be able to recognize it.
First, to get the best information about USB, you sometimes have to bite the bullet and go to the people whom write the spec. I found great information about the USB charging spec here. The link on the page that is useful is the link for battery charging. This link seems to be tied to revision number, so I have linked both in case the revision is updated people can still access the information.
Now, what does this mean. if you open up the batt_charging PDF and jump to chapter three they go into charging ports. Specifically 3.2.1 explains how this is gone about. Now they keep it very technical, but the key point is simple. A usb charging port places a termination resistance between D+ and D-. I would like to copy out the chapter that explains it, but it is a secured PDF and I cannot copy it out without retyping it.
Summing it up
You may pull 100mA from a computer port. You may pull 500mA after enumeration and setting the correct configuration. Computers vary their enforcement, as many others have said, but most I have had experience with will try to stop you. If you violate this, you may also damage a poorly design computer (Davr is spot on there, this is poor practice). You may pull up to 1.8A from a charging port, but this is a rare case where the port tells you something. You have to check for this and when it is verified you may do it. This is the same as buying a wall adapter, but you get to use a USB cable and USB port.
Why use the charging spec? So that when my phone dies, my charger charges it quickly, but if I do not have my charger I may pull power from a computer, while using the same hardware port to communicate files and information with my computer.
Please let me know if there is anything I can add.
The document you linked to specifies a resistance of "maximum 200 Ohms", which is basically a description of a short.
@AndreKR, I believe it has to be a measurable resistance if you want an IPhone to use it, that is how iPhones originally had their own separate chargers.
For Apple products, things are a bit more complicated: http://www.ladyada.net/make/mintyboost/icharge.html
Kortek, I challenge your statement " USB by default will deliver 100mA " If the USB HUB if designed for 500mA per hub it has no default limit per port it will deliver all as needed and available. So each port can consume the max but all the ports shared by that hub must not exceed the same max. limit defined in the above screenshot. So **there is no default 100mA limit** unless by hardware design, that hub is a legacy 10yr old design when peripherals all consumed < 100mA.
@TonyStewart, it is my understanding that by spec until enumeration is complete you can only be guaranteed 100mA. The fact that it is common for a device to allow 500mA does not mean I would want to design my devices to immediately trust 500mA is available, I would instead design to wait for enumeration to complete. I am open to learning that I can do otherwise though. Many of my links that I have given list that as a requirement of the standard.
Although in theory one should not pull more than 100mA unless you've enumerated, this limitation is rarely enforced in practice. I've seen only one laptop that did this. 99% of devices I've seen provide 500mA at least and likely more, no enumeration needed.
@GustavoLitovsky This has been discussed in detail, this probably varies by computer maker but I have seen multiple that enforce such a rule and do you really want to explain to a customer your product is not working because of their computer?
@Kortuk: You have to take into account that adding chips that enumerate is a large expense in some cases, so for many it didn't make sense for a long time.
@GustavoLitovsky Yes, I realize the associated cost, it just seemed worthwhile to explain what the spec demands. You could edit in a section explaining what the computer side must do and why it can be skipped, sounds like fun to me, but for now I think this explains what your device must do to get power pretty thoroughly.
*Some computers that are cheaply built will use an bus powered hub internally* is there a typo or just I can't understand? Shouldn't it be "USB" instead of "bus"?
@clabacchio I clarified. I mean bus powered. they literally have an unpowered USB hub inside them to give you your ports, this means that none of your USB ports can deliver more then 100mA as they are really all ports on an unpowered USB hub.
@AndreKR your Apple products charging link is broken. Here's a working one: http://learn.adafruit.com/minty-boost/icharging
This answer contains misleading information, and better be corrected (due to high traffic). Any normal USB **HOST** port must be capable to supply 500 mA of current, See Section 7.2.1 of USB 2.0 specs, or Section 11.4.1 of USB 3.1 specs. So any non-USB gadgets can use 500 mA (or 900 mA on USB 3.0) without much hesitation. The 100 mA non-enumerated limit must be obeyed by **USB DEVICES**, so the limit is not applicable outside USB framework. The rare exceptions form 500 mA limit are small **battery-powered USB hosts**, who can limit themself to 100 mA per port.
You can negotiate for 500mA with one of the FTDI USB chips, here's a forum post that talks about it. If you use some other chip, you still need something that can speak the USB protocol and tell the PC that it wants 500mA. Please don't violate the USB spec, your device might work fine for some people, but then it wont work for others, and you risk causing damage to poorly designed PC's.
The theoretical current limit on a bus-powered USB port (the kind in your computer) is 100mA, negotiable up to 500mA. In practice, you probably won't get as much from the ports on your computer. If you use a self-powered USB hub however, you should be able to get 500mA from every port on the HUB. So if your HUB has 4 ports, you can get 4 * 500mA = 2A.
Beware: make sure your HUB comes with a decent power adapter. Some hubs come with a 1A adapter, because manufacturers think it's an unrealistic scenario for users to draw 500mA from EVERY port.
Check out this wiki article: http://en.wikipedia.org/wiki/USB_hub#Power
Small correction: limit is 500 mA for USB 2.0 (load unit is 100 mA and maximum is 5 load units). On USB 3.0, load unit is 150 mA and maximum is 6 load units, so that's 900 mA. Computers usually do not support 1.8 A. You could get that much by placing a resistor between data wires (to signalize that device is only using power and not transmitting data) and use USB cell phone charger or similar device dumb power source.
Do self-powered hubs require you to negotiate to higher current levels? I'll have to go home and take mine apart to see what the circuit is...
@Kevin - yes, you have to negotiate the 500mA even when you re using a self powered hub. How else would the end device know how much it is allowed to draw from the port. It cannot tell until the enumeration process is complete whether the socket that it is connected to can supply the requested current.
@Ian - Yeah, I understand that the spec would work that way, but my (now 1-year-old) investigation of two self-powered hubs I have indicates that the PSU circuit (or rather, the switch in the barrel jack) makes the power available to the device regardless of whether the device negotiates or not. Seems like a cost-effective and reasonable deviation from spec to me.
As far as I know, no one actually bothers to include current limiting in the USB host, so devices are really on the honor system not to draw more than they are allowed. I've seen a lot of devices that claim one power but actually draw a lot more, and I've never seen them shut down or anything. On a desktop, at least, I assume the ports are capable of more than 500 mA.
So if you're making a product that will be used by others, read the USB spec and learn how to negotiate with the computer to draw up to 500 mA. If you're just doing a one-off and you know for some reason that the port is capable of 1.8A, then just draw it.
In reality, many electronics manufacturers still do not strictly adhere to the USB 2.0 specification by not implementing these current limits in the USB ports that they provide. Some (read: most) USB ports allow 100mA regardless of enumeration and continued activity; some ports even offer 500mA irrespective of the required power negotiation. - Maxim
My Samsung phone requests a MaxPower of 2 mA, but then draws ~250 mA no matter what it's plugged into.
I have actually found the opposite. Almost every computer I have used will disable the USB port if too much power is drawn. They don't necessarily do it based off how much you have requested, but they do have a max current that once hit will notify the OS and shut off the port. Windows will even pop up a message notifying the user that this has happened. In my experience it takes a reboot of the computer for the port to be re-enabled.
@Kellenjb - I've seen this behavior as well, but usually only on laptops where power consumption is a concern. Further, while the computer monitors the power consumption, it often doesn't actually shut the port power off, it just uses the USB control channel to tell the device to power down. They often have polyfuses in line to prevent huge power consumption, but those are often 1A or greater. So one can still pull a significant amount of current from the port, though windows might complain about it.
I've seen the message in Windows, too, but only from a current spike, not continuous draw. The USB spec has restrictions on both.
I have seen this from both. current spikes and overcurrent. Current spike detection seems to vary by computer pretty heavily, but overdrawing current has made most every computer i have used turn it off.
We have some 6 year old Dell desktops used in a student lab. We have had students all of the time pull too much current and have the USB port shut down until a restart occurs.
On my laptop, a dead (shorted) USB device caused all devices on the bus to shut down, but removing the malfunctioning device seem to fixed the problem. Linux dmesg mentioned overcurrent shut down.
On my Macbook pro, I can draw 500mA without even asking, without ill effects. Same with the powered hubs coming from the Dell desktops at my school (and my powered hub for my laptop). Neither computer issues a warning message of any kind.
I that it differs from motherboard supplier how good the power supply for the USB is. Some cheap B-brand manufacturers may just link the +5V of the power supply down to the USB port. Some better ones may actually include the whole package for overcurrent protection etc.
I got a sweex 4-port (el-cheapo, costed me like 10 euro's) USB hub so I don't have to get under the desk all the time for an USB connection. This sweex port clearly doesn't have any protection. I have smoked shorted MOSFET with it once, which its rated current was 3A.
Anyway, my point I want to make is that no matter what your project is, you probably will not want to get over 500mA of current drawn from a USB port. As a one off, maybe.. if you want to risk blowing it up on your own behalf. Certainly not for anyone else.
I'd like to think that the power provided by USB is mainly to make it possible to have communication with the real device. You might feature an isolation circuit to give better protection for USB hosts. I'd certainly not take USB as a universal 5V power supply, because adapters can do that much better (and in the long-term probably cheaper).
Adding to the excellent advice from Kortuk:
You should really use a powered hub or a "USB charger" for debugging since you do not want to fry your computer by accidentally shorting something.
All computers I had pleasure with do not bother with limiting current draw below 500mA. (with or without enumeration)
jpc I agree, but your age is showing....USB was just avail when Win98 was out, and everyone was self powered, just needed hub power to do negotiations with drivers.
The most voted up answer contains misleading information, and better be corrected (due to high traffic).
Any normal USB HOST port must be capable to supply 500 mA of current, See Section 7.2.1 of USB 2.0 specs, or Section 11.4.1 of USB 3.1 specs.
The USB 2.0 specs says, page 171:
"Systems that obtain operating power externally, either AC or DC, must supply at least five unit loads to each port. Such ports are called high-power ports."
Note the language, "at least". So any non-USB gadgets can use 500 mA (or 900 mA on USB 3.0) without much hesitation.
The 100 mA non-enumerated limit must be obeyed by USB DEVICES, so the limit is not applicable outside USB framework. The rare exceptions form 500 mA limit are small battery-powered USB hosts, who can limit themselves to 100 mA per port.
You can't draw 1.8A from the PC's USB directly. However if you need the high current and connected to the PC at the same time, consider investing in a hub that have it's own supply from the mains.
Yes you can. USB specifications don't impose an upper limit on how much a port can supply. See Section 7.2.1 of USB Specifications. It is up to designer of USB **HOST** system to decide. A USB device, however, has no rights to take more than 500/900mA; this device will be non-compliant, technically illegal.
The above 100 mA current upto 500 mA can be negotiated by the device driver. However some devices may not get configured properly at boot time if your BIOS has an option titled: "Enable legacy storage" under USB settings. If this setting is off - you may find yourself re-plugging the device after booting up, in case if it does not work properly. Only with this setting on, if present, the BIOS will provide a current greater than some minimum value, I think 100 mA.
A brute force method may be to get a two male USB to one female USB cable for extra power. CAUTION: may have electrical / power draw safety issues.
Mr 404notFound, Sorry to say you cannot increase the limit in a USB device. It is limited by design.
Some early hubs were limited to 100mA, now all hubs are 500mA and with USB3 ports 900mA is available.
Good news is you can find out what your ports are rated for. If older than 5 yrs some may be 100mA, but newer than that, I doubt it.
If running Windows... go to >Device Manager > hardware > USB Hub (pick any) > property (rt mouse)> power
I hope this helps!! sorry about the fuzzy image.. this is a Mac .. you can see 500mA per port and the device connected = 0mA It has a built in current meter, what it doesn't do is make it easy for you to identify which physical hub and port it is referring to. I found moving a mouse to each port the easiest way to identify, but my learned colleagues may know a faster way.
BTW All the USB hubs are protected by automatic resettable polyfuses from short circuits. But I have seen at least one motherboard with blown electrolytic caps near the USB ports due to current surges, detected with the traditional popcorn bulging lid.
Yes I captured a high resolution image remotely on a Win7 tower and resized onto a low resolution Mac Air and enlarging turned out fuzzy, If you needed more resolution, I could have matched pixel resolution on this Mac by disabling autoscale, but that was hindsight and it wasnt essential. Beside it left some thinking why/how I was using a Mac to report about Windows Current monitoring features. The whole process took 1 minute. Besides with Windows 3rd party Apps I can easily see dpi and xy image sizes and edit. On OSX you need an expensive program to do it or use primitive Preview.
If just resizing makes it that fuzzy you really need a decent image processing software! :-/
Hey have you seen the USB spec? Their images are just as fuzzy as mine. See Figure 19-3 for example on Device Mgr. I agree thats why I said expensive program.. ( please not Gimp) .. Thats why I love Irfanview owned by Corel now. instant anything including adobe addons.