multiple leds drawing more than pin is rated for

Total newb here. Trying to build a Tardis door to my shop. Need 2 groups of leds. Group 1: 12 white leds. Group 2: 3 white leds. Each group to be controlled as a block: no mutiplexing. I am developing on an OSEPP Mega 256, but hope to move it to an attiny85 when it comes. Will power with 5V USB adapter. If I understand correctly, Arduino and attiny both have max of 40mA draw on IO pins. Assuming 20mA target for leds, and 2.5V drop, is it true that, for group 1, I can do 6 pairs of leds in parallel, with each pair being in series with a resistor? And this whole group would be powered by a transistor, with the pin going to the gate? Can I take power from the 5V source on the board safely?

If this us a ridiculously dumb question, could someone suggest a link or google term? I have been having a hell of a time finding answers that aren't about led arrays, multiplexing, addressable rgb leds, and other more complicated stuff.

Your 5v usb adapter may be able to provide power to your leds. What is amps is your adapter rated at?
What amps (ma), will your leds draw? Your arduino can be expected to draw 40-50 ma.

20 mA per pin is it.
40 mA per pin is an "absolute max" that ought to be avoided.

{And people can drink as much Coke as they bloody please, shove peanuts up their nose, stick pencils in their ears for all I care. If they "get away" with it, that's fine, but it's bad practice.)

Power supply is 1A. Leds are 20mA.

If 20mA is the recommended limit, the limit for directly driving most leds from pins is 1, right? So for bigger loads, do you usually use a Transistor? If so, can I take the supply from the 5V pin on the arduino, or do I have to get it before the arduino?

Thanks,
Shawn

Transistor would be great.
Power before would also be better, arduino regulators are limited.

glassgiant:
If 20mA is the recommended limit, the limit for directly driving most leds from pins is 1, right? So for bigger loads, do you usually use a Transistor?

"1" what?
1 mA? No. It's 20 mA draw from any "pin". I think there's a device total (which may not be 20 X 20 mA.)

It's the circuit on the right, Common Emitter. It's running off the power from before the regulator.

I always use these when I just want to switch a bunch of LEDs on/off:

KA2284 for sale | eBay (same thing, different manufacturer)

(datasheet: http://www.classiccmp.org/rtellason/chipdata/an6884.pdf )

Think of them as big transistors with five current-controlled collectors each (ie. each one can switch 5 LEDs).

Connect your Arduino output pin to pin 7 (PWM is fine and you can connect dozens of them to a single Arduino pin). LED anodes go to +5V, LED cathodes go to pins 1,2,3,4,6. That's it. No resistors or anything else are needed.

glassgiant:
Will power with 5V USB adapter. If I understand correctly, Arduino and attiny both have max of 40mA draw on IO pins. Assuming 20mA target for leds, and 2.5V drop, is it true that, for group 1, I can do 6 pairs of leds in parallel, with each pair being in series with a resistor? And this whole group would be powered by a transistor, with the pin going to the gate?

No. You are proposing to put 2 LEDs in series, and run that from 5V. That is OK for low-intensity red LEDs (which have low forward voltage), but not for any other sort. The power supply needs to be at least the sum of the LED forward voltages, plus some more so that the series resistor is effective at controlling the current. I suggest at least 0.5V extra per LED. So if the 2.5V drop per LED is accurate (and that sounds rather low to me for a white LED), then you need at least a 6V supply.

I suggest instead that you use a 12V regulated wall wart, and put groups of 3 LEDs in series. You can use an NPN transistor to switch a group, or several groups in parallel. You can use the same 12V supply to power the Arduino via the barrel jack, and use a small voltage regulator such as 78L05 (and the required capacitor(s)) when you migrate your design to an ATtiny.

Runaway Pancake: "1 what?"
What I was trying to ask, poorly, was "is it true that you can't generally power more than one led per pin? (directly)" :slight_smile: Thanks, that diagram is helpful.

Fungus:
That seems useful. Just ordered some.

Dc42:
If I wanted to stick with the 5V, could I use single leds, in parallel? I'll double check my led voltage.

glassgiant:
Dc42:
If I wanted to stick with the 5V, could I use single leds, in parallel? I'll double check my led voltage.

Yes, provided that each LED has its own series resistor. That makes the total current 12 * 20 = 240mA for the first group and another 60mA for the second. Make sure you use suitable transistors, i.e. one that has a reasonable hfe and low saturation voltage @ 240mA collector current. A BC337 with a 220 or 330 ohm base resistor should be OK.

Maybe I'll try that, then until my led drivers come. You lost me on the technical specs of the transistor, so it looks like I have some reading to do. :slight_smile:

glassgiant:
Maybe I'll try that, then until my led drivers come. You lost me on the technical specs of the transistor, so it looks like I have some reading to do. :slight_smile:

Start here: BJT H

But for simplest circuit/fewest components I'd use the AN6884s.