How do USB charging and "smart" charging ports (e.g. Anker's PowerIQ) work?

There are two additions to the USB specification that allow for more than 500mA current.

usb battery charging specification 1.1. Allows for up to 1.3A.

usb battery charging specification 1.2 (and this). Allows for up to 5A.

Summary:

  • USB 2.0 - BCS 1.1: 1.3A current, no data transmission.
  • USB 2.0 - BCS 1.2: 5A current with data.
  • USB 3.0 - BCS 1.2: 5A current handling but current limited to 1.5A, no data.

More can be found here

Edit: Sometimes the manufacturer doesn't follow the standard and uses something proprietary. Sometimes the "something proprietary" would be to just let the data pins hanging in the air or at a certain voltage and then provide an arbitrary amount of current...


In practice, 'smart' chargers use a special chip called a Dedicated Charge Port Controller. A DCP controller can act like different chargers, and picks the mode which seems to work best.

That's because regular ('dumb') wall chargers use USB's data connections to signal in a static, analog way what they are capable of. 'Smart' chargers can do the same, but in a less static way: they watch the behaviour of the charging device, and deduct from that the ideal setup -- which they can then emulate.

Examples of dedicated charge port controller chips are the Texas Instruments TPS2510 series 'USB Charging Port Controller', Maxim MAX14600 series 'USB Host Charger Identification/Adapter Emulator' and Norelsys NS3601 'USB Fast Charging Port Controller'.

An image from the TPS2513a datasheet (copyright TI): TPS2513A data sheet showing DCP capabilities

An similarly, the MAX14600 (copyright Maxim): MAX14600 data sheet showing DCP capabilities

You can see that the USB data lines ('DP' and 'DM') have several configurable resources on them, and these are controlled by some 'smart' logic.

Some explanation

Different chargeable devices require different kinds of chargers. This is partly because the USB specification did not specify 'charging' behaviour initially, and partially because some manufacturers want their devices to only charge at their quickest on their own wall plugs. Also, a device may not draw more current than what it can assume to be allowed, to avoid the risk of overheating an incorrectly designed power source.

Note: the below explanation ignores USB3, USB Power Delivery, and Qualcomm Quick Charge technologies, which complicate matters even more (e.g. they support increasing the voltage above 5 Volt).

These types of USB sockets can be distinguished:

  • Regular USB port (like on a PC). This is called SDP, Standard Downstream Port. An SDP supplies up to 100 mA, and may boost that limit up to 500mA if the connected device nicely asks for it, and the USB host agrees that it's possible and allowed.
    • In practice, nearly all SDPs deliver 500mA even without proper communication. USB gadgets like small fans and mug heaters don't communicate, but still require more than 100mA.
  • USB port with communication capability and additonal charging functionality. This is called CDP: Charging Downstream Port. This one can supply up to 1500mA. Non-communicating downstream devices can let this know to the charger by connecting the USB data lines D+ and D- with a resistance or with a short.
  • The Chinese Telecommunications Industry Standard YD/T 1591-2009 predates and inspired the CDP spec. It specifies a short between D+ and D-.
  • USB port without communication capability (such as in a wall plug). This is called DCP: Dedicated Charging Port. It's basically a CDP without the means to talk to the USB host (PC).
  • DCP ports which don't follow the DCP specs (from USB Battery Charging sepcification version 1.2). These wall plugs have varying setups of resistors connected to the data lines, resulting in fixed voltages which can be read by the charging device. The list of 'recognizable' voltages is very long, this is just an excerpt:
    • Apple 0.5A (D+ at 2V, D- @2V)
    • Apple 1A (2V / -2.8V)
    • Apple 2.1A (2.7V / 2.0V)
    • Apple 2.4 A (2.7V / 2.0V)
    • Sony (3.3V / 3.3V)
    • Many (incl. Samsung) 2A (1.2V / 1.2V)

'Smart' chargers -- i.e. the 'DCP controller chips inside them -- can emulate a standard DCP port with varying resistor values, and can also emulate several of the non-standard DCP voltages.

The secret sauce

The chip manufacturers don't really describe how their 'detection' logic works, but the only option they have is to monitor what the charging device is doing on the D+ and D- lines, and to look at the current that is being drawn.

This no doubt requires a lot of trial-and-error research, and the algorithm is probably kept as a closely guarded secret.

One technique which might be used, is to cycle through the emulated states and noting the amount of current that is drawn. The state with the highest current draw then is the 'best' and remains active.

Side note

Don't be confused by the marketing of the charger manufacturers which claims that a chargers "delivers the maximum current for the device". A USB socket is a voltage source; it only controls the voltage and it's the charging device which 'decides' how many current it 'takes in' while charging.

So there is no way a charger can 'force' a current into a device that does not accept it, at least not by staying below the safe maximum 5.1 Volt.

The only thing going on is some trickery to make the charging device believe that it's connected to the most capable, best-suitable, most compatible charger it can imagine.

Further links

  • https://en.wikipedia.org/wiki/USB
  • http://lygte-info.dk/info/USBinfo%20UK.html
  • http://www.ti.com/lit/ds/symlink/tps2514a-q1.pdf
  • https://datasheets.maximintegrated.com/en/ds/MAX14600-MAX14618.pdf
  • http://www.norelsys.com/English/chanpinzhongxin/SMARTPOWER/2015/0601/123.html

I'm just a software engineer, too, but part of my job involves reading the USB spec documents. Here's what I know:

There are two official protocols for power over USB. The first, BCD, was released in 2007 and updated in 2010. It uses various data line tricks to identify how much power the downstream device is allowed to sink. This doesn't have to be a full USB handshake. For instance, a dedicated charger identifies as such just by shorting D+ to D-. That indicates that the downstream device can sink up to the max charging current, which I believe is 1.5A. You can read the BCD spec here.

The newer protocol is PD (Power Delivery), which is distributed as part of the main USB specification. PD is really interesting. It allows for power information to be exchanged over the voltage lines rather than the data lines, and it can support up to 100W (20V / 5A). However, high power applications require the cable to be marked electronically to indicate that the cabling can support high voltage / high current without melting. :-) There are several "markings" defined in the spec, but they all seem to involve dropping either a resistor or a capacitor between two pins in the plug.

That said, the likelihood of any cable or charger actually implementing the entire spec correctly seems pretty low. You can follow the exploits of Benson Leung on Amazon.com to see just how many ways manufacturers have found to screw this up.

I don't know for sure, but I think it's very likely that marketing labels like "PowerIQ" are indicating chargers that try to achieve compatibility with as many devices and cables as possible, including ones that are hopelessly nonstandard. Unfortunately, there's no good way of telling how close any particular charger gets to that ideal.