Go Down

Topic: Multiple Led solution (Read 286 times) previous topic - next topic

ciabio

Hello everyone .. I want to know if you can connect two white LEDs to a single digital pin.

to better explain my intent:

i have two sections:

section 1: 

32 holes I would like to add 32 LEDs that always light in group of two.
I put unimmaine gif to understand better.

section 2 :

16 holes with 16 white LEDs that flash individually in time with ableton...

I have a teensy 3.6
the leds are 20 mA

which is the simplest method without adding external hardware

thanks  :)  :)

teunman

Hi ciabio,

You can definitely hookup two leds on one digital pin, don't forget to put a resistor in series with the led to prevent damaging them.

So for section one you would need 16 digital pins.

For section two, if you want to do what you are doing in the GIF , you would need a pin for every led (so 16).

A teensy 3.2 has 34 digital pins (some shared with analog) so you should be fine.

Hope that helps

 

ciabio

Hi ciabio,

You can definitely hookup two leds on one digital pin, don't forget to put a resistor in series with the led to prevent damaging them.

So for section one you would need 16 digital pins.

For section two, if you want to do what you are doing in the GIF , you would need a pin for every led (so 16).

A teensy 3.2 has 34 digital pins (some shared with analog) so you should be fine.

Hope that helps

 
thanks

should i put a resistor for every led ? and what should be the value of the resistor ?

thank youuu

teunman

look at this example

https://www.arduino.cc/en/Tutorial/Blink
(look at the bit with the external LED)

And you would need a resistor for every pin you use (so for section one use one resistor per two LED's)(and for section two use one per LED).
The reason you need a resistor is that the LED usually can't handle the power (voltage X current) the digital pins provides to it. So by putting a resistor in series you reduce the power going into the LED.

The value of the resistor depends on the LED you are using, you can easily calculate it by looking up the max power of the LED and the current and voltage output of the digital pins.

You are welcome :) don't forget to post pictures when you are done !

Grumpy_Mike

Quote
so for section one use one resistor per two LED's
No No No.

No apostrophe needed in LEDs but more importantly you need one resistor on each LED because LEDs in parallel do not share current equally.

Quote
The reason you need a resistor is that the LED usually can't handle the power (voltage X current) the digital pins provides to it.
No it is the current not the power, LEDs are a non linear device and do not obey ohms law.

Quote
The value of the resistor depends on the LED you are using, you can easily calculate it by looking up the max power of the LED and the current and voltage output of the digital pins.
That is not a quality answer.
The total current from one Arduino output pin should not exceed 30mA, anything over 40mA damages the processor. So you can't run two LEDs from one pin @ 20mA each. Anyway that would probably be too bright to look at directly so calculate the resistor for a 10mA current.
However before you can calculate the resistor you need to know the forward voltage drop of the LED, if you don't have a data sheet you will have to measure it.

ciabio

No No No.

No apostrophe needed in LEDs but more importantly you need one resistor on each LED because LEDs in parallel do not share current equally.
No it is the current not the power, LEDs are a non linear device and do not obey ohms law.

That is not a quality answer.
The total current from one Arduino output pin should not exceed 30mA, anything over 40mA damages the processor. So you can't run two LEDs from one pin @ 20mA each. Anyway that would probably be too bright to look at directly so calculate the resistor for a 10mA current.
However before you can calculate the resistor you need to know the forward voltage drop of the LED, if you don't have a data sheet you will have to measure it.
thanks

the current voltage from the white led are 2.8-3.6 

ciabio

its not an arduino but a teensy 3.6   :)

Grumpy_Mike

#7
Jun 13, 2018, 07:23 pm Last Edit: Jun 13, 2018, 07:31 pm by Grumpy_Mike
Quote
the current voltage from the white led are 2.8-3.6
Under what circumstances? That is what current. Try it with a 220R resistor in seriese with the LED and measure the voltage across the resistor so you can calculate the current. Change the resistor value and try again until you get about 10 to 15 mA. And then use that value.

its not an arduino but a teensy 3.6   :)
In which case you can only get 3V3 out of the pins and the current is limited so for driving white LEDs you need a resistor and transistor. Like this:-

This means you can drive more current through the LED hence the 51R resistor, but the while LEDs I used here could take that current, I would recommend you do the experiment like I said.

Wawa

Not good practise, but you can drive two (or more) the same LEDs in parallel with one common CL resistor off one pin, as long as you calculate the resistor for max current of a single LED. They should be almost the same brightness if they are from the same batch/colour.

16 pairs could mean 16*0.02Amp = 320mA.
That's most likely over the total max allowable port/package current of the MCU.
Leo..

Grumpy_Mike

#9
Jun 14, 2018, 10:51 am Last Edit: Jun 14, 2018, 10:51 am by Grumpy_Mike
But what about the maximum voltage of 3V3, a white led is not very bright at that voltage in my experience.

Wawa

But what about the maximum voltage of 3V3, a white led is not very bright at that voltage in my experience.
Ahhh, the Teensy 3.6 is ofcourse a 3.3volt processor.
Not a good choice for white LEDs.
Drive transistors and a 5volt supply then (post#7), or a 5volt Arduino.
Leo..

ciabio

Ahhh, the Teensy 3.6 is ofcourse a 3.3volt processor.
Not a good choice for white LEDs.
Drive transistors and a 5volt supply then (post#7), or a 5volt Arduino.
Leo..
thank you...

the only solution is to add external hardware ?

thanks

Grumpy_Mike

the only solution is to add external hardware
Or change your processor.

Go Up