I want to build a USB device that can draw 1A.

Some of the PCs at my office can supply 1A, some only 800mA. The USB 2.0 specification says a device can only draw up to 500mA.

I cannot build a software/hardware infrastructure to check if the device is a PC and, if so, to limit the current to 500mA.

What would happen if I try to draw 1A without checking if the host is capable of supplying this current? Does this risk ruining the host?

  • 1
    See electronics.stackexchange.com/a/5581/1276 . You need to make a request while enumerating your USB device for anything over 100mA -- and of course this request may be denied. Anything over 500mA can only be obtained through the USB3 Battery Charging or Power Delivery modes. – Chris Johnson Sep 15 '14 at 10:54
  • The USB spec requires that a host limits the current to a safe value (without mentioning a specific value). In most cases that is implemented by the current limit inherent in the PSU, or by a suitable polyfuse, in which cases drawing more current would not result in any damage. I am not sure a normal (melting) fuse is allowed, and that would of cause 'ruin' part of the host. – Wouter van Ooijen Sep 15 '14 at 13:52

USB 2.0 standard which permitted 100/500 mA was eventually extended with Battery Charging Specification which allows the device to draw up to 1.5A after it sees that the other side (the plug pack) is shorting D+ and D-.

Some PCs may be able to source more than 500mA, but it is not safe for them. And some will allow only 100mA prior to enumeration.

  • How is drawing more than 0.5A 'not safe for them'? – Wouter van Ooijen Sep 15 '14 at 13:12
  • 3
    @WoutervanOoijen For example they have a fuse rated slightly above 500 mA or the USB ports are fed from +5V_SB which can not safely provide more. – venny Sep 15 '14 at 13:17
  • Can you link me to the battery charging specification section you mention. I can't seem to find it. – ACD Sep 15 '14 at 13:37
  • @venny the USB spec requires that a master limits the current to a safe value, so in the second situation the host would be out of spec. When there us a fuse there is no safety issue. I am not sure a real (melting) fuse would be within the USB specs, I think not. – Wouter van Ooijen Sep 15 '14 at 13:49

Take a look at the USB charging specification.

There are numerous ways manufacturers today implement negotiation of USB currents. The standard USB way is, as was mentioned, requesting the current by message exchange with the USB host controller.

However, many devices don't bother with the complex USB protocol and just draw as much current as they require - until the supply voltage drops. That said, I guess that it's kind of safe-ish to ignore the USB specs without ruining (too many) PCs. Usually, the output voltage will just drop when too much current is drawn until it balances out. This can of course affect other devices connected to the same controller/hub/..., which will witness the unanticipated voltage drop.

Yet, one will have to consider worst-case scenarios; like when the user uses a cheap USB hub, plugging, say, four of your devices at the same time. Something like this is not unlikely to destroy the hub, its power supply, or both, and thus yields a risk of fire or other damage. Keep that in mind.

Recently, I discovered that one of my Android devices has an interesting detection mechanism for its high power charger: When idle, the charger will output something like 5.05V, just as any other USB port, but once the device is connected, the charger will raise the voltage to about 5.2V, which is still within USB voltage specs, and which lets the device know that it may draw the higher "fast charge" current (~1.2A).

When connected to a normal USB port, the voltage will be at or below ~5V and hence the device continues to draw "only" 440mA.

Maybe you can implement a similar technique.

USB2.0 specification allow a client to draw 500mA only upon request. That means that your device has to properly enumerate itself with the bus, prompt that request at the host and hope to get permission. In real life however most host ports allow the client to draw 500 mA without such a request (that is how and why all those Y-power cables for external HDD enclosures work.

But that would not be a reliable design on your part to depend on such an out-of-spec behavior. A powerline at the host might be protected by a fuse or polyfuse that is triggered by your device exceeding current limits or the port might even be destroyed.

I believe you may run the risk of damaging a USB host.

About four years ago, I ran an Arduino workshop for adults. Two people (at different times) 'destroyed' a USB output on two different Sony Vaio laptops. The USB sockets were plugged into the Arduino. After the accident, we tested the sockets with a USB mouse and, IIRC, USB keyboard to see if they had recovered.

We allowed the Vaio's to stand with power off, in one case more than 30 minutes, but the damaged USB socket remained 'dead', including to an ordinary USB mouse.

We never identified what they did, though they both said they may have accidentally connected wires to components on the Arduino PCB, and not just header pins.

They did not get in touch after the workshop to say the sockets were working or were still dead though. They were responsible adults, in contact with the workshop organiser. So I trusted they would have told us if the sockets had recovered, but who knows? I have always assumed the USB sockets stayed dead.

If the short was via the polyfuse, then that might indicate the USB host was not able to limit current. Unfortunately, IIRC, I put the Arduino's to one side, and worked on diagnosing the problem with the laptops. The Arduino's were not used until enough time had passed that their polyfuse may have reset. Or the polyfuse may have been bypassed, and I couldn't tell.

This isn't a very big sample, and gives no indication of current limit.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.