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.


Anonymous said...

How about you buy an off the wall (literally) charger from apple and break it open to compare?

Ken Shirriff said...

Hi Anonymous. Apple chargers are a bit too expensive for me to sacrifice one just for my curiosity.

Ladyada has a picture of inside an Apple charger; it's considerably more complex with two circuit boards, so it's clearly a better design.

Anonymous said...

My real samsung charger messes up the touchscreen to the point that I cant use drawsomething when plugged in. Not just cheap adapters do it.

Dave said...

Nice blog here very interesting, i found this page after my mate bought me a crappy blackberry charger and it blew up, but luckily it triggered the circuit breaker in my home.

D Minor said...

I bought a "cheap" Mac book magnasafe from Extreme Deal. It fried the mother boards of two Macbooks. I took it apart, it was an "official" apple logo mangasafe with junk inside. It was putting out twice the spec voltage. I learned my lesson!

Anonymous said...

But it's not just a few dollars is it, Albeit I'm in the back of beyond, but an official iphone charger where I live is closer to $40, compared to $4-5 for the chinese variants.

Anonymous said...

I used to work for a consultant who did UL Safety testing. One of the things I got to do was that when we got a new device in, the first thing to do was to take out the power supply, find the circuit traces for the high voltage primary and the low voltage secondary. I then got to take a pair of calipers and measure the distance between the traces.

This was almost 15 years ago, so I don't remember the exact separations required, but it was a hell of a lot more than 1mm.

Beside the measurments, we also did the HIPOT test. HIPOT stands for HIgh POtential. In the HIPOT test, you take a special power supply that is capable of at least 10KV. You clip one lead to the primary of the power supply and one lead the secondary. You then ramp the voltage up. For UL 1950, which is the standard for most any commecial IT type gear, the power supply had to withstand at least 1500 volts.

Product Safety testing paid my way through college and it was a fun job.

Anool said...
This comment has been removed by the author.
Anool said...

Well written, Shirriff. And here are pictures of just such a charger that blew up on me.


Anool : [email protected]

Jens Bauer said...

In Denmark, we have very strict rules about high voltage electricity.

These rules says that for every 100V, you must have an isolated distance of 1mm.

So for 115V, I would make at least 1.5mm (because voltage may sometimes rise above 120V) and for 230V (which means voltages up to 260V), I would make at least 2.6mm (preferrably 3mm or more).

If you're smart and your PCB layout program can handle it, put a narrower width trace on the top-side of a PTH PCB, and the same width trace on the bottom-side of the PCB; this way, you'll get traces that can carry the same power on the traces, but you can make the spacing wider. Note: Please make sure that the trace is somewhere between half and full width of the original trace width, so it can carry the current that it should.

Now, there's a difference between an open pad and a trace closed by a solder mask. A trace closed by soldermask is isolating better than two open traces close to eachother. This is due to that "air" has a variable resistance.

Eg. Air is a very good isolator, but on a rainy day, the resistance drops very much, thus the isolation drops as well.

But back to the small power supply and the gap.
I believe that if the trace is isolated from the pad, the power supply will be safe enough for 115V, however, for 230V, it is not.

Anyway, I'd recommend anyone to buy an Apple charger (the small one), ofcourse because it's a real American product, which means they have to conform to certain rules and laws - so the product will be safer; second, you're supporting an American company, third: You already know that someone pulled the thing apart and verified that it's safe. :)

If you, on the other hand, are looking for a cheap power supply that you can sell, you should buy a bunch of different power supplies and disassemble them, to see whether or not they can be used.
-If you don't know how to determine it yourself, find someone you can rely on answering the question correctly.

Please note: There are cheap Apple-look-alike power-supplies available, and even though they look like Apple's, they might contain sloppy electronics like the one mentioned in the above article.

Thank you OP for the awesome and outstanding detailed article.

Jens Bauer said...

I forgot to say:
If you have some liquid plastic spray, you can give the PCB a few doses, to make the insulation better.

@Anool: Have you found the cause of the failure in your power supply ?

One would think that 0.6mm safety would be enough safety distance for a circuit where the diode is placed before the transformer, however, I do not think that is so.
This is because the voltage difference between the two traces would be... 115V / 2 (say +60V and -60V).
Now, the diode does not divide the voltage by two, but instead, it only lets half of the periods through, which means either +60V or -60V.
That might be why the chinese manufacturers made a shorter distance.
Yes, the voltage is only the half, but the peak voltage is actually the same, if you think about it.

Anool said...

@Jens, it blew up at switch on. We have 240V here. I'm guessing it would have survived longer under 110V conditions. The switch on surge at 240V was probably more than it was designed to handle. Didn't look like a creepage related issue. More like component failure.

Jobin said...

My powersupply for ADSL modem don't even have the optocoupler to regulate the output!. this one is far better.

Ken Shirriff said...

Anool: thanks for the very interesting pictures.

Jobin: some power supplies avoid the optocoupler by using primary-side regulation. An auxiliary transformer winding tracks the secondary output, and this is used for feedback. Or your power supply might use a linear regulator. Or maybe it's just unregulated :-)

ranit8 said...

Did you know the last time this surfaced on Hacker News it was killed and the guy got hellbanned? Check Google on fake iphone charger and compare that post and the cached version.

I'm desperate to find someone who sees this and can help.

JST said...

The DC voltage will be equal to the (RMS) AC voltage. When we say that a wall outlet provides 240V AC, it means 240V RMS.

So, a 240V AC input will result in 240V DC inside the power supply, not 340V. Yes, the peak voltage of the AC waveform is sqrt(2)*V_rms, but the steady-state DC voltage is not.

Ken Shirriff said...

JST: your calculations would be right if the bridge didn't have a filter capacitor. But with a filter capacitor, the capacitor charges to the peak AC voltage and only drops slightly. Thus, the DC voltage is about the same as the peak AC voltage (minus small diode voltage drop and ripple).

A few references are Diode Bridge Rectifiers, Rectifying AC increases voltage, "Power Supply Cookbook" page 123, and Power Electronics (22.6.1).

Anonymous said...

Got a news flash for people differentiating official from "Chinese" chargers. They are all made in China, some even in the same factory.

In the end for any cheap product, you get what you pay for. Some safety tolerances aside that $3 charger does work, but what do you expect it's $3! Take away the logistical and material expenses and the profit margin is less than a few pennies.

It's when you buy an overpriced Apple charger and it ends up the same smokey mess that irritates people. Wasn't because it was made in China, it was because Apple was too damn greedy to design something better.

Anonymous said...

"it's considerably more complex with two circuit boards, so it's clearly a better design."

That has to be the most stupid comment ever. Electronics don't have to be complex to work. The design of the charger you took apart is electrically sound from an engineering point. The problem with cheap electronics is the assembly.
These are Class 1 IPC commercial electronics. Most problems come from poor solder assembly (missing, bridges and balls.)
Even name brand electronics can suffer this fate, it's just the nature of the beast when companies try to save pennies.

Anonymous said...


is this thing real or fake?

Ken Shirriff said...

Anonymous with the HTC charger pics on dropbox: That looks like a really poor charger, but at least they paid attention to safety.

Bad features: just a single rectifying diode instead of a bridge will make much more ripple. No control IC, just a ringing choke converter circuit. A zener diode for feedback instead of the TL431 almost everyone uses - worse regulation. A cheap electrolytic capacitor for output filtering - poor output filtering. It looks like they did everything they could to minimize cost.

On the plus side, they have a good isolation boundary - the gap in the PCB labeled HY-777B. They include a Y capacitor. There's extra insulation over the USB connector and transformer. So they are paying attention to safety

Overall, I don't know why anyone would make counterfeit HTC chargers, so I'm guessing that this is real but kind of nasty. I hope you didn't pay more than a couple dollars for it :-)

Jack said...

Any thoughts on this charger of mine?
I bought it off of DealExtreme (http://dx.com/65368) for $2.30. Yes I know it is fake, but it does have a full bridge rectifier and a 13003A power BJT in a TO-126 package (better heat dissipation maybe?) and it sets the proper resistance values on the data lines for the USB out. However, there is no Y-cap, fuse or MCU.


Ken Shirriff said...

Hi Jack! Thanks for the dropbox link with extremely detailed pictures of your charger.

The label is very interesting - it's build by "Flextronic" rather than "Flextronics", and they've invented their own CE-like safety marking.

The charger circuit looks pretty minimal, but I've seen worse. I didn't see any insulation between the two boards or between the input AC and the output board. The thick input wires and lack of a fuse suggest that it would probably fail spectacularly if something shorts.

It turns out that one of the chargers I've disassembled but haven't written up yet has the identical component layout as yours. However, the circuit board routing is slightly different and my power transistor is smaller. These are the most similar chargers I've come across though - it surprises me that these companies don't just rip off someone else's design but have unique designs.

Jack said...

Thank you for the prompt reply! I believe that it is actually supposed to say "Flextronics" because I do have a second one here that has the 's' on the end so I think it must have just rubbed off on the one I disassembled.

I've done some measurements on this fake charger I own and I found that they output about 5.4V instead of 5V and when I have my phone plugged into them the touchscreen is intermittently responsive, probably due to the over-voltage.

I also probed it with an oscilloscope and found that the ripple was actually very low, thanks to the full bridge rectifier, but there were a lot of spikes going as large at 200mV all over the place. Needless to say I don't think that I'll be using these with my phone, not only because it means I can't use my touchscreen, but I also don't want to risk damaging it!

Anonymous said...

Hi Ken, came across your article and found it really interesting. Could you comment on these 3 adapters on their safety? I'm concerned as they were bought off ebay (cheaply). Whats the risk of getting electrocuted if something goes wrong?


HOLGER said...

I find this "SMD-rest-solder-Balls" in expensiv Devices. Like ABS and ..
Metal Cased BlueThooth Devices ect.
And the "automated device-tests" are ok, as long and
after a Time if a Solder-Ball gets loose, it plays Bimmel Bingo on the small TSSOP Pins
of the Mico...an have thomething strange happen with the Device.
Why magnificate inspect this by human eye in a important thing.

Anonymous said...

@Jobin -- Many ADSL modems accept a wide range of power because they do the regulation internally. Chances are your power adapter either is just a transformer and nothing else (I've seen many ADSL modems happy with that) or it may be an unregulated DC supply (transformer -> diode bridge -> filter capacitors).

Both of those options are perfectly safe (assuming the transformer isn't junk) as long as the equipment receiving the power either does it's own regulation or doesn't need it anyways. In none of those cases would opto-isolators or any other feedback device be found.

It could also be linear, but that's far less likely nowadays.

Anonymous said...

I just learned my lesson!! I bought several ipod chargers online from EBAY and I got a helluva whollop the other day. I was holding my ipod in my right hand with the metal back contacting my hand. I plugged the charger into the wall with my left hand. And bang, a huge jolt through my right hand and right foot. I took the offending charger apart and it defintely does not look the Apple insides.
I have ordered new chargers from Apple and throw out generic ones.

Anonymous said...

@Jens Bauer

America is hardly the kind of country most non-Americans want to support. Apple are another thing entirely -- probably one of the most unethical companies in the world.

Adam said...

I have a cheap charger that doesn't seem to cause any screen interference, but it does run awfully hot. Hot enough that I almost suspect they shoved in a transformer, diode and a 7805 regulator and called it a day.

Anonymous said...

Did the fake Apple wart have the data pin iterlocks in place - put there to slow down people wanting to user more economic chargers than the Apple rip-off pricing?

Ken Shirriff said...

Anonymous: you asked about the data pin protocol. This charger just shorted the two data pins together, indicating a generic USB charger. There were empty spots for data pin resistors - R2, R3, R8, R10 - so they could easily make this look like an Apple charger by putting the right resistors there. Lots of USB chargers pretend to be Apple chargers because it's so easy.

Magsafe chargers are a whole different story - you need a special chip in the connector, so you can't easily make knockoffs. See my Magsafe article.

Anonymous said...

Whether Apple charger is a better design using 2 circuit board is subjective, but objectively all power supply should have tested to approved certification which is what most manufacturer do.

This particular el cheapo looks illegal to me on the basis,
there are no safety marking i.e. CE or UL certification.

Which means it may not even complied with the IEC electrical safety standards.

The casing doesn't look adequate fireproof to me.

Stay away from this piece of crap!!! It's dangerous!!!

Anonymous said...

It's better to stay clear of products from China, they are usually of a really low quality hence the low cost. Always purchase the branded quality product, look for the quality marks on the product also.
Cheap == poor quality.

Bebiro said...

I wondered why at first why 340VDC... I'm not an expert but I would think that your 240VAC gets immediately stepped down to 5VAC (or a bit higher) and then rectified to 5VDC...

Seeing the schematics I thought at first, that the XFMR was right before the rectifier but it looks like its a filter?? Anyways, it rectifies the 240VAC first and, as somebody else said, with the capacitors the peak voltage is maintained thus having aprox 340VDC and at the end of all the control circuitry they use a XFMR to step it down to 5VDC...

So... What is the reason for having the rectifier first and then the XFMR? Why not step it down immediately and then rectify if 340VDC is can kill...?

Thanks for the feedback, I appreciate the help...

Bebiro said...
This comment has been removed by the author.
Ken Shirriff said...

Hi Bebiro. These chargers are switching power supplies. First the 220V (in China) AC is converted to DC, which ends up sqrt(2) higher voltage because the rectifier circuit ends up with the peak voltage not the average (RMS) voltage. This is chopped up at high frequency and fed through the transformer. The transformer output is converted to DC and filtered, giving the final 5 volt output.

This sort of switching circuit is much more compact and efficient, which is why it is used. You can step down first and then rectify, which is what the older big wall-wart power supplies do. A 60(or 50)Hz transformer is much larger than a high frequency transformer. Also, it's more efficient to regulate the output by high-frequency switching than a linear regulator which turns excess power into heat. Finally, anything line-powered can be unsafe if don't care about safety - if the step-down transformer is built too cheaply, it could short out and give you 220V (which is better than 310V but still lethal).

To summarize, your suggestion of stepping down first works, but the power supply would be much larger, less efficient, and probably more expensive.

Bebiro said...

Great explanation, thanks for taking the time Ken...


Unknown said...

hey the case happened with me.i brought a cheap charger and it sparks when i was charging my mobile phone.i am fortunately saved from it

Anonymous said...

A Flyback Transformer?!?! That is a component used on older anolog Television of the Vacuume tube era!
And you are what you call an expert?!?

Ken Shirriff said...

Ha ha, Anonymous. Old TVs also used resistors and capacitors. Needless to say, these components are all still in use today :-)

Anonymous said...

Just wondering... if I take the cheap charger of my chinese tablet - which presumably has some sort of rudimentary switching power supply in its guts, and complement it with a 7805 and two filtering capacitors will I end up with a better supply in terms of ripple and noise?
(yes, now the capacitive screen has problems when the tablet is plugged in)

IIRC, the thing puts out much more than the required five volts, at least with no load.

Unknown said...

Hi Ken,

I'm curious as to how the ASUS eee Pad Slider charges at 18-20V using the official charger. It won't charge at all from 10W Apple iPad chargers.

Forrest said...

I've made a bunch of UL listed hardware. "HiPot" testing (high potential) is done on all devices to verify the leakage currents. The limits are small. The durations usually quite long, relatively speaking. (For instance, a functional test may be 5 seconds, and a hi-pot 30.) When the rating agencies' (UL, CSA, VDE) logos are on a product, it means that the design has been reviewed, the manufacturing and test inspected (routinely) and that you can count on the component being safe. Apple is not going to use non-UL adapters to power things people touch to their hands and ears. Can't speak for Samsung or the rest of the "I'm too cheap to buy quality" products, but Apple margins certainly support the extra tests. $20 for the amount of stuff inside, including the margins, packaging, labor is a small price to pay for a few more years on the planet, don't you think?

Pisses me off that Apple takes the hit for some fly-by-night asian wannabe engineer but will settle for being a murderer criminal.

Forrest said...

Anonymous Anonymous said...

A Flyback Transformer?!?! That is a component used on older anolog Television of the Vacuume tube era!
And you are what you call an expert?!?

AnonAnon... he didn't call himself an expert, (but he did use his name and not just insult and run like an adolescent!)

Flybacks are used in a lot of places. It's not just old TVs. I'd explain it to you, but your comment suggests you wouldn't understand my answer. I am an expert.

Generalmotors Gravytrain said...

People are always trying to do things on the cheap, so they're only getting what they deserve by getting injured when they've been told to buy the proper equipment. No point in losing one's life trying to save a few dollars. Apple is taking the heat for Chinese knock-off crooks and careless individuals, but of course, Apple is always at fault for supposedly charging too much for their products.

Anonymous said...

you rock! Notation on a picture from an amazon review praised the AmazonBasics USB charger for

"feedback winding on the transformer"

not knowing better I assumed his electricialistic-balderdash was grand

Your writeup is evidence based, thanks.

jason_m said...

In response to @rpi4all's rather unscientific assertion. After looking at Amazon's chargers myself, I'd say that their power supplies have pretty good power quality, and safety for the money. Of course seeing that these are battery chargers, not built to be a dedicated power supply for say routers or a computer system. In reference to the "feedback winding", it's the same kind of triple insulated wire Apple uses. I think here, along with Apple, it is actually the output that feeds the power to the usb, not a feedback winding. Amazon uses a controller ic, which is a far better thing to watch out for than the type of feedback used. I seriously hope it is not a case of "oh a counterfeiter uses it, so the others that use it must be bad also". Knowing very little about power supply topology, that is not a good thing to be assuming. Furthermore, the reviewer pointed out some things about the charger, with plenty of pictures. Not owning a blog or website to post lengthy analysis I think that was good enough.

Unknown said...

An Apple charger blew up on me yesterday. Scared the hell out of me.

Picture 1
Picture 2
Picture 3

Anonymous said...

Nobody has mentioned the solder flux.

That board is filthy with flux all over it. Flux is not a conductor but over time it can absorb ambient humidity. I've seen resistances as low as 10k between pins of a connector that were never properly cleaned.

jenny said...

Can I use 1 amp fuse and MOV in ac input with these cheap charger to avoid any spark or danger. Please confirm level of safety after adding fuse and/ or MOV ;I am using this cheap 5v supply for my project design.

Anonymous said...

@ Blogger

"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 opto-isolator" - You missed something.. well 2 other things!

Insulation can also be bridged from primary to secondary by the use of Y1 grade cap (for maintaining a reinforced)[or a "X1/Y1" grade] or a Y2 grade cap (for maintaining basic / supplementary.

This is quite common on SMPS style circuits for EMC purposes. This is also something to bear in mind as often cheap chargers do not use the correctly approved (IEC60384-14) grade capacitors and use regular caps instead! Ensure they are of correct grade, and bear safety markings (ENEC marking is sufficient for Europe, or individual recognised safety bodies individual marks such as VDE etc).

There are also digital-isolators now that do the same function as an opto-isolator however they use a substrate rather than a physcial gap between emiter and detectors in an opto-coupler.

Opto-couplers if used should also meet the required safety certification, IEC60950-1 and IEC60065 for reinforced insulation, worth checking that cheap non-compliant opto's haven't been put in instead.


MOV / VDRs / varistors do not protect you from shock. Such a component sits across Live and Neutral and protects the circuit from overvoltages.

A fuse offers protection to the circuit also - not you.

Accessible metal parts (e.g. the shield of the USB port)could be sat at live but the fuse won't blow if live got bridged somehow over the reinforced insulation to the secondary SELV side.

A class I circuit under this condition MAY trip an external breaker at the fuse board detecting an earth leakage, but in a typical USB phone charger being a class II (Double insulated) device no earth leaking would be able to be detected.

Best way is by good circuit design, separation and ensuring you meet the requirements for reinforced insulation at the output with regards to the mains input, use good quality certified X and Y grade caps where appropriate, certified opto-couplers meeting safety standards.

Anonymous said...

Can I also add to above, noted one commenter mentioning "CE" marking :-

"there are no safety marking i.e. CE or UL certification."


CE is NOT a safety mark! It does not infer any testing has been carried out.

The CE marking is the manufacturer's declaration that the product meets the requirements of the applicable EC directives.

CE marking is a self-certification scheme. Retailers sometimes refer to products as "CE approved", but the mark does not actually signify approval. Certain categories of products require type-testing by an independent body to ensure conformity with relevant technical standards, but CE-marking in itself does not certify that this has been done.

Please..please..be clear on what CE means!

Comments here also have spoken about circuit separation requirements - and, depending on the standard, this varies quite considerably.

Let's educate people - and use correct terminology for this - Creepages and clearances.

Creepage is the distance along the surface between two points.

Clearance is the distance between two points through air.

The values a circuit needs to meet are determined according to the standard used for assessing the product, and can vary between 3.0mm for reinforced to 5.0mm for reinforced

The values are determined from many factors. Working voltage, Pollution degree, Over voltage category and Material group (CTI/PTI).

There is also 3 types of insulation - basic, supplementary and reinforced. Basic insulation in some standards is split into functional and operational insulation, just to complicate it, but for all intents and purposes, these are "basic" insulations.

Basic insulation is (mostly) fine for sufficiently enclosed MAINS sides of circuits.

Secondary circuits should be at least Supplementary but preferably meet reinforced requirements.

IEC 60950-1 stipulates 2.5mm clearances for basic insulation, reinforced is twice basic at 5mm.

Creepages can never be less than clearances, so at least 5mm creepage also. Distance through insulation (applies to opto couplers with insulation completly filling the void inside) from gold wire on emitter to gold wire in detector should be minimum 0.4mm for reinforced.

Manufacturers often use slots on boards which increase creepages for compliance (a slot needs to be at least 1mm wide for the most part to be considered wide enough for the creepage path to go around it). Clearances are unaffected by the slots put on boards.

It's common place to see this on inverter boards for CCFL backlights, under optocouplers and sometimes under transformers.

There is alot to circuit design, and safety testing, and many. many standards, personally, I'd go for an IEC 60950-1 certified power supply, as these have some of the most stringent (Medical 3rd edition aside) requirements for circuit separation.

I could now waffle on that beyond this, you then have flammability ratings (UL94 V-) of components, tested by needle flame, enclosures flammability ratings tested by horizontal burning (HB) and Clever burning ratings of enclosures (VW).. materials supporting live parts in place, maximum Touch Temperature requirements, marking requirements, durabilty of markings, leakage currents (earth leakage, touch currents requirements..)

Don't get me started on requirements for VDRs (ANNEX Q of IEC 60950-1)... Even that VDR sat across live and neutral - one of the first components before you've even started worrying about might not even meet the required climatic category, have at least 125% working voltage of the, meet specific 8/20uS pulse tests either...

jeny said...

Any one please help me to decide original one, also safety level.
I bought them from seller claiming original apple, but teardown and tried to compare with ken shirriff picture, but failed.
below are picture of both....
front view image web link:-


back view image web link:-


package view image web link:-


Unknown said...
This comment has been removed by the author.
Anonymous said...

Just to get in on the 'flyback' thing. Indeed the original term 'flyback' did refer to the the line output transformer, where the HF was derived from the point flying back to start another line, but now seems to have been re-appropriated to mean 'any HF ferrite transformer'. In absolute technical terms, the anonymous guy was right, it's NOT a flyback, but... for tact, he gets a zero ;)

Unknown said...

Damn it why didnt i read this before i bought a charger? I should have understood that a charger for only a little over 100kr was way to cheap and now my 1000 dollar iphone is dead ):

Andyjenk said...

Given the millions of cheap Chinese chargers bought each year I would have expected a large number of annual deaths from them. Instead there are a large number of reports of fried devices. I thought Apple stuff was made in China like everything else. I wouldn't trust that a US built charger correctly coped with 230v.

Priyan R said...

Can a RCCB/ELCB trip due to a faulty charger and save from lethal shock ?

Unknown said...

I was looking into a USB charging solution for a DIY project.

I'd like to connect to the back of a wall socket (so no visible connections from the front) and run a cable up the inside of my wall to an in wall ipad holder.

I only have a thin gap to work with.

Any ideas on the best solution?

Bruce Ratcliffe said...

Dear Ken,
WOW! the technical expertise/precision of your blog is, in its rarity, refreshing! I'm a teacher trying to get 11th graders excited about science and have hit upon a good carrot--maybe. Solar-powered cell phone charger. We're using an old 60W roof-mount solar panel to charge cute little 6V, 4.5 AHr Pb-acid batteries which, with a 1N4003 diode delive3r a 5.3V output, via USB connector, to cell phone. This is NOT a constant current, then constant voltage charging system, which is recommended for charging Li-ion batteries. Is the regulating circuitry in a cell phone (both smart phone and cheap phone .e. Go Phone) sufficient protection when charged by my charger?
Bruce Ratcliffe, Edison High School, Fresno, CA

Anonymous said...

My iPhone 5 dead when my cheap charger blown up. Please help what can I do.. do I need to replace the battery by my self? Is the explosion cause a big damage on my iPhone? or shall I bring it to Apple shop or high St. repair shop? How much it cost me? please help!!!

Unknown said...

Thank you so much! for this blog Really,Its very nice & interesting Blog. I found this page after my mate bought me a crappy blackberry charger and it blew up, but luckily it triggered the circuit breaker in my office.

Anonymous said...

What about the "clearance items" from the chains like Best Buy or Staples? These have what I consider to be absurdly high "regular" prices, but seem to go on "clearance" sales like clockwork for about $3-$5, to be replaced by new models that look the same and have the same specs.

Anonymous said...

I came THIS close to buying a (believe it or not)$1.79 fake iPhone charger.

Trent said...

Thanks for this info. I reposted it to my blog at www.riceisfordinner.com A PSA/info blog on the silliness that is, "Put your wet phone in rice".

Anonymous said...

So they are cheap AND explode!? And yet you are tellng me not to buy one? I am confused, good sir.

Mr. S said...

You are right. I got mine with the RC Copter same design like yours. I connected the battery and within 3 minutes my charger blew up. Since then I am afraid to connect my copter battery to USB charger but after reading your article, I understand it was due to charger not the battery. Thanks

Anonymous said...

Great Post, very useful, and thanks very much for the links about TDK.

Everything was a joy to read,

Kind Regards
Heider Sati

Unknown said...

Very nice post Thanks!!!!!

Anonymous said...

China dumps a lot of "sheet" into the USA and eBay is fill of sellers from China!

Anonymous said...

This is very true! I once received one of these fake chargers for free when I bought a phone case on eBay. The adapter caught fire when I plugged it into the wall! Meanwhile, the charging cable made my phone freak-out and go into a restart loop. Needless to say, these Chinese products are dangerous and worthless.

Anonymous said...


My made-in-china no-brand usb charger plug ejected from socket when I was using it to charge a mp3 player. It had worked over an year without problems. Also threw few spark on the carpet which didn't ignite anything, luckily. The adapter was 5V 1A one with input power of 100-240V 50/60Hz 0.15A with CE marking.......

Anonymous said...

The worrying thing is, although I am not challenging anything technical, in the article is that the emphasis was on cheap. I have noticed recently that the price has increased and there is little price differential and so that is not a guide.
The CE Mark is a nonsense as it is often just applied by anyone and means little.

So the question, which I can't answer is how do you know a dud one before it is too late without opening it up to look and then it is ruined as they are not intended to be taken apart.

Also what about those that come included with gadgets where there is a non standard low voltage plug and not 5v there is little you can do.


What do I do.
I stick an oscilloscope across the output and look at the waveform it picks up dodgy ones in an instant. Including an odd Apple one bought from an Apple shop.

Graham Oakman said...

Woooow, cool article for all the iOS geeks and Android haters

Dekkan said...

Thank you for the info! =)

kbm said...

They have probably sold millions of these cheap chargers.
One woman was electrocuted. Under unknown circumstances.

Unknown said...

most of the charger are fake in Condition because customer do not known the feature of charger.so most company sell out charger in the market.so we are provided best laptop charger in Dubai.if you face any issue regarding your charger.then you can Buy Apple laptop Charger in UAE. you may visit our website.

jack thomes said...

That’s a good post and hope it helps other peoples.
Best quality wall to wall carpets in dubai