I have a USB keyboard. As I work many times in the darkness, I put some LEDs into the keyboard case. I connected two pairs of yellow standard LEDs serially to the USB power lines (Vcc and ground, pin 1 and 4).
┌───⊳|───⊳|───┐
⊕─┤ ├─⊖
└───⊳|───⊳|───┘
Now when I plugin the keyboard the four yellow LEDs turn on for a second, begin to flicker and then turn off. The keyboard works, though.
Standard LEDs need about 20 mA, if driven at the correct voltage (2.5 V might be a bit to much, that means they possibly need more than 20 mA). So for two pairs of serially connected LEDs that would only be 40 mA (or maybe a bit more due to overvoltage — at least I am sure that they need more than 1,67 V, because if I connect three LEDs serially to the USB, they don’t light up).
Why does that happen? Does the keyboard possibly tell the computer that it doesn’t need so much current/voltage and then the computer cuts it down?
Update
I have just soldered two cables to a USB powered USB hub and plugged them together with a similar four LED array into a breadboard. And what happened: The LEDs shine and stay lit up for ever. Then I connected my modified keyboard with its four new LEDs. The four LEDs in the breadboard stay lit, but the ones in the keyboard turn off again after a second. The keyboard works. I am using it to type this. How is that possible?
I have measured current and voltage for the LEDs on the breadboard: The USB hub provides a voltage of exactly 4.2 V! A current of 19 mA runs through the breadboard LEDs. A little bit low for two LEDs in parallel, but I don’t need a resistor.