0

If I connect this very small load (3 LEDs) to a mains to USB adapter, it's fine. Full brightness, great.

I can't even measure the current it's so low.

However, if I connect it to my PC it does 3 things:

It flashes a bit from bright to dim, stays dim and windows says it's malfunctioning.

Nothing has shorted out or anything like that, so is there a minimum current I should be drawing from a PC's USB port?

Marcus Müller
  • 88,280
  • 5
  • 131
  • 237
  • I think you've measured, or connected something wrong, can you give more details of the setup and how you made the measurement – Jasen Слава Україні Dec 19 '16 at 21:23
  • It was measured correctly, just using one of the little USB testers that are so common nowadays. – DespairingSquid Dec 19 '16 at 21:27
  • 1
    How are the LEDs connected (series/parallel)? What is their forward voltage? Is there really no series resistor? – dim Dec 19 '16 at 21:40
  • 1
    + most LEDs have a forward current somewhere between 5mA and 20mA – even the cheapest multimeters I've ever seen can measure that. You will have to add a drawing of your system, or else it remains unclear! – Marcus Müller Dec 19 '16 at 21:43
  • It's possible the PC is complaining because it can't work out what's plugged in and is cutting the power (I have an intel atom board that does something similar - it can be a real pain sometimes) – Sam Dec 19 '16 at 21:57
  • 1
    it could be that the measuring device is inaccurate, I have one that matches that description, and with it any current under 50mA reads as 0 – Jasen Слава Україні Dec 20 '16 at 00:44

2 Answers2

1

A device on a USB 2.0 port can initially draw 100mA. It then negotiates a power budget and potentially draw up to 500mA.

When you use a USB phone charger, it will simply give you up to 1A.

So the PC is probably giving the port enough power for it to be bright. Then the device fails to negotiate and the PC cuts the power, making it dim. Note that what the PC does and what it is supposed to do may be very different.

There is a lot more information at this question: How to get more than 100mA from a USB port

Ken Shirriff
  • 2,694
  • 15
  • 23
  • I believe there exist special adapters that do the hard part for you, to negotiate with the computer for more current. – Bradman175 Dec 19 '16 at 22:37
  • This is incorrect. A **device** can't draw more than 100mA before it gets enumerated and configured. This is true for USB device. A **normal port**, however, must be capable to supply 500mA minimum. More, device does not negotiate anything. It only informs the host of power requirements. The host can refuse the connection, which may happen only in rare situations of "low power embedded hosts" or "bus-powered hubs" (which nobody produces these days). – Ale..chenski Dec 19 '16 at 22:41
  • The port, as you say, should default to 5 volts, 100 ma. This should be more than enough for three small LEDs. The OP needs to clarify exactly what is in his circuit that 100 ma isn't sufficient. – DoxyLover Dec 19 '16 at 22:43
  • You're assuming that the LEDs have a forward current of 20mA, and that they're not ultra-bright 75mA+ devices. – Polynomial Dec 19 '16 at 23:37
  • I would guess that OP uses 3 LEDs 300mW in parallel, and without any current-limiting resistor. They could be 4.2 V to start. Wall charging adapters usually are designed to gradually drop output voltage under over-load, so an intelligent consumer can reduce its charging current. So the 3 LEDs are having say, 4.4V and shine. The USB port might have a poly-fuse that protects the port/system from overload. With 5V the three LEDs are likely getting more than 500-600mA, so the port barfs off (out). – Ale..chenski Dec 19 '16 at 23:53
0

Depending on whether you have PC based USB or mobile device USB or USB-on-the-Go capable controllers there IS active current limiting built in. In the crudest and oldest systems there was a 500mA fuse. Blow that and you were essentially dead in the water.
Then came the era of PTC resistors, draw too much current and the voltage collapsed. At least these self reset, but as you increased load the voltage would droop.

Today controllers have high side current limiters either in the USB controller or around it as a support chip. Various kinds exist like this. These devices can do multiple duty, they can limit the current accurately at multiple levels, and can be controlled to increase the current or to turn it off completely. Many of the modern USB limiting controllers will supply up to a negotiated 2.5 A, and will even slow charge large capacitive loads in the devices.

With a modern current limited USB port the OS can be told when power is being drawn and even how much (usually in units of 100 mA) so that the OS can catalogue current budgets. For example in Windows you can examine any given USB port and find it's current demand in units.

Now to your problem. Since you can't have 3 LEDs in series (they won't ever light), they must be in parallel.
If the 3 LEDs are in parallel then I wonder what sort of LEDs you have. Since LEDs don't limit their current (unless it's a CC LED) and the forward voltage is like this:

enter image description here

You would need to have a series resister with any LED I know of to limit current. I can only imagine if this is not the case then your mains USB power supply was actually drooping due to the LEDs. You should have seen current values well above 100 mA.

To answer your question more directly you will be able to connect 3 LEDs in parallel to a PC based USB port but you'd need at least 1 series resistor to do this. You also may see the PC report no driver loaded or illegal device base don current flowing and device interaction.

Hope this helps.

Jack Creasey
  • 21,428
  • 2
  • 15
  • 29
  • Hey Jack, I don't think your optimistic review reflects reality accurately. First, yes, there are current limiters, but the active high-side switches are outrageously expensive. So no manufacturer uses them. 90% of all hubs on market use at most ONE resettable fuse for ALL FOUR PORTS. Therefore the limit is north of 2+ Amps, so each particular port can source all 2A. The other 18% might use individual polyfuses per port. I would challenge you to find a single hub with active port power control in your local electronics store. I have never seen any high-side switches on any PC mainboard. – Ale..chenski Dec 20 '16 at 01:22
  • @Ali Chen. You are right, you don't see high end current limiters in Hubs and do see a single PTC for all the ports....but these are very cheap devices. Most of the current protection provided by the USB power supply. But you do see them in PC's and tablets all the time....they can't afford not to. And unlike you I have seen high side protection in most decent motherboards. Intel, Dell, HP and the like – Jack Creasey Dec 20 '16 at 01:56
  • Jack. Ok. I am looking at INTEL reference design desktop board "LL2_CRB_MPI" socket LGA1155. It has a polyfuse for each pair of USB ports. 2A for USB3 ports, and 1.5A for USB2 port pairs. Is the Intel reference design a decent example? – Ale..chenski Dec 20 '16 at 02:49
  • @Ali Chen. Even my Raspberry Pi's have both active and adjustable USB current limit. – Jack Creasey Dec 20 '16 at 03:57
  • Jack, Rapsperry Pi might have it, because it is a subsidized developer kit. Given that they have uB connector as power jack (1.8A max), they have to have an accurate limiter. And then they have about 300 complaints from users that many USB HDD 2.5" USB enclosures cannot work with Pi's crippled power delivery. – Ale..chenski Dec 20 '16 at 04:48
  • @Ali Chen. The Raspberry Pi active current limit can be adjusted from it's default of 600 mA to 1.2A. It's based on the http://www.diodes.com/_files/datasheets/AP255x.pdf high side current controller . ....What makes you think the Raspberry Pi organization is subsidized? They are not even a non-profit. Anyway.....let's not argue. In my opinion there are ample cheap devices (eg AP2553 @ about $0.15) for USB current limiting in addition to the PTC (polyfuse) solutions (eg 1210L @$0.40). Your experience may differ. – Jack Creasey Dec 20 '16 at 05:31
  • Well Jack, My experience is that none of mass-produced consumer electronics enjoys the sophistication of high-side switches, especially in capacity to "negotiate" power delivery. Maybe future devices will do real PD, but not now and not in volume. I have a HP business class desktop in front of me. It does have some AP21xx switch in proximity to six USB ports. However, every port easily delivers 2A of current, no overcurrent/port shutdown happens. There is a big difference between what some devices can do, and what market economy can bear. – Ale..chenski Dec 20 '16 at 22:38
  • @Ali Chen. But as you note, even your HP desktop (clearly a mass-produced device) has high side current limiting even if it's only one limit device for all six ports. I would believe that all six ports are limited to some upper threshold. If the current limit is 2.5 A for example (so you could charge an iPad), then that is 2.5 A total over all six ports or from one port. I think you just proved my point. – Jack Creasey Dec 21 '16 at 00:37