Skip to main content

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

http://www.righto.com/2012/03/inside-cheap-phone-charger-and-why-you.html

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 should point out that since there are few details at this point, this is 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,

Conclusions

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.


Comments

Popular posts from this blog

The Difference Between LEGO MINDSTORMS EV3 Home Edition (#31313) and LEGO MINDSTORMS Education EV3 (#45544)

http://robotsquare.com/2013/11/25/difference-between-ev3-home-edition-and-education-ev3/ This article covers the difference between the LEGO MINDSTORMS EV3 Home Edition and LEGO MINDSTORMS Education EV3 products. Other articles in the ‘difference between’ series: * The difference and compatibility between EV3 and NXT ( link ) * The difference between NXT Home Edition and NXT Education products ( link ) One robotics platform, two targets The LEGO MINDSTORMS EV3 robotics platform has been developed for two different target audiences. We have home users (children and hobbyists) and educational users (students and teachers). LEGO has designed a base set for each group, as well as several add on sets. There isn’t a clear line between home users and educational users, though. It’s fine to use the Education set at home, and it’s fine to use the Home Edition set at school. This article aims to clarify the differences between the two product lines so you can decide which...

Let’s ban PowerPoint in lectures – it makes students more stupid and professors more boring

https://theconversation.com/lets-ban-powerpoint-in-lectures-it-makes-students-more-stupid-and-professors-more-boring-36183 Reading bullet points off a screen doesn't teach anyone anything. Author Bent Meier Sørensen Professor in Philosophy and Business at Copenhagen Business School Disclosure Statement Bent Meier Sørensen does not work for, consult to, own shares in or receive funding from any company or organisation that would benefit from this article, and has no relevant affiliations. The Conversation is funded by CSIRO, Melbourne, Monash, RMIT, UTS, UWA, ACU, ANU, ASB, Baker IDI, Canberra, CDU, Curtin, Deakin, ECU, Flinders, Griffith, the Harry Perkins Institute, JCU, La Trobe, Massey, Murdoch, Newcastle, UQ, QUT, SAHMRI, Swinburne, Sydney, UNDA, UNE, UniSA, UNSW, USC, USQ, UTAS, UWS, VU and Wollongong. ...

Logic Analyzer with STM32 Boards

https://sysprogs.com/w/how-we-turned-8-popular-stm32-boards-into-powerful-logic-analyzers/ How We Turned 8 Popular STM32 Boards into Powerful Logic Analyzers March 23, 2017 Ivan Shcherbakov The idea of making a “soft logic analyzer” that will run on top of popular prototyping boards has been crossing my mind since we first got acquainted with the STM32 Discovery and Nucleo boards. The STM32 GPIO is blazingly fast and the built-in DMA controller looks powerful enough to handle high bandwidths. So having that in mind, we spent several months perfecting both software and firmware side and here is what we got in the end. Capturing the signals The main challenge when using a microcontroller like STM32 as a core of a logic analyzer is dealing with sampling irregularities. Unlike FPGA-based analyzers, the microcontroller has to share the same resources to load instructions from memory, read/write th...