Keywords: USB, charger, charging, battery, Lithium, NiMH
The Basics of USB Battery Charging
Table of contents
An Array of Power Sources
Detecting the Source Type
USB Connection Terminology
Port Detecting and Self-Enumerating Charger
Adding Port Detection
Other Charge Strategies
"Cheating"—Noncompliant USB Charging
IntroductionUSB has become as much a standard for connecting power to portable devices as it has for serial communication. Recently the power aspects of USB have been extended to cover battery charging as well as AC adapters and other power sources. A tangible benefit of this wide-spread use is the emergence of interchangeable plugs and adapters for charging and powering portable devices. This, in turn, allows charging from a far wider variety of sources than in the past when each device required a unique adapter.
Arguably the most useful benefit of USB's power capabilities is the ability to charge batteries in portable devices. Nonetheless, there is more to battery charging than picking a power source, USB or otherwise. This is particularly true for Li+ batteries, where improper charging can not only shorten battery life, but also become a safety hazard. A well-designed charger optimizes safety and the user experience. It also lowers cost by reducing customer returns and warranty repairs.
Charging batteries with USB requires balancing battery "care and feeding" with the power limitations of USB and the size and cost barriers ever present in portable consumer device designs. This article discusses how to achieve this balance.
An Array of Power SourcesThe USB specification spans several generations of power management. The initial USB 1 and 2.0 specifications described two types of power sources (5V 500mA and 5V 100mA, respectively) for powering connected devices. These specs were not written with battery charging in mind, but intended only to power small peripherals like mice and keyboards. Of course, this did not stop designers from working out USB battery charging on their own. However, without a unified guide, interoperability between different devices and chargers was hit and miss. This limitation motivated the recent development of a supplementary USB specification, the Battery Charging Specification, Rev 1.1, 4/15/2009 (BC1.1),¹ that acknowledges charging and describes power sources that can supply up to 1.5A. Though titled "Battery Charging Specification," the document in fact contains nothing about the specifics of charging batteries. It deals only with how power should be drawn from a USB port for charging. Actual charging methods are still left up to the individual designs.
Prior to BC1.1, all USB power ports, when active (i.e., "not suspended," in USB parlance), were classified as either "Low Power" (100mA) or "High Power" (500mA). Any port could also be "suspended," which means nearly off but still able to supply 2.5mA. For the most part, ports on PCs, laptops, and powered hubs (A powered hub is a USB breakout box with its own wall wart for bus power.) are "High Power," while ports on hubs that receive no power other than what is supplied by the upstream USB host are considered "Low Power." Once plugged in, a device is allowed initially to draw up to 100mA while enumerating and negotiating its current budget with the host. Subsequently it might be allowed to raise its drain to 500mA, or it might be held at 100mA. This is detailed in the USB Serial Bus Specification Rev 2.0, section 22.214.171.124.
BC1.1 goes beyond the power distribution described in USB 2.0 by defining additional power sources for charging. It defines three different source types:
Detecting the Source TypeThe trick for a device that connects to any USB receptacle and uses that power to run itself or charge a battery, is knowing how much current is appropriate to draw. Attempting to draw 1A from a source capable of supplying only 500mA would not be good. An overloaded USB port will likely shut down, blow a fuse, or trip a polyswitch. Even with resettable protection, it will often not restart until the device is unplugged and reconnected. In ports with less rigorous protection, an overloaded port can cause the entire system to reset.
A portable design has choices about how to mange port detection. It can be compliant with BC1.1, compliant only with USB 2.0, or noncompliant. If fully compliant with BC1.1, it must be able to sense and limit input current for all USB source types, including legacy USB 1 and 2.0 ports. If compliant with 2.0, it will charge from SDPs after enumeration, but may not recognize CDPs and DCPs. If it cannot recognize a CDP, it can still charge and remain compliant but only after enumeration, in the same way that it would with an SDP. Other partially compliant and noncompliant charging schemes will be discussed later.
A device can implement port detection using its own software, or can employ a charger or interface IC that detects by interacting with the USB D+ and D- data lines without relying on system resources. The design's partitioning of these roles depends on the system architecture. For example, a device that already employs a microcontroller, or a dedicated IC, to manage power may prefer to use that IC for port detection and current selection as well. Since the device already can communicate with the host over the USB connection, it can make charging choices based on the results of enumeration and configuration. These choices can be under the control of an applications processor, or a separate microcontroller that might handle power management and other system functions. The system detects the port type, enumerates, and sends appropriate commands to a charger. The charger handles the hardware and safety aspects of charging, and has built-in limits that will not allow the system to harm the battery (Figure 1).
Figure 1. Nonenumerating charger. The USB transceiver and microprocessor handle USB enumeration. The microprocessor then sets the battery charger to the correct parameters.
A different device might not be designed to communicate with USB or does not want to devote system software to manage USB charging. It just wants to use available USB ports as a power source. This approach can be used to avoid complexity or in response to worries that a software bug might cause incorrect charging. Since the system does not enumerate, the best charging option is a self-enumerating charger IC. The charger takes care of port detection and selects the appropriate USB load current limit without requiring help from the system (Figure 2).
Figure 2. A self-enumerating charger connects directly to the USB data lines, allowing simple systems to fully utilize USB charging without a USB transceiver or microprocessor resources.
USB Connection TerminologyAt this point, some USB terms deserve clarification. They are "attach," "connect," "enumerate," and "configure."
Connect When the device (that you just plugged in) connects 1.5kΩ pull-up resistance to the D+ or D- data lines.
Enumerate The initial data exchange between the device and the host to identify device type.
Configure Set device parameters.
Port Detecting and Self-Enumerating ChargerThe MAX8895 determines how best to use available input power without relying on the system to evaluate the power source. The charger automatically determines the adapter type and can distinguish between:
In addition to automatically optimizing current from USB and adapter sources, the MAX8895 also deftly handles switchover from adapter and USB power to battery power; it allows the system to use all available input power when necessary (Figure 3). This enables immediate operation with a dead or missing battery when power is applied. All power-steering MOSFETs are integrated, and no external diodes are needed. Die temperature is kept low by a thermal regulation loop that reduces charge current during temperature extremes.
Figure 3. The MAX8895 charger self-enumerates with a USB source to optimally set charge current depending on the type of connected power source. It also can maintain system operation while bringing up a deeply discharged battery.
Adding Port DetectionBC1.1 describes hardware detection methods to determine port type. The expectation is that integrated circuitry will be used for this, as with the MAX8895 in Figure 2, or that this circuitry will be included in the USB transceiver. Nevertheless, adding port detection, or at least some subset of it, to an existing charger may sometimes be preferred. Figure 4 shows circuitry for a rudimentary USB charger detection scheme that operates under control of the system microcontroller. This approach can detect a DCP, but cannot distinguish between an SDP and a CDP. It treats both as an SDP, which means that in some cases it can miss the opportunity to draw more charging current from a CDP. This shortcoming may be acceptable in low-budget designs.
Figure 4. A Hi-Speed USB switch implements a limited form of USB charger detection.
The Figure 4 connection implements limited port detection as follows. When the portable device is attached to one of the three port types, VBUS powers the U1 switch and the device's microcontroller. A low logic level on U1's CB input puts it into detect mode, where the D+ line is pulled up to the system logic voltage through 10kΩ and D- is pulled to GND through 100kΩ. If a DCP is connected (which has D+ shorted to D-), then D- will go high. If either an SDP or CDP is connected, D- and the detect output will be low. If an SDP or CDP is detected, the system then drives CB low to put the switch into data mode, which connects D+ and D- to the data path for enumeration and other data transfer. There is a limitation of the above scheme: it will not recognize and, hence, not immediately charge, when attached to a CDP, although it will charge from a CDP after enumeration.
Complete port detection is shown in Figure 5. The MAX14578 contains all circuitry necessary to detect the connected device (USB cable, and USB CDP or dedicated charger) and control an external Li-ion battery charger. The device implements USB Battery Charging Rev 1.1-compliant detection logic which includes data contact detection, D+/D- short detection, and CDP identification. In addition, it includes a charge timer and weak-battery voltage monitor to support the USB BC1.1 "Dead Battery" provisions.
The MAX14578 includes a data switch that is compliant with USB Hi-Speed and original (full speed and low speed) signals. It features low on-resistance (RON), low on-resistance flatness, and very low capacitance. The CDN and CDP pins are also ESD protected up to 15kV per the Human Body Model.
Figure 5. Fully-compliant USB BC1.1 port detection can be added to a charger with the MAX14578 USB charging port detector and data-switch IC.
In Figure 6 simple Li+ charging functionality is added to a USB device. The MAX8814 can be configured to charge a battery from either 100mA or 500mA USB ports. The circuit initializes at 100mA. The microprocessor then enumerates the host to determine its current capability. If the USB port is capable, the charging current is increased by turning on N1 and R1 in the current-setting network. The high-level charge is nominally set to 425mA to avoid exceeding the SDP 500mA limit after tolerances are considered. The charger also includes an autobooting circuit that provides an output signal (ABO) that notifies the system when an external power source is connected. Although USB compatible, Figure 6 does not incorporate BC1.1 so enumeration is required for charging.
Figure 6. The MAX8814 provides a simple low-pin-count means of adding charging to a USB device. Enumeration is under the control of the system which monitors and controls charge current with the ISET pin. This design is USB compatible but does not incorporate BC1.1, so enumeration is required for charging.
Other Charge StrategiesThe landscape for USB battery charging can be complex. Portable USB-connected devices do not follow one format and are subject to a variety of constraints—size, cost, and charge time as the most obvious. Ranking these and other more subtle issues can help you choose a USB charger design. Among these additional design considerations are:
With BC1.1 it is possible for devices to charge only from USB-defined sources. Those devices are becoming more common, but still you may want to retain the option of charging with an ordinary, possibly non-USB-compliant, adapter. This is best accomplished with a dual-input charger that handles the switchover when one external power source takes over for another. In the past, power hand off was often done with either lossy OR-ing diodes or discrete MOSFET-comparator circuits that can become complex when "sneak" current paths and switch timing are considered. Fortunately, many charger ICs (Figure 7) now include power hand-off control. Integrating this function does more than simply replace external components. It also improves transition behavior during power changes because the integrated charger is aware of what the switchover circuitry is doing.
Figure 7. A dual-input charger like the MAX8844 handles charging from both USB and adapter sources. This device also protects against input overvoltages up to 28V.
A common concern with chargers that accept power from multiple sources, especially ones using a common barrel connector, is the possible connection to an incorrect adapter. To anticipate this, the MAX8844 prevents charging for inputs that exceed 7.5V. It can also withstand, as well as block, inputs up to 28V. This protects the battery, the charger, and downstream circuitry against inadvertent connection to almost any known adapter type. In addition, the MAX8844 includes overvoltage-protected LDOs, biased from the USB and adapter (IN) inputs, that can supply 30mA to the system. These LDO outputs (SAFEUSB and SAFEOUT) remain on whether or not the charger is enabled. Other charger functions performed by the device are battery detection; thermal limiting that reduces charge current to maintain a low die temperature during ambient temperature extremes; and an autobooting logic output that signals the system when external power is applied.
Battery-Load Switching (Smart Power) vs. Direct Connection
In USB and adapter-powered charging applications, a key design decision is whether the charge circuitry will connect directly to the battery and the system load, or whether additional switching is needed to disconnect the battery from the system when external power is connected. The two cases are illustrated in Figure 8.
Figure 8. Illustration of direct connection charging and Maxim's Smart Power Selector™ technology.
The direct-connection architecture is the simplest and most economical to implement. Its main drawback surfaces if the battery is deeply discharged and then external power is applied. In that case the system may not be able to boot until the battery reaches an acceptable level. In some applications it may be acceptable for a user to wait until the battery partially recharges before full functionality is restored; however, in other applications immediate operation at external power connection is a "must," regardless of the battery state. In those latter cases, Maxim's Smart Power Selector technology allows the system to use external power while the battery is in a deeply discharged state. See Figure 9.
Figure 9. A dual-input USB/adapter charger with Smart Power Selector functionality like the MAX8934 can power the system immediately when external power is applied while it also charges a dead battery.
In Figure 9 a low-resistance (40mΩ) on-chip MOSFET between the system load output (SYS) and the battery (BAT) serves multiple functions during charge and discharge operations. During charging, this Smart Power Selector switch makes the best use of limited USB or adapter power, utilizing input power not needed by the system to charge the battery. It also lets the battery serve as a storage buffer, supplying load peaks that may momentarily exceed the input current limit. During discharge, the switch provides a low-loss path from the battery to the system.
System software again handles communication with a USB host and sends commands to the charger. The MAX8394 manages the hardware aspects of charging and provides simple hooks for setting charge parameters relevant to USB and adapter charging. USB input current limits are preset to ensure that specified limits are not exceeded; a user-set current is used for adapters. The charger also supplies a complete set of status and fault signals to the system.
The MAX8934 includes the latest charging safety features, including new temperature-dependent charge protocols outlined by the Japan Electronics and Information Technology Association (JEITA) that halt or reduce charging at elevated temperatures. In addition, inputs have overvoltage protection (OVP) up to 16V and the device limits temperature rise by throttling charging current during extreme conditions.
Switch-Mode Fast Charges up to 2A with Minimal Heat
Some compact devices need high charge currents (well over 1A) but cannot tolerate the excess heat that those charge rates would generate in a linear charger. In those situations the MAX8903 (Figure 10) operates a 4MHz DC-DC converter that keeps the component footprint small while still delivering up to 2A to the battery from adapter sources. Like the MAX8934, the MAX8903 is a dual-input design that accommodates USB and adapter inputs through separate connections. Switchover between power sources is automatic, as is hand off between input power and battery power.
Figure 10. The MAX8903 switch-mode charger with Smart Power Selector capability charges at up to 2A from adapter inputs and 500mA from USB sources.
The MAX8903's 4MHz switching rate keeps the switch-mode converter's passive components tiny, so that a 2A charger made with this device can be smaller than a linear equivalent once the lower power loss is factored in. In fact, due to heat dissipation, most portable devices would not tolerate a 2A linear charger design under any conditions.
Overvoltage and Reverse-Polarity Protection Built In
Although the USB charging specification imposes some order on the power adapter and charger landscape, USB design remains a generally chaotic environment for portable devices, especially for those applications that opt to use the ubiquitous barrel connector for power (common on many adapter-only and dual-input devices). It is far too easy for consumers to connect a "found" adapter that may have the wrong output voltage or even the wrong polarity. By integrating positive and negative 22V protection at the charger power input, the MAX8900 adds piece of mind to these designs without requiring external protection devices or MOSFET switches (Figure 11).
Figure 11. Direct-connect switch-mode charger with ±22V overvoltage and reverse-polarity protection.
The MAX8900 is a direct-connect style charger with the system typically connected to the battery. Its 3.25MHz switch-mode design keeps components small while charging at up to 1.2A with minimal heat dissipation. In addition to bipolar input protection, battery safety is enhanced by adjusting charge parameters as a function of temperature in accordance with JEITA guidelines.
NiMH Charging from USB
Figure 12. A 1-cell NiMH USB-powered switch-mode charger.
Even though it seems that Li+ cells have taken over the portable world, NiMH cells have not been standing still. Surprisingly, NiMH energy per volume is only about 15% lower than Li+, although energy per weight is still quite a bit less. The biggest weakness of NiMH is its high self-discharge, which has largely been solved by hybrid NiMH cells, such as the SANYO® Eneloop® cell, that retain as much as 85% of their charge after one year. The attractions of NiMH cells are cost, safety, and easy user replacement, at least when standard cells are employed.
Figure 12 shows a small portable device that is powered from one AA NiMH cell and charges from USB. The DS2710 charger switches at approximately 150kHz and charges the battery at 1.1A (about 0.5°C for a typical AA NiMH cell). The circuit gets more current into the battery (1.1A) than is gets from the USB port (500mA) because a step-down ratio converts 5V at 500mA, to 1.5V at 1.1A at the battery. It should be noted that charging can occur only with 500mA or greater ports, since proper charge termination cannot be assured at low charge rates. Consequently, charging should not be activated when enumeration determines than only 100mA is available. The system deactivates the charger by turning off Q2 to float the timer resistor at TMR.
Another particularly useful feature of this charger is that it senses battery impedance to determine if an alkaline cell or a faulty battery is inserted. If that occurs, charging suspends. This allows end users to plug in an alkaline battery in an emergency and not worry about inadvertent charging.
USB 3.0The USB 3.0 spec brings still higher data rates to USB. The power aspects of the spec are similar to USB 2.0 except that a "unit load" is raised from 100mA to 150mA and a high-power port has to supply six, rather than five, unit loads. This means that a low-power USB 3.0 port can supply 150mA, and a high-power USB 3.0 port can supply 900mA.
"Cheating"—Noncompliant USB ChargingAs with any standard that is co-opted for purposes not originally intended, manufacturers sometimes ignored portions of the USB 2.0 requirements in order to provide at least a limited form of charging. One such noncompliant scheme used by a major manufacturer was to draw no more than 100mA under any circumstances, so that neither high- nor low-power hubs were overloaded. The downside of limiting current to this level was that battery charge time was long, but if the device spent a large part of the day docked to a USB port that might still be adequate. Besides a long charge time, there was another limitation to this approach: if the system had a dead battery, full functionality would be delayed until the battery reached a sufficient charge level.
Another aspect of noncompliant charging relates to the treatment of USB suspend. USB 2.0 stipulates that all devices must suspend (draw less than 2.5mA) after a set period of bus inactivity. Since charging was never included when this was written, there was no consideration for a device continuing to charge a battery while off, but still attached. However, since most USB hosts do not actually turn off power, this violation of the specification rarely prevented charging.
A bolder noncompliant scheme assumes that 500mA will be available and instructs users to plug only into powered ports and hubs that are capable of 500mA. Again, since most USB ports do not disconnect power, this approach can work in most cases. When such a device is plugged into a port that cannot support 500mA, the port is supposed to shut down. However, the overload behavior of a USB port is not always well defined and can lead to system reset or damage. Fortunately, this level of desperation is no longer required since battery charging is now an active part of the USB specification.
Wrap UpCharging from USB can take many forms, governed by the unique requirements of each USB device. The USB Battery Charging Specification. Rev 1.1 finally adds much needed uniformity to what was previously an ad hoc charging activity. The adoption of BC1.1 should lead to reduced cost for manufacturers and consumers, and greater interoperability as standard adapters emerge. Nevertheless, the USB guidelines only cover how power is to be taken from the port; they still leave power-management architectures and charging specifics open to interpretation. That is where Maxim's broad spectrum of charging devices becomes important, as they can help speed the design of safe and reliable battery chargers for nearly any USB-connected portable device.
The chargers that have been discussed are summarized in Table 1. They are only a small sample of what Maxim offers. For more choices, visit Battery Management.
Table 1. Representative USB Battery Chargers
¹The USB Serial Bus and charging specifications can be found at: www.usb.org/developers/docs/.
|DS2710||Single-Cell NiMH Charger||Samples|
|MAX14578AE||USB Battery Charger Detectors||Samples|
|MAX844||Low-Noise, Regulated, -2V GaAsFET Bias|
|MAX8814||28V Linear Li+ Battery Charger with Smart Autoboot Assistant||Samples|
|MAX8895X||Li-Ion Chargers with Smart Power Selector, Adapter Type Detection, and USB Enumeration|
|MAX8900A||1.2A Switch-Mode Li+ Chargers with ±22V Input Rating and JEITA Battery Temperature Monitoring|
|MAX8903A||2A 1-Cell Li+ DC-DC Charger for USB and Adapter Power||Samples|
|MAX8934A||Dual-Input Linear Chargers, Smart Power Selector with Advanced Battery Temperature Monitoring||Samples|
|EE-Mail||Subscribe to EE-Mail and receive automatic notice of new documents in your areas of interest.|
|Download||Download, PDF Format (282.9kB)|
|© Dec 09, 2010, Maxim Integrated Products, Inc.|
APP 4803: Dec 09, 2010
TUTORIAL 4803, AN4803, AN 4803, APP4803, Appnote4803, Appnote 4803