Idioterna's USB charger

05.05.2014 19:37

A while ago Jure told a story on IRC about how he bought a bag of very cheap Chinese battery chargers with an USB socket. One of them apparently self-destructed with smoke and fire.

Charred remains of a cheap USB charger.

Image by Jure Koren

I've seen some interesting posts about such gadgets from Ken Shirriff. After watching tear downs that show how little regard for safety some manufacturers have, I was curious to take a look at one of such specimens myself. So I asked Jure to borrow one.

Disassembled cheap USB charger.

With the charger disassembled, I was surprised to see a design consisting solely of discrete transistors, bipolar no less. This is rare to see these days, especially for line converters. Typically, I would expect to see a circuit built around one of the many chips on the market intended solely for this purpose.

Note also that the plug isn't soldered to the circuit board. Rather, the prongs are only touching metal connections that have a bit of flexibility in them. I wonder if this is what caused the carnage on Jure's self-destructed charger. Since no components are visibly damaged, an arc could have developed over a bad connection on one of the prongs.

Isolation boundary on a cheap USB charger.

Here is the bottom side of the circuit. I've marked the isolation boundary - the line between the high-voltage primary side of the circuit and the "safe" low voltage secondary side. The separation at the closest point is a millimeter at best.

Specification printed on a cheap USB charger.

Here is the specification printed on the casing. Note that the CE has the proportions of the infamous China Export, not the European conformity mark. Such an unsafe design would never pass a conformity test.

Intrigued by transistor-only design, I took the time to draw the full schematic of the circuit.

Schematic of a cheap USB charger.

How does it work?

Diode and the 2.2 μF capacitor on the input form a half-wave rectifier for line voltage.

The topology is a regular flyback converter. In the first half of the cycle the power transistor Q1 is open. The current through its collector and the primary winding of the transformer is rising, storing energy in the ferrite core. Induced voltage over the secondary terminal is negative and D2 is closed.

At one point primary current raises to the point where voltage drop over the 12 Ω resistor is greater than Ube of Q2. Q2 opens and shorts the base current of Q1 to ground. Q1 closes and primary winding current drops abruptly to zero.

The stored magnetic energy induces currents in the secondary and auxiliary windings. D2 opens and the current charges the output capacitor C2. At the same time, auxiliary winding charges C5 and also keeps Q1 closed further - step change in induced voltage on the current pulls base of Q1 negative through C3 and the 560 Ω resistor.

When the core discharges, Q1 obtains the base current again and the cycle repeats.

Output voltage regulation is implemented using Zener diode ZD1. When the diode breaks down, it causes current to flow over the LED in U3. This in turn opens opto-coupler's transistor, which injects current into Q2's base, halting the converter until voltage drops again. In other words, this converter only functions in discontinuous mode.

Function of 500 mΩ resistor on the input is a bit of mystery to me. Typically you would find a fuse or a fusible metal film resistor. From the looks of it however, this is just a regular carbon film resistor. So either it's a case of cargo cult engineering or it's needed because of some subtle effect on the circuit behind it.

There is one safety feature on the circuit: the varistor between the primary and secondary ground. It's there so that any static discharges from the USB connector do not compromise isolation in the transformer. I've seen this safety feature implemented simply as a spark-gap printed on the circuit board, so a varistor is an interesting choice. (Update: as S56A points out in the comments, this is more likely a Y-class capacitor I have misidentified as a varistor).


Guessing from the discontinuous mode of operation, I would guess it doesn't regulate the output voltage very well. Devices that use USB solely for charging a battery probably aren't too sensitive to voltage swings though, so it might fit its intended purpose just fine. I haven't tested it though.

In conclusion, an interesting design. Very simple and built from cheapest possible components. I'm wondering if this was designed from scratch or maybe copied from some obsolete design from back before integrated flyback controllers were available. On the other hand, it's obviously a dangerous toy to leave unattended at home and most likely illegal to sell in the EU.

Posted by Tomaž | Categories: Analog

Comments

Na vhodu je verjetno 500 mA pocasna varovalka. Varistor med ground-i si verjetno zamesal s kondenzatorjem proti RFI. Elegantno narejen oscilator z dodatnim tranzistorjem in opticnim spreznikom za kontrolo. Tako se to delalo na zacetku stikalnih usmernikov.

Posted by S56A

S56A, yes, it is possible that what I thought is a varistor is in fact a capacitor. I looked carefully again and I can just barely see it marked as "C4" on the silk screen print underneath.

The thick blue bulb looks more like an overvoltage protection element to me though. Sadly I can't see any manufacturer markings to look it up.

Posted by Tomaž

Using a zener as a regulation (voltage feedback) device is the most damning fact about this power supply (even more so than inadequate primary/secondary isolation distance or fake CE mark).

Most SMPS designs will use a two-resistor divider, plus a TL431 to directly drive optocoupler. TL431 has a high-gain op.amp inside, which results in nice, sharp transitions, keeping drive circuit in saturation.

Zener on the other hand has very dull transition (about 0.5 to 1 volt for a 3-5-volt zener). This results in circuit trying to enter linear mode, which is very bad news for thermals of switching transistor, and ultimately causes device failure (if you leave this PSU driving less then its full load for longer than few minutes).

Given that an adequate-quality TL431 clone costs about $0.01/piece in bulk, savings of going with zener are negligible, compared to the disastrous effect they have. So all in all this PSU is a nice example of "too much cost-optimized" design.

Add a new comment


(No HTML tags allowed. Separate paragraphs with a blank line.)