Author Topic: How do I calculate the current draw of an LED if I don’t run it at full power?  (Read 4528 times)

0 Members and 1 Guest are viewing this topic.

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
There are a ton of online LED resistor calculators but they all assume I want the full brightness.
So, if I have a 3V 20mA LED and want tor run it at 5V I need a 100 Ohm resistor. How do I calculate the current draw if I use a 330 Ohm resistor? I’m not really sure how to apply Ohms law here. Or is it just something depending from LED to LED?
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Each color has got its own "forward voltage drop Uf" at the LED's pins when a current If flows through it.
For example red is 1.7V, blue is 3.5V etc. Google for the voltages.

Now, the current via the led will be:

If = (U - Uf)/R, where U is your battery or source voltage and the R is the serial resistor.

Example with 5V source, 330ohm serial resistor and a blue led:

If = (5V - 3.5V)/330ohm = 4.5mA

https://www.lumex.com/led-color-guide.html
« Last Edit: August 14, 2019, 07:58:35 am by imo »
Readers discretion is advised..
 
The following users thanked this post: optoisolated

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Fantastic! Thank you very much. :D
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12413
  • Country: au
When you decrease the current through an LED, the forward voltage drop also decreases - but not in a linear fashion.

The formula given by imo will give you a reference figure that will be good enough for most circumstances.  If, however, you want to be precise, you will need to refer to the datasheet for the LED - but I'm inclined to say you won't really need to do that.
« Last Edit: August 14, 2019, 12:31:55 pm by Brumby »
 

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
And how is it when I do it the other way around and want to achieve a specific voltage?
I have a 3V 20 mA LED and want to run it at 2.6V. Do I then look up the current from the curve on the datasheet and use the current draw at 2.6V to calculate my resistor or do I still assume 20mA?

I have this white 7 segment LED:
https://datasheet.lcsc.com/szlcsc/SUNLIGHT-SLR0281DWC1BD_C225876.pdf
What confuses me is that the second page says 20mA at 3V but the graph on page 5 says 35mA at 3V!? Did they just mislabel that?
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
That datasheet says  forward voltage min 2.4v , typ 3.0v , max 3.4V  when testing with a current of 20mA.
5v is probably the reverse voltage tolerated.

With such a display, you aim for typical voltage of 3v or be pessimist and aim for around 3.2v and then calculate resistor for each segment for the current you want.

ex if you want 10mA and you power from 5v, then (5v - 3.2v) / 0.01a = 1.8/0.01 = 180 ohm.

You're gonna waste a lot of power in these resistors. Each resistor will dissipate P = IxIxR = 0.01 x 0.01 x 180 =  0.018 so with 7 segments lit, that's 0.125w on resistors alone.

If you have a lot of digits and you need high efficiency it would be smarter to use a 3.3v switching regulator to get 3.3v out of 5v and then choose resistors accordingly.
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
That datasheet says  forward voltage min 2.4v , typ 3.0v , max 3.4V  when testing with a current of 20mA.
5v is probably the reverse voltage tolerated.

With such a display, you aim for typical voltage of 3v or be pessimist and aim for around 3.2v and then calculate resistor for each segment for the current you want.

ex if you want 10mA and you power from 5v, then (5v - 3.2v) / 0.01a = 1.8/0.01 = 180 ohm.

You're gonna waste a lot of power in these resistors. Each resistor will dissipate P = IxIxR = 0.01 x 0.01 x 180 =  0.018 so with 7 segments lit, that's 0.125w on resistors alone.

If you have a lot of digits and you need high efficiency it would be smarter to use a 3.3v switching regulator to get 3.3v out of 5v and then choose resistors accordingly.

3.3V would have a hard time driving the LED if it has a max forward voltage of 3.4 (as per specs from datasheet mentioned above).

You need a little bit of headroom over the forward voltage if you want to get a consistent result given the natural variations in parts.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
The maximum voltage is most likely at the worst case scenario like -20 degrees Celsius (because they say operating at -20...60c) -- edit: well. probably not, they say 25c ambient temperature above that table in the datasheet.
You can read the chemistry used to make those leds and then you know the typical forward voltage for that chemistry


ex see
https://www.lumex.com/led-color-guide.html
https://kithub.cc/2015/11/how-many-volts-are-needed-to-power-an-led-2/

but fine... use 3.6v then, still you would get a lot higher efficiency than just plain resistors.
« Last Edit: August 18, 2019, 12:36:39 am by mariush »
 

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Thank you guys. You helped me a lot. :D
Maybe you have advice for my general problem why I need to cut on power consumption?
I am making a keyboard PCB with 81 white backlit keys and one white, single digit, 7 segment display. So, as USB 2.0 has a current limit of 500mA I am already spending it all on the LEDs and have nothing left for the logic. Also, some extra breathing room would be nice. Every Milliamp counts for me.
With 330 Ohm resistors I get a still OK brightness. I need this very specific shape of LED to fit into the key switches which I can only find on Aliexpress. Sadly, no datasheet.

https://de.aliexpress.com/item/732147746.html?spm=a2g0o.productlist.0.0.72e453d5dlkSA3&algo_pvid=b32c507b-2dc9-4355-83a1-64cc0bf6c1b4&algo_expid=b32c507b-2dc9-4355-83a1-64cc0bf6c1b4-5&btsid=e1ab5d14-5ad2-4d29-ac36-32aba0fa0c7b&ws_ab_test=searchweb0_0,searchweb201602_7,searchweb201603_53

I need a compromise between brightness and current draw. Are there other ways than higher resistors to save current draw? There are 104 key Keyboards with full RGB light behind every key. I don’t know how they do that. Are they maybe even relying USB 3.0’s 900mA?
« Last Edit: August 18, 2019, 07:55:30 am by Blitzschnitzel »
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3283
  • Country: us
I need a compromise between brightness and current draw. Are there other ways than higher resistors to save current draw?

Multiplexing is usually described as a way of being able to control a lot of leds with a small number of control lines, but it also reduces power consumption since only a fraction of the leds will ever be lit at any one time. Due to the eye's persistence of vision it appears that all of the leds are on simultaneously:

https://youtu.be/6piP5YuK0Lc

Quote
There are 104 key Keyboards with full RGB light behind every key. I don’t know how they do that. Are they maybe even relying USB 3.0’s 900mA?

Special led driver chips are used such as:

http://www.issi.com/WW/pdf/31FL3732.pdf

Besides multiplexing, usage of PWM control also reduces power consumption if the leds don't have to be driven at full brightness.

Here's a discussion of a DIY RGB keyboard. It uses a bunch of TLC5940 led drivers.

https://www.reddit.com/r/MechanicalKeyboards/comments/5s1l5u/photoskeyboard_science_i_made_a_handwired_rgb/

And github repo which contains a Fritzing file:

https://github.com/jodigiordano/mode_keyboard
« Last Edit: August 18, 2019, 09:23:26 am by ledtester »
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
There are surface mount leds that can easily fit inside keys or besides keys, and they're not expensive (well, they're a bit more expensive compared to those aliexpress but not by much)

TME.EU - White surface mount leds
Digikey - White surface mount leds

0603 are a bit difficult to solder wires to but with a bit of patience and maybe a magnifying glass it's possible. 0805 is fairly easy. Bigger sizes are super easy. You can just tin solid core wire and the terminals of the led and then place the solid core wire on the terminals and tap with a soldering iron to make the connection and that's it, you have through hole leds.

Here's a couple examples:

0603 : 3.8 cents each in packs of 50:  https://www.tme.eu/en/details/ll-s194pw-w2-1c/smd-white-leds/lucky-light/
 LUCKY LIGHT LL-S194PW-W2-1C
LED; SMD; 0603; white cold; 200÷250mcd; 130°; 20mA; 2.8÷3.8V

2216 : 3 cents each in packs of 50: https://www.tme.eu/en/details/rf-k30ti16ds-ee-y/smd-white-leds/refond/
 REFOND RF-K30TI16DS-EE-Y
LED; SMD; PLCC2,2216; white warm; 6÷10lm; 2850-3050K; 90; 120°; 20mA, 2.7v..3.3v

As for how to get most efficiency, your best bet would be to boost the voltage to around 16-24v using a step-up (boost) switching regulator, and then use led driver ICs to control the current.
For example, let's say you go with the 2216 leds above, with a maximum forward voltage of 3.3v
You could go with 2 or 3  8 channel led drivers. This gives you 16 or 24 channels to play with.

With 16 channels, you could have 6 leds per channel for a total of 96 leds but you would need a voltage of minimum 6 x 3.3v = ~20v
With 24 channels, you could have 4 leds per channel for a total of 96 leds, and the voltage is lower at 4 x 3.3v = 13.2v
With 32 channels, you could have 3 leds per channel for a total of 96 leds, and the voltage is lower at 3 x 3.3v = 10v

Most LED drivers will need at least 0.5v..1v above the sum of forward voltages to work properly.

Led drivers with lots of channels are super cheap and super easy to use, basically shift registers. They can be chained together so you send data to just one chip and it's very easy to turn on and off leds individually if you so desire.
You can set the maximum current using a single resistor (for example 10mA) and then some shift registers allow you to send a command to adjust the brightness in either 0..100% or 256 levels ... basically, they reduce the current from maximum set through the resistor.

Here's some examples of such chips :

STP08DP05TTR : https://www.digikey.com/product-detail/en/stmicroelectronics/STP08DP05TTR/497-6029-1-ND/1632058
8 channels, up to 100mA per channel and 20v per channel , set max current through a resistor and can adjust "brightness" through a pin.

STP16CPC26PTR https://www.digikey.com/product-detail/en/stmicroelectronics/STP16CPC26PTR/497-11923-1-ND/2757659
STP08DP05TTR https://www.digikey.com/product-detail/en/stmicroelectronics/STP08DP05TTR/497-6029-1-ND/1632058
16 channels, up to 90mA per channel and 20v per channel , set max current through a resistor and can adjust "brightness" through a pin.
 
Here's loads of others with 8, 16 or 24 channels .. most of them can be chained together, or in the case of i2c drivers you can give each a unique i2c address : link to digikey led drivers[u/url]

Now you need a voltage regulator that would boost the 5v to 11v (for 3 leds per channel) or 14v for (4 leds per channel)
For example, here's a there are step-up (boost) led drivers, which you can power from 5v and can produce up to 12-16v

MIC2295 : [url=https://www.digikey.com/product-detail/en/microchip-technology/MIC2295YD5-TR/576-1080-6-ND/1858303]https://www.digikey.com/product-detail/en/microchip-technology/MIC2295YD5-TR/576-1080-6-ND/1858303

(datasheet)

MP1541 : https://www.digikey.com/product-detail/en/monolithic-power-systems-inc/MP1541DJ-LF-Z/1589-1858-6-ND/9555235
(datasheet)

MP1542 : https://www.digikey.com/product-detail/en/monolithic-power-systems-inc/MP1542DK-LF-P/1589-1043-1-ND/5298130
(datasheet)

MP3209 : https://www.digikey.com/product-detail/en/monolithic-power-systems-inc/MP3209DJ-LF-Z/1589-1906-1-ND/5292266 (datasheet)

LMR62014 :  https://www.digikey.com/product-detail/en/texas-instruments/LMR62014XMF-NOPB/LMR62014XMF-NOPBDKR-ND/3528062 (datasheet)

LM2731 (X or Y version) : https://www.digikey.com/products/en/integrated-circuits-ics/pmic-voltage-regulators-dc-dc-switching-regulators/739?k=lm2731 (datasheet)
x version is 1.6 mhz, y version is 600 kHz ... lower frequency is more efficient.

 

Offline rdl

  • Super Contributor
  • ***
  • Posts: 3667
  • Country: us
There are indicator LEDs available that need only a few mA to work. Some are plenty bright even at less than a mA.
 

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Thank you, guys, so much for the help! So, I finally had time to dive into all the Datasheets and I will go with the IS31FL3731. There are even commands for this IC in the QMK firmware that I’m going to use. 
http://www.issi.com/WW/pdf/31FL3731.pdf

I don’t need the microphone or hardware shutdown, so would this setup work fine?



I am not getting completely wise from the documentation how the current limiting works. Does the chip run the LEDs at the input voltage (5v) and only limits the current?
The documentation also says not to go lower than 18k ohms for the current limiting resistor. But I only need half the possible LEDs on one side’s matrix and 2/3rds on the other side. Can I then use an even lower resistor accordingly? Meaning lower resistor more forward current brighter LEDs?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
I am not getting completely wise from the documentation how the current limiting works. Does the chip run the LEDs at the input voltage (5v) and only limits the current?
The documentation also says not to go lower than 18k ohms for the current limiting resistor. But I only need half the possible LEDs on one side’s matrix and 2/3rds on the other side. Can I then use an even lower resistor accordingly? Meaning lower resistor more forward current brighter LEDs?

The chip will deliver current based on the resistor.  It is not delivering 'voltage' per se, it is measuring LED current and the voltage required to create that current is whatever it is.

So, when the folks who write datasheets tell you to not go lower than 18k Ohms, there is probably a reason.  Excessive output current for example.  Chips have at least two current limits:  One for each pin individually and one for the package as a whole.  The 18k is probably protecting the pin current because the designers have no idea how many output pins will be in use.  The value will also be safe for the entire package.

OR, try it and see.
 

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
So, when the folks who write datasheets tell you to not go lower than 18k Ohms, there is probably a reason. [...]
Ok, I'll leave it as recommended then. ;D

Does the setup above look OK? SDB needs to be pulled high so it won’t go into shutdown. But I don’t really need the resistor there, right? If it runs on 5v can it handle it on the SDB pin?
For C_FILT it says "Capacitor used for audio". Since I am not connecting a microphone, I can also ditch that, right?
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3283
  • Country: us
For C_FILT it says "Capacitor used for audio". Since I am not connecting a microphone, I can also ditch that, right?

If you're making a PCB I would still add a footprint for it as well as the decoupling cap for the audio input pin even if you don't populate those components.

I'd also make the AD pin jumperable to either GND,  Vcc, SCL or SDA - either via a solder bridge or through-hole jumper wire. Again - to make the board more versatile.
 

Offline BlitzschnitzelTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Yes, that is good advice. I'll setup to board to leave all options open.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf