How USB Charging in iProducts Works

This may seem tirade-ish, and if so I’m sorry. This was spurred by the story posted here at TUAW. Basically, there’s a little USB pass through dongle that you can buy to eliminate your iPad “not charging” woes. TUAW kind of misses the boat on bothering to explain or understand it, so here’s how it works, in comment-on-the-article form (so read the article first):

It’s got nothing to do with size of the dongle or weight of the iPad or the price of tea in china. Either the “NASA Scientist” mentioned is misquoted or is confused about the function of the device (i.e. thinks it’s a battery backup like a juicepack), both equally likely.
The USB spec (old as sin, every computer made since 2000 or before knows this part) says that a device can have 100mA, period. These days, that’s nothing. Things will charge from it, but slow as syrup. And they won’t say they’re charging. It also says, ‘if you want more, ask.’ That is, use the USB data lines to request a greater current. If the USB host says “ok,” you can draw a maximum of 500mA. Again, every computer since time supports this half amp.
But that’s still not all that much when you consider an iPad, with its huge battery capacity. So if the iPad gets here, it tells you “sorry, not charging [fast]” (I added the ‘fast’ part, that’s what it means). If it can negotiate for an amp or more, as can be provided by lots of modern computers, and all modern macs, perfect. Charging at 1A/5V is 5W which theoretically means around a 5 hour full charge. Awesome. Given how batteries charge, it’s probably more like 3/2 that time, but whatever. And if it can negotiate 1.5A, even better still.
But what if it’s not plugged into a DATA port, but just a dumb provider of 5V, like a wall socket?

Technically, in order to obey the USB spec, if it didn’t negotiate for > 100mA, it can’t have >100mA If it tries to draw more than 100mA and it’s attached to a USB port with a power supply line that legitimately can’t provide it, the result is a drop in voltage on the line, and bad things happen. Maybe it’s connected to a 5V supply that can handle 40930485 amps, it doesn’t matter. It’s just not allowed.

Of course, most things can supply at least 500mA, and to be sure, lots do regardless of negotiation. If I plug a dumb little USB fan or whatever else into my computer, it may use more than 100mA. Technically it’s not within the USB spec in this case, but whatever. So basically, you’re safe drawing up to 500mA from a USB port without asking, although you probably won’t get USB certification.

But of course, with a dumb charger, if you want to be within spec, you can’t just *go* and draw what you like. There has to be some other methodology. iDevices for a long time have employed resistors on the data(+) and data(-) lines of the USB port to handle this. LadyAda tore apart a few chargers to figure this out, and she found something like this: if you want the iDevice to take 500mA, hold data+ at ~2.8v and data- at ~2.0v . edit: sorry, I didn’t read the LadyAda page well enough, 2.8/2.0 is 1A, and 2.0/2.0 is 500mA. If you want it to charge at 1A, do something similar but with different values.

Finally, there’s the more recent USB Charging spec. The pertinant part here is that on modern devices, you’re within the letter of the USB spec if you short data+ and data- together as a message to the device, “you can draw any current you like, from 500mA to 1.5A.”

And something like that is going on here. It could be one of two different things. It’s definitely safe to say that on the male USB plug, only V+ and GND are attached. That way there’s no data negotiation at all. On the female side, it’s possible that resistors are in place as in the paragraph above to tell the iDevice “I’m a dumb charger, draw 500mA.” Although I lean away from that conclusion, since I BET that in such a case, the iDevice would still warn about too little current to charge. The other option is that, as per the Charging spec, the lines are shorted together. That’d technically tell the device “draw whatever,” but I THINK that iDevices only draw 500mA in this case, which like I said is generally safe. And it could be that the iPad draws an amp, and the dongle just hopes that most users’ computers will be able to handle it.

The bottom line is this:

The dongle is not magic! It doesn’t make power out of nowhere. It doesn’t matter that it’s small and light, or that the iPad is big and not. The takeaway here is that the dongle skirts the letter of USB law to say “computer, give me all you’ve got, whether you like it or not” and to tell the iPad “here’s all the power you desire!” Maybe it works across the board, maybe not, but I’ll definitely tell you I won’t buy one. I’m 100% positive that if I stick that thing in my late 2008 MBP (with its 500mA max of usb current, yes, I tested the hard way), I’m DEFINITELY getting an overcurrent USB warning. And if I don’t, the thing’s not helping anyway.

EDIT: I forgot to mention, but it’s worth doing so, you can’t simply tell the device “you have an amp” if you don’t, in fact, have an amp to back it up. It won’t just fall back to 500mA, that’s not how Ohm’s Law (v=ir) works. If the device tries to draw an amp, one of two things NECESSARILY happens. Either the computer CAN support the draw, but doesn’t SAY so (in which case, there’s certainly good reason it doesn’t say so, and good reason you shouldn’t be drawing an amp), or the computer CAN’T support the draw, and the USB bus fires an overcurrent warning and the power rail is shut down. And no charging at all takes place. In no case is it a good plan.

UPDATE: For shiggles, I did some quick testing with my USB breakout cable. As per LadyAda’s findings, my iPhone 4 with a nearly-full battery draws around 575mA from it’s in-package wall charger, stock configuration. Stock configuration has data+ at 2.8 and data- at 2.0, which is what you’d expect from a charger UL rated for 1A supply. Similarly, when I disconnect the charger’s data lines entirely, and instead show the phone 2.0v/2.0v, I measure a draw of around 510mA. Again, that’s what I’d expect. I’d also expect to see that, charging full swing, it draws more connected to 2.8/2.0, but I’ll have to wait until I have a low battery to test.

8 Comments

  1. Matt
    August 18, 2010

    Having read the TUAW post, and subsequently this one, I’ve got two things to say:
    1. The TUAW blogger basically wrote a non-article (seems to be a lot of that happening), and
    2. I’m very pleased to read an article with some actual groundwork, research and therefore credibility in alex’s article above.

    Quite frankly if someone takes it upon themselves to spout their observances out to the world, they should at least ensure that what they’re spouting is something that either genuinely informs us or saves us from doing the research ourselves, or both, as opposed to idle speculation.

    Good one Alex – thank you. Perhaps TUAW should give you a job instead.

  2. August 18, 2010

    Bahaha, thanks! Better comment than I was expecting for a rant post. Queue the torrent of flames now.

  3. wpns
    August 23, 2010

    Thank you Alex for adding some engineering to this mess!

    [Is it still possible that the iDevices are measuring voltage and impedance, so you could get two parameters (Thevenin equivalent voltage and resistance) from each data line? I suspect it’s just voltage today…]

  4. August 23, 2010

    You couldn’t measure both. Measuring impedance would require applying a voltage, which would kill whatever voltage you tried to read.

  5. bleh
    January 14, 2011

    theres no reason you couldnt measure both voltage and impedance. Just be smart about where you are taking the voltage measurement from.

  6. January 14, 2011

    If I have a simple two terminal black box, there’s no way to measure both a voltage that it’s generating and it’s internal resistance at the same time. Doing the latter requires applying a voltage, or at least applying a current source. You can’t do both at once. The best you can do is to switch between measurements so rapidly it seems like they happen at the same time, and the faster you switch, the more battery you burn.

  7. Javie
    September 21, 2012

    Nice! Just discovered this. Good job, Alex, as always.

  8. Devin
    January 21, 2013

    Great Article!

Leave a Reply

Your email address will not be published. Required fields are marked *