Electronic – Safely extract power from USB

ledpowerpower supplyusbvoltage-regulator

I am upgrading the lighting in a model with simple circuit which has 17 LEDs (approximately) plus one or two 555 timers. Presently, everything is powered by 3 AAA batteries. It drains between 150 and 250 mA (depending on how many LEDs I switch on).
Heads up: I'm new to electronics and lighting, so please bear with me anyway if the questions if not challenging enough 🙂

Once the circuit is done, I plan to extend it with two variations:

  1. Arduino Version: connect the LED circuit directly to the output pins (5V) of an Arduino board, with a resistor in each wire to compensate for the +0.5V excess.
  2. USB wired powered version, using a wall charger USB that provides 5V 800mA.

My question is: What should I do to adequately protect the circuit when using the USB version? Do I need a voltage regulator? If yes, what type/part?

As per my research, I don't need a regulator for the Android version, but I'm not 100% sure (comments on that will be welcomed too).

Edit: As requested, I've added a simplified schematic. The final version will have more leds and probably drain arround 200mA-250mA.

enter image description here

Best Answer

For the most part, an Arduino version and a USB powered version would be the same. The Arduino has a 5v regulated output.

The main problem is, if the schematic you post is accurate, is that 36Ω resistor, at 4.5v, with average led voltages (red 1.8v, yellow 2v, blue 3.3v) is pushing them past the ""standard"" max current draw of 20mA each. Is that 36Ω a typo? With 5v, its almost double that. The schematic implies with all 10 led/resistor series on, it's taking 151mA, so 15mA each. The math doesn't work.

Current = (Voltage Source - Forward Voltage Drop) / Resistance
Red: (4.5v - (1.8v * 2)) / 36 = 0.025A or 25mA. (5v - (1.8v * 2)) / 36 = 38mA Yellow: (4.5v - (2v * 2)) / 36 = 13.8mA. (5v - 4v) / 36 = 27mA Blue: (4.5v - 3.3v) / 36 = 33.3mA. (5v - 3.3v) / 36 = 47.2mA!

Only the yellow would be mostly safe, without increasing the resistance. Simply an extra resistor between 24~68Ω in series with the existing 36Ω for each led strand, would solve this with a maximum draw of 28mA to 16mA per strand. That's how you can protect the leds when using the USB power supply.

Now if you are going to power the leds from the Arduino, directly tied to the Microcontroller's pins, you will quickly eat through the 40mA per pin limit, or 200mA total limit. Especially on the blue section, where you have three leds in parallel. That's 47mA with the existing resistor, less if you add another resistor per led, but you would only be able to have 4 of the sections on at a time. In this case, if you need more, you would need a transistor with a resistor as well.

schematic

simulate this circuit – Schematic created using CircuitLab

The SW1 is the manual switch you have. The two 36Ω resistors are the same as a single 72Ω. The three leds are standard 3.3V Blue leds. The NPN transistor allows you to switch more current per pin than directly connecting them would (The 2n3904 tends to allow up to 200mA each). The 1k resistor provides ~4.5mA of current at the transistor base, which should saturate it.

In any case, with a bit of math as listed above, you should have all you need to figure any combination you need out.