LEDs in parallel, resistance and more

Hi,

So, my electronics knowledge is limited. I'm going to build a thing with LED buttons. I'm getting three of these (3V) and three (or possibly six) of these (2.2V) and hooking them up to a USB powered 5V Pro Micro. The orange 2.2V ones I want to be lit up at all times, and the white 3V LEDs only when its button is pressed.

How do I accomplish this?

All I/O pins on the Pro Micro will be used for various components. (not including the button LEDs) I'm thinking I will wire the oranges (in parallel?) to VCC. I read that using a single resistor in series with parallel wired LEDs is not a good idea as forward voltage may differ slightly. So I will need one resistor in series with each LED? For the whites I'm thinking I should be able to wire these directly to their button switches, but I'm unsure of the resistance also in this case. The whole thing with limiting resistors for LEDs just confuses me. I roughly understand the concept, but not when it comes down to the details.

Thanks for any help

Yes, each LED needs it's own resistor.

[u]LED Resistor Calculator[/u]

For the whites I'm thinking I should be able to wire these directly to their button switches, but I'm unsure of the resistance also in this case.

Since the voltage across the LED is higher for white, the voltage across the resistor is lower and the current will be less (assuming) the same resistance. Or of course, you can use a lower resistance.

You won't be able to see the LED very well with your finger over it. :wink:

The whole thing with limiting resistors for LEDs just confuses me.

It confuses a lot of beginners. Ohm's Law is a law of nature and it's always true, but LEDs (like all diodes) are non-linear. The resistance changes (drastically) when the voltage changes so it's not helpful to apply Ohm's Law directly to the LED. We have to calculate voltage, resistance, and current for the resistor.

The nice thing is that the LED voltage "falls into place" (as long as the current is within normal parameters) so we know the voltage across the LED. If we know the total voltage we know the voltage "remaining" across the resistor and we just have to calculate the required resistance for the desired current.

...In cases where you have higher voltage you can wire LEDs in series with just one resistor. In series, the same current flows all of the LEDs & resistors and the voltage is divided among the series components.

DVDdoug:
It confuses a lot of beginners. Ohm's Law is a law of nature and it's always true

Ah, this old chestnut again.

Ohm's law is not always true. It is not actually a law even, its just the observation that
many types of material that conduct electricity have a resistance independent of the voltage
applied.

It applies to metals, semiconductors of constant doping (ie no semiconductor devices other than
raw hall sensor chips), electrolytes.

It definitely doesn't apply to any insulators, any semiconductor devices with differently doped
parts (diodes for instance), superconductors, or even to a vacuum)

Resistance is defined to be V/I, ohm's law is that resistance is constant (for constant temperature)
in a wide range of conductors. ie. that its not dependent on V or I. Its a statement about the
physics of materials, not about the nature of resistance itself. (*)

For a tungsten bulb the temperature of the filament varies dramatically as current changes, meaning
the resistance does too, so Ohm's law does not usefully apply in this case either (unless you can
guarantee the temperature is fixed, for instance with fast ac signals too fast for the temperature to follow
the changes).

Lots of people think Ohm's law is that V=IR, but that is not it, its simply the definition of resistance. And
that is indeed "always true", but it isn't Ohm's law until R is constrained to be a constant.

(*) its only approximately true anyway - at extremely high current densities it breaks down, but
normally this isn't important because at those current densities conductors are too busy vaporizing
to be measured with a multimeter(!)

Just a thought that might be helpful. For similar brightness the orange and white LED's will likely require different current. Once you calculate the Ideal resistor you should expect to have to perform some trial and error to get the brightness balanced for the two different color devices.

DVDdoug:
Yes, each LED needs it's own resistor.

Alright!

DVDdoug:
You won't be able to see the LED very well with your finger over it. :wink:

Right. Actually I'm getting the variant that has toggle functionality! :slight_smile:

DVDdoug:
If we know the total voltage we know the voltage "remaining" across the resistor and we just have to calculate the required resistance for the desired current.

This is the part where I get confused, I think. I'm on board with working with the "remainder" of the voltage for the resistor, and voltage is always clearly specified for everything. I'm also comfortable with Ohm's law. But the current bit gets me. I don't know what the desired current should be. Sometimes that's also specified for LEDs, I guess, but it's not nearly as obvious, and in this case I didn't see any such info at least on the store page.

JohnRob:
Just a thought that might be helpful. For similar brightness the orange and white LED's will likely require different current. Once you calculate the Ideal resistor you should expect to have to perform some trial and error to get the brightness balanced for the two different color devices.

Sure! I have lots of resistors of different values here, so I'll be trying some stuff.

Indicator LEDs are usually specified for 20mA absolute max.
It's up to you how much current you push through them, but it should be less than 20mA if you want them to last.

1mA could be enough or even too much if you use them in a dark room, and 20mA might not be enough if you use them in bright sunlight.

Say you have a 5volt supply and want to try 10mA (0.01A), for a LED with a Vf (working voltage) of about 2.2volt@10mA.
Then 5-2.2= 2.8volt needs to be dropped by the resistor.

For 10mA, a resistor value of 2.8/0.01= 280ohm is needed. 270ohm is the closest value.

That value is not critical, and you probably won't see a lot of difference in brightness if you use a 220ohm or 330ohm resistor.
Blue/white LEDs, with a Vf of ~3.3volt, are usually brigher, so can do with less current.
Try using the same value resistor as calculated for the 2.2volt LED.
Leo..

Oh, right. So, the current is determined by the resistance in the circuit. I thought a certain current was somehow given, similar to the voltage. I think that’s the key part I’ve been missing. That makes more sense now. And LEDs have virtually no resistance, so the resistance is wholly determined by the resistor, right?

So now, if I have three buttons with LEDs in parallel, each LED will have a third of the total current, and thus should have a third of the original resistance in order to achieve the same result? I will make some diagrams tomorrow to see if things check out.

And LEDs have virtually no resistance, so the resistance is wholly determined by the resistor, right?

Sorry wrong. An LED has an effective resistance but it changes with the voltage across it. It drops very rapidly as it approaches the forward voltage of the LED. The resistor is there to take up the slack so to speak to limit the current to the current you want to go through the LED.

So now, if I have three buttons with LEDs in parallel, each LED will have a third of the total current, and thus should have a third of the original resistance in order to achieve the same result?

No, sorry that is nonsense. The current flows in a parallel circuit just the same as it would flow through a single leg of the parallel circuit. When the elements stop being in parallel then the currents would add up not split.

Never wire raw LEDs in parallel they will not share current evenly. You must put a resistor in series with each LED before connecting the resistor / LED combination in parallel with any other resistor / LED combination.

Grumpy_Mike:
Sorry wrong. An LED has an effective resistance but it changes with the voltage across it. It drops very rapidly as it approaches the forward voltage of the LED. The resistor is there to take up the slack so to speak to limit the current to the current you want to go through the LED.

Hm, ok... I now have several more questions, but this is just too much for me right now. Can I at least trust that required resistor resistance = (total voltage - LED voltage) / desired LED current?

Grumpy_Mike:
No, sorry that is nonsense. The current flows in a parallel circuit just the same as it would flow through a single leg of the parallel circuit. When the elements stop being in parallel then the currents would add up not split.

Never wire raw LEDs in parallel they will not share current evenly. You must put a resistor in series with each LED before connecting the resistor / LED combination in parallel with any other resistor / LED combination.

Ok, I guess the logic was in the wrong order. What I meant was, If I have three times [LED + resistor] in parallel, the current through each LED will be a third of what it would be, had there only been a single LED + resistor (of same value) in series?

What I meant was, If I have three times [LED + resistor] in parallel, the current through each LED will be a third of what it would be, had there only been a single LED + resistor (of same value) in series?

No, three LED/resistors in parallel will draw three times the current from the source, than will one LED/resistor.

Each LED gets about the same current, in every case.

Each LED gets about the same current, in every case.

This is because the voltage across the LED / resistor combination is always the same.

But you push things too far and you draw too much current from the Arduino pin. When that happens the voltage across all LED / resistor combinations drops and the brightness drops, because the pin can not cope with that much current.

I wrote a page about this, it is specifically for the Raspberry Pi, but the principals apply to any processor pin.
http://www.thebox.myzen.co.uk/Raspberry/Understanding_Outputs.html

What I meant was, If I have three times [LED + resistor] in parallel, the current through each LED will be a third of what it would be, had there only been a single LED + resistor (of same value) in series?

That is what I thought you meant.

jremington:
No, three LED/resistors in parallel will draw three times the current from the source, than will one LED/resistor.

Each LED gets about the same current, in every case.

Okay, yeah, that just occured to me. So the current per LED remains unchanged, and instead the total current is tripled. Got it.

Ok, I've come up with two different designs that I'm not entirely sure about. Especially the latter, in which I'm not sure whether there's going to be any pull down, or if there's a problem with resistance.

D0 and D1 are digital inputs. (INPUT) When a button is pressed, the pin should read high and the LED should light up. I'm using 3V LEDs for this circuit, and aiming for around 10 mA.

The buttons are latching and may stay pressed for extended periods of time.

Both circuits will work, but the 10K resistors are not needed.

What is the Arduino supposed to do?

Will it not short without R2 and R4 in the first circuit?

It will be used as a game controller.

jremington:
Both circuits will work, but the 10K resistors are not needed.

What is the Arduino supposed to do?

Actually the resistors may be needed. Once an LEDs voltage is well below its normal forward resistance the
current flowing becomes vanishingly small, allowing the capacitance of the LED junction to hold the voltage
up for a considerable time, certainly long enough to risk false readings if sensed immediately after
de-energizing the LED.

Some LED semiconductors have much lower leakage currents than silicon, mainly because their bandgap voltages are a lot higher.

With a multimeter you'd never notice this, but analog pins take a few picoamps only, so won't help
to discharge the LED capacitance.

I experimented with a blue LED (higher Vforward), and without a pull-down resistor it took between
about 50 to 500us to read as LOW, with 100k pull down it was a couple of microseconds. With
a 3M3 pulldown about 20us.