Electronics > Beginners
LED Parameters
(1/3) > >>
admiralk:
I am working on a project where I need to light up to seven LEDs from a single micro-controller pin. I know that is not something that can generally be done, but I was looking at LEDs and found this one that lists If as 2mA. If I understand everything correctly, I should be able to use a 1k resistor and have it work fine. Since I rarely understand everything correctly, I am wondering what I am missing.
Ice-Tea:
You can run any LED @2mA. The question is just how much light comes out at that current. Look at the mcd rating.

I'm not sure how you're ending up with a 1k resistor? I assume 3V3 uC pin? 3V3 - 1V8 = 1,5mA? Anyways, why don't you just drive a FET or BJT to increase your current budget?
admiralk:
According to the datasheet 17mcd @ IF 2mA, if as I said I am reading it right. That is quite a bit more than some I was looking at that used 10mA.

I got the 1K from digikey's calculator; 5V @ 3mA.


--- Quote from: Ice-Tea on November 29, 2019, 09:38:42 pm --- Anyways, why don't you just drive a FET or BJT to increase your current budget?

--- End quote ---

That would be my preferred method, but in this case I have very limited board space.
Ice-Tea:
Depends on your uC IO voltage, obviously.

- A *lot* of red LEDs will get to that kind of mcd rating.
- You can get them in smaller SMD packages if you wish
- A transistor won't take a lot of space, you can get them in insanely small sizes if you wish. The additional space compared to your 7 LEDs and resistors will be distinctly 'meh'.

mariush:

--- Quote from: admiralk on November 29, 2019, 09:01:54 pm ---I am working on a project where I need to light up to seven LEDs from a single micro-controller pin. I know that is not something that can generally be done, but I was looking at LEDs and found this one that lists If as 2mA. If I understand everything correctly, I should be able to use a 1k resistor and have it work fine. Since I rarely understand everything correctly, I am wondering what I am missing.

--- End quote ---

Modern microcontrollers can typically output up to 50mA or so on each pin but there's usually a limitation on the total output on all pins, like for example 100-150mA through all output pins. The maximum current on each pin and overall also goes down with voltage: for ex a microcontroller may do 50mA per pin with 5v input, but only 20mA per pin if powered with 3.3v..3.6v
   
It's safer to just assume around 10-15mA maximum on each output pin.


If you want to use a single resistor to limit the current, you can use this formula to limit the current :

Input voltage - ( number of leds in series  x forward voltage of led ) = Current (in A) x Resistance value.

So for example, if you have 2 red leds with a forward voltage of 2v and you power everything using 5v and you want to limit at 5mA then:

5v - (2 leds x 2v) = 0.005A (5mA) x R 

so  R = (5-4) / 0.005 = 1 / 0.005 = 200 ohms , so you'd use either two 100 ohm resistors in series, or 210 ohm (less current) or 180 ohm (a big higher current)

7 leds is a bit odd.. if you can make it 8 then you can make 4 pairs of 2 leds in series, so then you'll have 4x the minimum current, 2x the forward voltage to deal with.

Below is a transistor tutorial, how to use one transistor to turn on or off something. Very easy for beginners to understand.
Remember though, don't use the transistor to actually limit the current to the leds, use the transistor like an on/off switch.
You'll still need a resistor to limit the current.



Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod