Originally Posted By: K447
Originally Posted By: altman
... What appears to be the 1A resistor network is posted here:
http://www.instructables.com/id/Build-a-Battery-Powered-USB-Charger/
The main article in that link describes a circuit and lack of understanding that beggars belief.

For some reason the Internet seems full of incorrect or incomplete information and much misunderstanding when it comes to exactly how the various Apple USB chargers and iOS devices actually sense and manage battery charging.

I have the following information to offer.
When D- is 2V and D+ is 2V, it's a 500mA charging adapter (standard non-Apple USB 2.5 watt charger)

When D- is 2.8V and D+ is 2V, it's a 1000mA charging adapter (recent iPhone/Apple standard 5 watt charger)
When D- is 2V and D+ is 2.8V, it's a 2000mA charging adapter (iPad 10 watt charger from Apple, also compatible with iPhone)


As far as I can tell the resistor networks for the last two are the same as that posted by Robot Lover in the comments to the linked article, with the 1 amp capacity voltage signals on D+ and D- simply being swapped to indicate 2 amp charger capacity.



Recent iOS devices (I cannot comment about others as I did not test them) carefully balance current draw against voltage sag. An iPhone 4, for example, starts by sensing the voltages on D+ and D- and determining if it is connected to a dumb charger or an actual working USB host.


I can't remember the voltage levels used to indicate the charger spec, but that is indeed how it works.

The iOS devices don't "carefully balance current draw against voltage sag"; they will try to take the amount of current specced by the adaptor (though a phone won't take over 1A), but *may* back off if they see undervoltage events. A lot depends on the exact phone as there are different current controls schemes in each generation. Some generations had digitally controlled current limits and others had analog limits that are more predictable.

For "china bricks" (D+/D- shorted together at the charger end) there's an iterative process of stepping up the current limit, letting it settle, then trying for higher - the china spec says anything from 300mA to 1.5A is available so the device has to experiment.

Quote:

There are some special cases if the iPhone battery is completely drained or the device is turned completely off, but in general the iPhone will begin ramping up current draw while watching the available USB charging voltage at the iPhone 30-pin connector.


Well, almost. At the input to the charging buck, which tends to be about 200 milliohms away from the 30 pin. Also, they don't charge when off - it'll always start the CPU if sufficient external power is available. If you plug an iPhone in then turn it off, it's only pretending to be off (it's actually gone off, then come back up in a fake-off mode).

Quote:

If the power source is NOT an actual USB host (it is a dumb charger) then the voltage signals on D+ and D- pins define the maximum current the iPhone (or iPad) will attempt to draw. If the available charging voltage on the 30-pin connector sags too much, the iPhone will trim its current draw to maintain the USB voltage within bounds. Voltage sag can be caused by the USB to 30-pin cable conductors being too thin or too long, and of course by the capabilities of the charger to actually put out the current. Even a hundred millivolts can be a significant voltage swing here.


It's not that simple, as current changes across charging states and the system load always takes priority over charging current. Turning on the screen, CPU load, camera current, etc can cause the current to spike (though never above the configured maximum based on the charger ID) can cause instantaneous brownouts on the USB voltage, which are ignored in some cases.

Quote:

My measurements indicate that genuine Apple USB chargers are tightly voltage regulated and have output voltages right at the upper bounds of the USB '5 volt' specification, right around 5.250 volts if memory serves. This 'extra' bit of voltage partially compensates for voltage losses along the USB cable and connectors.


That's correct.

Quote:

Note: The lightning bolt icon in the battery symbol appears whenever the iPhone determines that the connected charging source can charge the iPhone, but does not necessarily mean the battery IS charging right this minute. A fully charged iPhone will actually stop charging the battery and actually allow the battery charge to decline a few percentage points before 'topping it up' again. The lightning bolt icon will appear during the entire time.

The lightning bolt also does not tell you how quickly the battery is being charged. As far as I know there is no way for the iPhone to actually display the charging rate.


Correct, it's not exposed.

Quote:

Note: I believe, but cannot find the link right now, that the most recent iterations of Apple computers (late 2011 models) can provide the higher 10 watt (2 amp) charging current that the iPad prefers and also support the USB protocol extensions to negotiate the larger current feed to the iPad.


Very possibly. I know the unibody macs added the 1A charging support in ... 2009? Whenever those came out.