22
\$\begingroup\$

Software engineer with a hobbyist understanding of EE here.

I've noticed lately lots of claims from producers of USB battery packs that their ports are "smart" and "identify the device" to "deliver the maximum current for the device." A cursory look into the matter seems to imply that this isn't completely marketing language, and there is actually something more complicated going on.

Not understanding the subtle chemistry of lithium-ion batteries or the nature of charge controllers, I would guess that to charge a battery as quickly as possible, you would draw as much current as possible, limiting it only to the battery specs. This must not be the case, since it is documented that devices limit their charging to 1A in some cases, when surely they could draw more. Why is this?

If the current draw is so controlled, what's going on with these smart ports to enable the device to draw more current? From a product page for an Anker battery, they claim their ports identify the device and "speak its unique charging language" (that phrasing makes me nauseous). Maybe I shouldn't react so harshly to that phrasing though - are the USB data lines actually used to negotiate some charging pattern?

Thanks!

\$\endgroup\$
  • 2
    \$\begingroup\$ The D+ and D- lines negotiate with the device to see what kind of power can be delivered. Different manufacturers want different signals on them such as shorted, high impedance, pull ups or pull downs. There are a variety of ICs that do this automatically. They are called dedicated charging ports. \$\endgroup\$ – ACD Jul 15 '14 at 21:18
  • \$\begingroup\$ I think it goes a bit deeper than that. The pull-ups on the D+ or D- lines are there simply to signal to the host that a device has been connected and whether it is full-speed, high-speed, etc. \$\endgroup\$ – kjgregory Jul 15 '14 at 21:22
  • \$\begingroup\$ I agree. That's why I wanted to post a comment versus an answer. I'll be following closely to see if someone knows more about this. \$\endgroup\$ – ACD Jul 15 '14 at 21:49
  • 2
    \$\begingroup\$ See electronics.stackexchange.com/questions/26838/… \$\endgroup\$ – pjc50 Jul 16 '14 at 11:20
  • \$\begingroup\$ It's not about charging the battery, it's about making the battery charger (which is inside the device) recognize that it's allowed to use lots of power from the USB port. \$\endgroup\$ – immibis Jul 28 '16 at 4:55
14
\$\begingroup\$

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...

\$\endgroup\$
  • 7
    \$\begingroup\$ And then there are companies like Apple who make chargers that ignore all standards and implement their own proprietary device ID scheme: learn.adafruit.com/minty-boost/icharging \$\endgroup\$ – RJR Jul 16 '14 at 10:23
  • \$\begingroup\$ That Adafruit article is a really good read, expecially considering that the USB specs are quite dry. :) \$\endgroup\$ – Kevin Wood Jul 19 '14 at 0:54
  • \$\begingroup\$ Yeah there's more to this than just amps (which are also relevant) - some chargers appear to send messages to their own devices telling them they can request more rapid variable charging currents - based on the state of the battery. (ref: Qualcomm Quick Charge etc). iPhones do not yet support this technology. \$\endgroup\$ – niico Oct 19 '15 at 13:02
  • \$\begingroup\$ @RJR Also Sony and TomTom, apparently. \$\endgroup\$ – endolith Jul 27 '16 at 21:26
8
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ You got one thing backwards. It is not that "The Chinese Telecommunications Industry Standard YD/T 1591-2009 is compatible to CDP", it is the late Battery Charging specifications were made compatible with Chinese standard, which de-facto the charging standard long before BC specs. \$\endgroup\$ – Ale..chenski Feb 6 '18 at 19:21
3
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

(old topic, but new information based on latest USB spec.)

As already mentioned, the new USB specifications do allow for higher than 5V charging voltage, if the device requests it.

Under the "USB Power Delivery" (PD) extension (USB PD rev. 3.0, ver 1.0a now), up to as much as 5A at 5V, 9V, 15V, or 20V can be provided to the attached device, with a maximum of 100W sourced. There are many rules the "requesting device" must follow for these cases.

This would typically be for notebook computers or other devices that have higher cell counts and/or operating voltages. The cables must also be designed and specified to handle these conditions.

(yes, I am an EE... for over 35 years)

\$\endgroup\$
  • \$\begingroup\$ I think you only need PD-aware cables when using 9V or more? \$\endgroup\$ – jiggunjer Dec 28 '16 at 5:41
0
\$\begingroup\$

I share your nausea at that language, however, I agree that there is likely some truth behind this matter. USB devices declare themselves based on vendor, product, and device IDs so that the host can recognize what is being connected and treat it accordingly (ex: finding the appropriate driver). Furthermore, I'm not a battery expert, but I've been exposed enough to know that Li-ion batteries have some strange charging requirements to avoid overheating. It's not unreasonable to think that a USB product could negotiate a more optimal charging pattern as is described here given that it is interfacing with a tailored driver or product on the other end.

An example of a Li-ion charging pattern that I have seen is constant current until battery voltage reaches 4.0V followed by constant voltage until the battery reaches 4.2V. Perhaps different batteries have different patterns (again, I'm not a battery expert).

\$\endgroup\$
  • 4
    \$\begingroup\$ The charging control is always done in the device, not in the "charger", which always outputs 5V. \$\endgroup\$ – pjc50 Jul 16 '14 at 11:21
  • 2
    \$\begingroup\$ Devices, mainly cell phones, that are charging do not enumerate. If they enumerate, they think they are connected to a PC and most will limit themselves to 500mA at that point (Except iDevice on Mac computers cause apple added in hardware and kernel changes to allow higher charging). \$\endgroup\$ – Passerby Feb 6 '16 at 2:04
  • \$\begingroup\$ @pjc50 I am skeptical of your claim. Some chargers advertise "smart voltage" that compensates for voltage drops. I also imagine a charger can restrict the amount of current a device can draw if it does not meet certain specifications... \$\endgroup\$ – jiggunjer Dec 28 '16 at 5:47
0
\$\begingroup\$

[...] there is actually something more complicated going on.

Yes. In short, smart ports use hacks of non-standardized charging mechanisms to achieve optimal currents. The common assumption that all USB devices base their charging protocols solely on the USB spec or the BCS extension is false.

Many USB chargers only have 'dumb' floating data pin ports described by the BCS, aka DCPs, Dedicated Charging Ports.

A smart port can act like a dumb port (DCP) or it can emulate several proprietary ports in case the USB/BC spec isn't supported or optimal. This emulation may break down in certain scenarios and cause problems, which is why each brand of smart-charger tries to distinguish itself in terms of reliability, speed, and compatibility. Making them may involve some reverse engineering.

Ideally, 'smart' chargers wouldn't be needed and all devices would use the same charging standard. If it's not a host/charger it recognizes a device may:

  • Charge slowly
  • Not charge at all.
  • Charge at the standard USB specification (not BCS) speed (i.e. 5 power units for a full-power USB device, 1 for low-power, 5 for a non-enumerated power-only connection). This is normally slower than its max.
  • Charge at the BCS speed, then they could pull as much as 5A from a DCP. Though I've never seen more than 3A advertised for a single port. This may still be slower than what it could do with its own charger.

[...] what's going on with these smart ports to enable the device to draw more current? [...] are the USB data lines actually used to negotiate some charging pattern?

Kinda, depends on which charging spec you're looking at. I believe Apple uses the data lines, but nothing complex happens, they're just set to 3V to indicate it's an Apple charger.

The DCP isn't the only charging port described by the BCS. Some (few) devices prefer to require enumeration (i.e. using the data pins handshake) and so need a CDP (charging downstream port) which is more complex because it allows data transfer in addition to charging. I suppose a port that is fully BCS compliant, i.e. can switch between CDP and DCP, could be considered 'smart' even if it doesn't emulate any other technologies.

I would guess that to charge a battery as quickly as possible, you would draw as much current as possible, [...] surely they could draw more. Why is this?.

Correct, but only if the charger meets their specs, otherwise I guess they just don't trust it. Or maybe it has to do with competition and patents, or algorithms that optimize battery life. I think the how is more interesting than the why though.

\$\endgroup\$
-1
\$\begingroup\$

I'm not an EE either. (Also a software engineer with a well-read hobbyist's understanding of electronics.)

It's my understanding that the convention is that normal USB devices will draw a maximum of 500 mA, no more. Anything more is a violation of the USB standard.

"Smart" USB chargers include solid state logic with serial communications chips. When you plug in a device that wants higher current, it sends a query to the power supply saying something to the effect of "I want 2 amps. Is that OK?" If the power supply is a dump USB port, it doesn't answer at all, so the device either doesn't work, or only draws the default 500 mA (and charges much more slowly.

\$\endgroup\$
  • 1
    \$\begingroup\$ Interesting... what is the protocol for this request? \$\endgroup\$ – kjgregory Jul 16 '14 at 0:46
  • \$\begingroup\$ No idea. This is just info I've read in trade mags. (Written by non-engineers, so not all that reliable.) \$\endgroup\$ – Duncan C Jul 16 '14 at 12:04
-1
\$\begingroup\$

I have a Samsung S5 phone and a Note 10.1 (2014 edition). I have an in-line USB meter that measures voltage, current, and maH. When one one these devices is connected to the OEM charger the charger output rises to 5.5 volts, and the charge current is about 1.6 amps. If I try this using a cheap wall wart rated at 1 amp, the voltage stays at 5.0 and it charges at 0.8 amps. I also have several battery-powered chargers. Most of them, though rated at 2 amps or more, provide only 5.0 volts and the charge current remains at around 0.8 amps. From this I conclude that the Samsung protocol is for the devices to request fast charging by one of the means stated above, and that the charger signals it is capable of that by raising its output to 5.5 volts.

\$\endgroup\$
  • 1
    \$\begingroup\$ That's your conclusion? That's like saying that because your car is using more horsepower than other cars, the road must be requesting more speed and the car is signalling that it is capable. \$\endgroup\$ – Bort Feb 7 '18 at 20:18
  • 1
    \$\begingroup\$ 5.5V is not "fast charging". It is not "signaled" for. The cheap chargers are just that: cheap. They don't offer the same current. The OEM charger can provide more current without dropping voltage. I'd bet that a more accurate reading would be found with a Fluke brand meter than a cheap inline USB meter \$\endgroup\$ – Bort Feb 7 '18 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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