I want to do something like the first of the gadgets in this video:

https://www.youtube.com/watch?v=aEo_nJ3iUYI (0:07 - 1:00)

It's a flashlight connected to the micro USB port in my cell phone, but I do not know if this is safe.

In case it can be build without problems, I've been looking for some information, and I have some doubts:

  1. A micro USB connector has 5 pin (VCC, D-, D+, ID, GND), to which one of these should I connect the resistor and the LED anode?
  2. So it can be used with any phone, what resistor should I use?

closed as unclear what you're asking by ThreePhaseEel, laptop2d, Wesley Lee, uint128_t, jonk Mar 3 '17 at 11:54

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


It highly depends on the phone. Some do not power OTG devices. Some will not enable power out if a slave device does not enumerate. And how much current you could pull depends too. If your only doing 20 to 300 mA your most likely okay.

Yes, you connect the led and leds current limiting resistor in series between VCC and Gnd. Anode towards VCC obviously.

As mentioned, as long as you keep the current low, it should work. The resistor will not change because all USB OTG devices should provide the same 5V power output. (Vsource - VForward) / IForward = Resistor value.


enter image description here Pin 1 to 4 on usb or 5V to gnd on micro-BF


Not the answer you're looking for? Browse other questions tagged or ask your own question.