Monday, May 5, 2014

Building a cheap USB power measurement device + analysing some USB chargers

In this post I will describe a way to build a really cheap device that will allow you to measure USB power consumption and supply characteristics. It's ugly but it takes 15 minutes of your time and a broken USB hub.


Then I will take a look at various USB chargers and see how they perform, hopefully not as bad as the one depicted below:

I took a broken hub that was laying around and kept for this exact purpose. The picture below shows the modifications that were done:
  • remove all the parts from the board, leaving the connectors in place
  • remove the positive (red wire) from the board, connect a separate wire in its place
  • optional: put a switch between those two wires, just in case you don't want to measure current
  • optional: add another supply cable from a broken tablet one (in this case HP Touchpad)


The original cable had wires that were too thin and at 500 mA were dropping at least 1.5V. The Touchpad one can easily carry 1.5A with little to no drop (I believe it's rated for 2.5A).
To measure current you connect an ammeter between the two red wires - one coming from the supply cable and another one from the board.
I also added the two yellow wires for data so that devices can negotiate power when connected to port 3 of the hub.

The measurement setup, from left to right:
  • big (12500 mAh) battery supply with two USB ports rated at 2A
  • big (9000? mAh) battery supply with four USB ports rated at 0,5, 1, 1.2 and 2A
  • slim no-name Apple-like charger (at the top), rated at 2A
  • no-name charger with a green/red power indicator rated at 500mA
  • modified USB hub (top) with meter and oscilloscope probes going to it
  • cheap (4$) multimeter, with probe-to-clamp adapters on the end
  • various phones and USB loads for testing
  • another battery supply under the phone, 6000mAh(?) with outputs at 1A and 2A





The easiest way to simulate large loads is to charge one of those battery supplies. Only one of them (the 6000mAh one) does power negotiation, the other ones just draw as much as they can. The one seen below is taking around 1 Ampere, limited only by the wiring and it's internal charging circuit.


However they all able to supply their 2A rated current until the last drop. I will make a blog post on those later.

Here's a Motorola branded charger rated for 850mA. It is actually able to provide that and it's output voltage will drop sharply above that limit. I was not able to get it to supply more than 900mA.



While using a cheap USB hub seemed like a good idea it did cost me extra time in the end. As seen below, one prong of the plug is not soldered at all and a positive supply voltage pad lifted off the board.
The hub was new, never used, it was a reject because it had a broken case, so this was not a case of user negligence.






"Fixed" with the red wire.





Waveform analysis

I set up the scope in DC mode because I also wanted to measure the voltage output at the same time with the peak-to-peak noise. This was done by offsetting the zero axis below the screen.

The benchmark was set by the iPad Air charger - 12W (so 2.4A @ 5V). I was only able to draw a maximum of 1.8A so the limits were set by my setup: thin cables, cheap multimeter, bad soldering, not enough demand.
The waveform for the Apple charger was noise-free at all load levels and the output did not drop below 5V.

My wires are also catching up noise from the environment (neon light), but I'm only doing relative measures against the benchmark.
The USB spec defines acceptable voltages as being between 4.75V and 5.25V but I'm evaluating against the range 4.8-5.2V and peak-to-peak noise of not more than 200mV.

1) Motorola charger, no load.
Virtually noise-free, output within acceptable limits.


2) Motorola charger, 120mA load.
Again, within spec. This is what a headset would draw while charging or a phone that's already fully charged and not performing heavy operations.


3) Motorola charger, 700 mA load.
The voltage already dropped quite a bit, at 850 mA it was already at 4.8V maximum which is at the lowest acceptable level. Noise-free, which is ok.

Obviously not meant to power today's demanding smartphones which can easily draw 1A with a charged battery and more if they are charging.

However it should be enough to reliably power most devices, though not at full charging speed.
The charger barely got warm at full power.


4) Slim no-name, no load.
The output is a bit on the high side, 5.2V would be the maximum acceptable. It also the telltale sign of cheap design, "overclocked" (overvolted) at low loads so that the voltage is not too low at high loads (bad regulation).
No noise, for now.

5) Slim no-name, 120 mA load.
Quite a bit of noise, I would say above the acceptable limit.


6) Slim no-name, 470 mA load.
This is a standard load for a USB 2.0 device and you can see that the noise is already unacceptable.

How can this affect your smartphone?
Well, for one, the capacitive touchscreen is really sensitive to noise so you would start getting ghost touches or it would miss touches.
Second, it would put more stress on the regulator parts inside the phone.
Third, there are quite a few devices which do not have an input voltage regulator, especially the cheap ones (USB gadgets) and if they have components rated at 5V (as most of them do) they are above rating at 5.5V, accelerating their destruction.
Fourth, noise can travel in a lot of ways: back through the socket to the devices under power from the same strip. Through the air and metallic connectors as radio waves. If you are doing sound recording or sensitive measurements this can definitely kill your performance figures.


7) Slim no-name, 850mA load.
Just for fun, we keep going further since the device is able to supply the power, though I would probably not use it to power anything of value.
Noise is already at 720mV, well above the acceptable limits (that means really bad).


8) Slim no-name, 920 mA load.


9 Slim no-name, 1.1A load
That's as much as this charger can provide. It got to a warm 40-45C, that's not so bad.
The only use case for this would be to charge up the aforementioned battery backup chargers, but only under surveillance (i.e. not leaving this unattended).



10) No-name with indicator LED, no load.
The indicator LED is a nice feature, it glows green when no charge is being drawn and changes to red when at least 500 mA are being drawn. In it's 'green' state the noise is fine, output a bit high.


11) No-name with indicator led, 460 mA load.
With a standard USB 2.0 load we can see some noise creeping in, above acceptable limits. However this is also the device's maximum rating and it got so hot that it melt part of the case, I suspect that's where the (Schottky?) diode or switching inductor are.



Conclusion?

The USB power is like the zoological garden of electronics. There's a well-defined standard but so few follow it that they seem outliers in this regard (see Apple's case with the iPhone 3G).

First of all, the computer manufacturers just deliver the 5V rail directly from the power supply instead of doing current-limiting. They have a 1-1.5A polyfuse that trips from time to time, but that's about it.

Then, probably only half the phone do real power negotiation via USB. Instead they draw progressively larger currents until the supply is not able to provide the rated voltage. I have quite a few phones lying around so I might do an analysis later.
If they do not do the above then they might do proprietary signaling via resistors on the data lines.

Then there's the issue of cables, I have at least 10 micro USB cables, but only 3 or 4 I can rely on. Some of them don't have data at all (made for headset charging), some of them have slightly different mechanical properties that are not compatible with other devices, some of them are not able to provide decent amounts of current.


I will make a follow-up to this post because this only took me one hour to perform (and another hour to write this) and I kind of missed the scientific approach.
I have a bag full of chargers, both for home and automotive, I'm guessing more than 20, so plenty of subjects for testing.

Highly recommended reading: http://www.righto.com/2012/10/a-dozen-usb-chargers-in-lab-apple-is.html

1 comment:

  1. I need usb cables because I lost mine. Sadly, I cannot find it until now.

    ReplyDelete