Tiny, cheap, and dangerous: Inside a (fake) iPhone charger

Thoughts on the death of Ma Ailun

According to reports, a woman in China was tragically electrocuted using her iPhone while it was charging. This seems technically plausible to me if she were using a cheap or counterfeit charger like I describe below. There's 340 volts DC inside the charger, which is enough to kill. In a cheap charger, there can be less than a millimeter separating this voltage from the output, a fraction of the recommended safe distance. These charger sometimes short out (picture), which could send lethal voltage through the USB cable. If the user closes the circuit by standing on a damp floor or touching a grounded metal surface, electrocution is a possibility. If moisture condenses in the charger (e.g. in a humid bathroom), shorting becomes even more likely. Genuine Apple chargers (and other brand-name chargers) follow strict safety regulations (teardown) so I would be surprised if this electrocution happened with a name-brand charger. Since counterfeits look just like real chargers, I'll wait for an expert to determine if a genuine Apple charger was involved or not. I've read suggestions that the house wiring might have been to blame, but since chargers are typically ungrounded I don't see how faulty house wiring would play a role. I should point out that since there are few details at this point, this is all speculation; it's possible the phone and charger weren't involved at all.
I recently wrote a popular article on the history of computer power supplies, which led to speculation on what's inside those amazingly small one-inch cube USB chargers sold by Apple, Samsung, RIM, and other companies. In the interest of science, I bought a cheap no-name cube charger off eBay for $2.79, and took it apart. It's amazing that manufacturers can build and sell a complex charger for just a few dollars. It looks a lot like a genuine Apple charger and cost a lot less. But looking inside, I found that important safety corners were cut, which could lead to a 340 volt surprise. In addition, the interference from a cheap charger like this can cause touchscreen malfunctions. Thus, I recommend spending a few dollars more to get a brand-name charger.
A one-inch USB charger designed for the iphone4
The no-name charger I bought is just over an inch in length, excluding the Eurpopean-style plug. The charger is labeled "FOR iphone4. Input 110-240V 50/60Hz Output 5.2V 1000mA, Made in China." There are no other markings (manufacturer, serial number, or safety certifications). I opened up the charger with a bit of Dremel-ing. One surprise is how much empty space is inside for a charger that's so small. Apparently the charger circuit is designed for a smaller US-style plug, and the extra space with a European plug is unused. Since the charger accepts 110 to 240V input, the same circuit can be used worldwide.[1]
Inside a USB phone charger
The power supply itself is slightly smaller than one cubic inch. The picture below shows the main components. On the left is the standard USB connector. Note how much room it takes up - it's not surprising devices are moving to micro-USB connectors. The flyback transformer is the black and yellow component; it converts the high-voltage input to the 5V output. In front of it is the switching transistor. Next to the transistor is a component that looks like a resistor but is an inductor filtering the AC input. On the underside, you can see the capacitors that filter the output and input.
Internals of a USB phone charger
The power supply is a simple flyback switching power supply. The input AC is converted to high-voltage DC by a diode, chopped into pulses by the power transistor and fed into the transformer. The transformer output is converted to low voltage DC by a diode, filtered, and fed out through the USB port. A feedback circuit regulates the output voltage at 5 volts by controlling the chopping frequency.

Detailed explanation

In more detail, the power supply is a self-oscillating flyback converter, also known as a ringing choke converter.[2] Unlike most flyback power supplies, which use a IC to control the oscillation, this power supply oscillates on its own through a feedback winding on the transformer. This reduces the component count and minimizes cost. A 75 cent controller IC[3] would be a huge expense for a $2.79 power supply, so they used a minimal circuit instead.
The circuit board inside a tiny USB charger
The above picture shows the circuit components; the red boxes and italics indicate components on the other side. (Click for a larger picture.) Note that most of the components are tiny surface-mounted devices (SMD) and are dwarfed by the capacitors. The green wires supply the input AC, which is filtered through the inductor. The high-voltage 1N4007 (M7) input diode and the 4.7µF input capacitor convert the AC input to 340 volts DC.[4] The MJE13003 power transistor switches the power to the transformer at a variable frequency (probably about 50kHz). The transformer has two primary windings (the power winding and a feedback winding), and a secondary winding. (The transformer and inductor are also known as "the magnetics".)

On the secondary (output) side, the high-speed SS14 Schottky diode rectifies the transformer output to DC, which is filtered by the 470µF output capacitor before providing the desired 5V to the USB port. The two center pins of the USB port (the data pins) are shorted together with a blob of solder, as will be explained below.

A simple feedback circuit regulates the voltage. The output voltage is divided in half by a resistor divider and compared against 2.5V by the common 431 voltage reference device. The feedback is passed to the primary side through the 817B optoisolator. On the primary side, the feedback oscillation from the feedback transformer winding and the voltage feedback from the optoisolator are combined in the 2SC2411 control transistor. This transistor then drives the power transistor, closing the loop. (A very similar power supply circuit is described by Delta.[5])

Isolation and safety

For safety reasons, AC power supplies must maintain strict isolation between the AC input and the output. The circuit is divided into a primary side - connected to AC, and a secondary side - connected to the output. There can be no direct electrical connection between the two sides, or else someone touching the output could get a shock. Any connection between the two sides must go through a transformer or optoisolator. In this power supply, the transformer provides isolation of the main power, and the optoisolator provides isolation of the feedback of the secondary voltage.

If you look at the picture, you can see the isolation boundary indicated as a white line on the circuit board crossing the circuit board roughly horizontally, with the primary side on top and the secondary side below. (This line is printed on the board; I didn't add it to the picture.) The circles on the line that look like holes are, in fact, holes. These provide additional isolation between the two sides.

The UL has complex safety specifications on how much distance (known as "creepage" and "clearance") there must be between the primary and secondary sides to prevent a shock hazard.[6] The rules are complicated and I'm no expert, but I think at least 3 or 4 mm is required. On this power supply, the average distance is about 1 millimeter. The clearance distance below R8 on the right is somewhat less than one millimeter (notice that white line crosses the PCB trace to the left of R8).

I wondered how this power supply could have met the UL standards with clearance less than 1 mm. Looking at the charger case more closely, I noticed that it didn't list any safety certifications, or even a manufacturer. I suddenly realized that purchasing the cheapest possible charger on eBay from an unknown manufacturer in China could actually be a safety hazard. Note that this sub-millimeter gap is all that's protecting you and your phone from potentially-lethal 340 volts. I also took the transformer apart and found only single layers of insulating tape between the windings, rather than the double layers required by the UL. After looking inside this charger, my recommendation is to spend a bit more on a charger, and get one that has UL approval and a name-brand manufacturer.

Another issue with super-cheap chargers is they produce poor-quality electrical output with a lot of noise that can interfere with the operation of your phone. Low-cost ringing choke adapters are known to cause touchscreen malfunctions because the screen picks up the electrical interference.[7] In noticed several cost-saving design decisions that will increase interference. The charger uses a single diode to rectify the input, rather than a four-diode bridge, which will produce more interference. The input and output filtering are minimal compared to other designs.[8][9] There's also no fuse on the AC input, which is a bit worrying.

USB charging protocols

You might think USB chargers are interchangeable and plugging a USB device into a charger is straightforward, but it turns out that it's a mess of multiple USB charging standards,[10][11][12] devices that break the rules,[13] and proprietary protocols used by Sony and Apple.[14][15][16] The underlying problem is that a standard USB port can provide up to 500mA, so how do chargers provide 1A or more for faster charging? To oversimplify, a charger indicates that it's a charger by shorting together the two middle USB pins (D+ and D-). Proprietary chargers instead connect different resistances to the D+ and D- pins to indicate how much current they can provide. Note that there are a few unused resistor spots (R2, R3, R8, R10) connected to the USB port on the circuit above; the manufacturer can add the appropriate resistors to emulate other types of chargers.

Advances in AC power adapters

Early power adapters were just an AC transformer producing low-voltage AC, or add diodes to produce DC. In the mid 1990s, switching power supplies became more popular, because they are more compact and more efficient.[17] However, the growing popularity of AC adapters along with their tendency to waste a few watts when left plugged in ended up costing the United States billions of dollars in wasted electricity every year.[3] New Energy Star standards[18] encouraged "green" designs that use milliwatts rather than watts of power when idle. These efficient controllers can stop switching when unloaded, with intermittent bursts to get just enough power to keep running.[19] One power supply design actually achieves zero standby power usage, by running off a "supercapacitor" while idle.[20]

The semiconductor industry continues to improve switching power supplies through advances in controller ICs and switching transistors. For simple power supplies, some manufacturers combine the controller IC and the switching transistor into a single component with only 4 or 5 pins. Another technology for charger control is CC/CV, which provides constant current until the battery is charged and then constant voltage to keep it charged. To minimize electromagnetic interference (EMI), some controllers continuously vary the switching frequency to spread out the interference across a "spread spectrum".[21] Controllers can also include safety features such as overload protection, under voltage lockout, and thermal shutdown to protect against overheating,


Stay away from super-cheap AC adapters built by mystery manufacturers. Spend the extra few dollars to get a brand-name AC adapter. It will be safer, produce less interference, and your device's touchscreen will perform better.
Inside a inch cube cellphone charger

Notes and references

[1] Switching power supplies often take a "universal" input of 110V to 240V at 50/60 Hz, which allows the same supply to conveniently work on worldwide voltages. Because a switching power supply chops up the input into variable slices, the output voltage can be independent of the input voltage over a wide range. (This also makes switching power supplies more resistant to power brownouts.) Of course, designing the circuit to handle a wide voltage range is harder, especially for power supplies that must be very efficient across a wide range of voltages. To simplify the design of early PC power supplies, they often used a switch to select 120V or 240V input. Through a very clever doubler circuit, this switch converted the input bridge into a voltage doubler for 120V input, so the rest of the circuit could be designed for a single voltage. Modern power supplies, however, are usually designed to handle the whole voltage range which both avoids the expense of an extra switch, and ensures that users don't put the switch in the wrong position and destroy something.
[2] A comic-style explanation of flyback converters and ringing choke converters is at TDK Power Electronics World.
[3] The cost of idle AC adapters is given as $3.5 billion to $5.4 billion for 45 TWhour of wasted electricity in the US. The article discusses solutions, and mentions that an efficient controller IC costs 75 cents. (Note that this is a huge cost for an adapter that sells for $2.79.) Dry up avoidable leakage, EDN, Feb 1999, p96-99
[4] The DC voltage is approximately sqrt(2) times the AC voltage, since the diode charges the capacitor to the peak of the AC signal. Thus, a 240V AC input will result in approximately 340V DC inside the power supply. Because of this usage of the AC peak, only a small portion of the AC input is used, resulting in inefficiency, known as a bad power factor. For larger power supplies, power factor correction (PFC) is used to improve the power factor.
[5] The schematic of a ringing choke converter similar to the one I examined is in Analysis and Design of Self-Oscillating Flyback Converter, Delta Products Corporation.
[6] Safety Considerations in Power Supply Design, Texas Instruments, provides a detailed discussion of safety requirements for power supplies. Also see Calculating Creepage and Clearance Early Avoids Design Problems Later, Compliance Engineering. An online calculator for the UL 60950-1 clearance and creepage requirements is www.creepage.com.
[7] Cypress Semiconductor compared flyback converters and ringing choke converters; and ringing choke converters are significantly cheaper but very noisy electrically. Poor touchscreen performance is blamed on noisy aftermarket low cost chargers. Noise Wars: Projected Capacitance Strikes Back, Cypress Semiconductor, Sept 2011.
[8] Power Integrations has multiple designs and schematics for Cell Phone Charger and Adapter Applications.
[9] Power Integrations has a detailed design for a 5W cube charger based on the LinkSwitch-II controller. This circuit fits two circuit boards into the inch cube, which is pretty impressive. 5 W Cube Charger Using LinkSwitch-II and PR14 Core
[10] The official USB charging specification is Battery Charging v1.2 Spec.
[11] The updated USB standards that allow high-current charging are described in USB battery-charger designs meet new industry standards, EDN, Feb, 2008. In summary, a charger shorts D+ and D- to indicate that it can provide 1A, compared to a regular USB port that provides up to 500mA.
[12] An up-to-date discussion of USB charging is given in The Basics of USB Battery Charging: a Survival Guide, Maxim Application Note 4803, Dec 2010. This discusses the USB Battery Charging Specification, and how USB detects different power sources: SDP (standard computer USB ports), CDP (high-current computer USB ports with up to 1.5A), and DCP (power adapters).
[13] A guide to USB power that discusses the difference between what the USB standard says and what is actually done is "What your mom didn't tell you about USB" in Charging Batteries Using USB Power, Maxim Application Note 3241, June 2004. In particular, USB ports do not limit current to 500mA, and might provide up to 2A. Also, USB ports generally provide power even without any enumeration.
[14] Ladyada reverse-engineered Apple chargers to determine how the voltages on the USB D+ and D- pins controls the charging current. Minty Boost: The mysteries of Apple device charging. Also of note is the picture of the internals of a official Apple iPhone 3Gs charger, which is somewhat more complex than the charger I disassembled, using two circuit boards.
[15] Maxim MAX14578E/MAX14578AE USB Battery Charger Detectors. This datasheet has details on the proprietary D+/D- protocols used by Apple and Sony chargers, as well as standard USB protocols.
[16] Developing cost-effective USB-based battery chargers for automotive applications, EE Times, Feb 2011. This article describes the different types of USB charging ports and how to implement them. It mentions that Blackberry uses the USB Battery Charging 1.0 spec, Motoroloa uses the 1.1 spec, phones in China use the YDT-1591 spec, and Apple uses a proprietary protocol.
[17] Power supply technologies, Journal of Electronic Engineering, 1995, p41 reported AC adapters and chargers for portable computers, cameras, and video equipment are moving from "dropper" transformers to switching supplies.
[18] Energy Star added star ratings in 2010 for no-load power consumption, randing from 0 stars for chargers that use more than .5W idle power, to 5 stars for chargers that use under 30mW. The article also discusses constant-current/constant-voltage (CC/CV) chargers that provide constant current while charging the battery and then constant voltage to keep the battery charged. Meeting 30 mW standby in mobile phone chargers.
[19] A green power AC adapter design driven by power requirements, EDN Power Technology, Aug 2004, p25-26. This article describes how to build a highly-efficient AC adapter using "burst mode" during low load, and minimizing EMI interference through spread spectrum techniques.
[20] Watt Saver for a Cell Phone AC Adaptor describes an AC adapter reference design that uses a 1 Farad super capacitor to power the controller without any AC usage when there is no load.
[21] The Fairchild FAN103 PWM controller is designed for charger applications. It uses frequency hopping to spread out the EMI spectrum - the switching frequency varies betwen 46kHz and 54kHz. When there's no load, the controller switches into "Deep Green" mode, dropping the switching frequency to 370Hz, getting just enough power to keep running.