40ma limit ?

Hey Folks, again thanks for any help

Just wondering if some can someone confirm my understanding.
hope the image displays below.

LED specs here :http://oomlout.com/products/DATASHEETS/LED-05RGB-A.pdf

The above diagram works in reality, and I can control the LED's and there indivdual "diodes\cathodes"?

  1. I couldn't understand the diagram with them, so I winged it.... these are wired in parallel?
  2. The Specs days that require 20ma per unit?,
  3. is that 20ma in total when all 3 "Diodes" in side one RGB LED is Lit?
  4. is "3" is correct wouldn't the total current of all 3 lit LED's draw 60ma?
  5. if "5" is correct why do they still all light, when the max output of the Arduino pins(in this case the the Regulated 5v pin) is only 40ma?

Thanks a lot.

EFD

forgot to say :- wired to an Uno Rev:3

  1. I couldn't understand the diagram with them, so I winged it.... these are wired in parallel?
  2. The Specs days that require 20ma per unit?,
  3. is that 20ma in total when all 3 "Diodes" in side one RGB LED is Lit?
  4. is "3" is correct wouldn't the total current of all 3 lit LED's draw 60ma?
  5. if "5" is correct why do they still all light, when the max output of the Arduino pins(in this case the the Regulated 5v pin) is only 40ma?
  1. Yes. Parrallel.
  2. Yes, 20ma per diode (ie 20ma for red, 20ma for green, 20ma for blue)
  3. See #2.
  4. If you are running all colors simultaneously at max continous current, then yes, 60ma total is flowing through the LED.
  5. The 40ma limit is for each pin controlled by the Arduino. In this case each pin is only controlling 11ma or 7ma (based on 270 ohm resistors), depending on which color your are using.

The 5V pin is not controlled by the Arduino. It is limited by the Voltage regulator or your USB port.

thanks for that so in theory, all diodes in all led's on at the same time would be drawing, 180ma , is it drawing it from the 5v pin, or each individual pin (12,11,10,9,8,7,6,5) but I thought these would be sinking the current , not providing the current?

Thanks again.

40 mA is the limit for sourcing or sinking. As you have drawn it they will be sinking.

However with a 270R series resistor you are not going to pull 20mA down them, it will be less. Each colour will have a different forward voltage and so if the resistors are all the same the currents will not be.

Thanks Mike :slight_smile:

So the resistor is limiting what the led's are pulling less then 20ma , does mean that they are not at there optium current for optium brightness?

That's right. To calculate the voltage use:-
(5V - LED forward voltage drop) / Current required = resistance

For example if your blue LED has a drop of 3.2V then for 20mA use
5-3.2 = 1.8V
with 20mA through a resistor with 1.8V across it the resistor has to be 1.8 / 0.02 = 90 ohms

that make sense ..I think , they provided larger resistors then nessecary to prevent breaching the 40ma pin limit when all 3 diode(1 led) are on at the same time.?

Cheers for you time today mike most appreaciated.

I will need to get my DMM out and practive a bit more with v=ir in a pratical environment to get to grips with it all.

electrofunkdaddy:
Thanks Mike :slight_smile:

So the resistor is limiting what the led's are pulling less then 20ma , does mean that they are not at there optium current for optium brightness?

With 270 ohm resistors? Yes.

Trying to run LEDs at "optimimum brightness" using resistors is usually futile. You have to control the current going through the LEDs, not the voltage. Resistors will get you close ... but if the LEDs have to be matched for brightness it won't work.

The easiest way to control the current is with an LED driver chip. Something like the TLC5940 is commonly used for setups like this.

but if the LEDs have to be matched for brightness it won't work.

No so.
There will be very little difference in brightness with the same LED running at 20mA controlled by a resistor from 5V. Lower than a JND (just noticeable difference).
Any brightness variation will come from the LEDs themselves not the variation in current. As such constant current control will not help.

Thanks folks, not really wanting to run them at there optium brightness, just trying to understand the theory.

my understanding now is, Just 1 RGB Led (3 Diodes), can require 60ma in total (20ma each diode) when all are lit.

with the following resistors (2/3/3)v

Red : 5v-2v / 0.02a = 150 ohms
Green : 5v-3v / 0.02a = 100 ohms
Blue : 5v-3v / 0.02a = 100 ohms

but you cannot use the above resistors, before this would overload the arduino since it can only supply 40ma from a pin at a time and since the they are using common anode on the 5v pin.

The circuit I have is

with the following resistors (2/3/3)v

Red : 5v-2v / 270 ohms = 11ma
Green : 5v-3v / 270 ohms = 7.4ma
Blue : 5v-3v / 270 ohms = 7.4ma

Total 25.8 ma well within 40ma pin limit.

Last question....honest, I thought LED's had a limit that they only activated(switched on) at, is that a Volt Level or Amp level?, just original confused as I thought you need 20ma minimum to get then to light up, I didn't know you could run then at lower current levels.

Thanks for all your patience. own you guys.

Grumpy_Mike:

but if the LEDs have to be matched for brightness it won't work.

No so.
There will be very little difference in brightness with the same LED running at 20mA controlled by a resistor from 5V. Lower than a JND (just noticeable difference).
Any brightness variation will come from the LEDs themselves not the variation in current. As such constant current control will not help.

Indeed.

The eye can't detect small variations in brightness very well (10% for instance would be hard to notice) - it can cover a range of brightnesses of more than a million though - eye's response is close to logarithmic. The variation in LED die efficiency, lens position and so forth mean that getting accurately matched brightness cannot be done solely electronically anyway - and the efficiency degrades over time too!

The main advantage of constant current drive is when you don't have much spare voltage with which to program a current-limiting resistor (LED forward voltage depends on current and temperature and individual device variation, voltage across the current-limiting resistor is the difference between supply and forward voltage).

Also chips that do constant current mean you need fewer components (no resistors needed), freeing up space on the PCB - lowers the cost of mass-produced electronics.

Some chips combine constant current drive and boost or buck regulators - these provide the best efficiency for driving LEDs when the supply voltage and LED voltage aren't matched - but extra components are needed for the switching regulator.

but you cannot use the above resistors, before this would overload the arduino since it can only supply 40ma from a pin at a time and since the they are using common anode on the 5v pin.

No the 5V pin on an arduino is not a processor pin, it is connected to the power supply and is good for at least 300mA, it is only the processor's output pins that are limited to 40mA.

I thought LED's had a limit that they only activated(switched on) at, is that a Volt Level or Amp level?

Yes it is the voltage has to be at least the forward voltage of the LED.

I didn't know you could run then at lower current levels.

You can run them at what ever current level you like below the maximum, it is just that the LED gets dimmer. My last project had a blue LED in it in direct view, a current of 3mA was more than enough in that application.

Thanks Mike, Totally got a grip on it now :slight_smile: Thanks mucho mucho mucho appreciated. yer a star :slight_smile:

You're using an Uno? Keep in mind the total IO limit per port and across the device in total also. From Section 29 of the data sheet:

  1. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:
    ATmega48A/PA/88A/PA/168A/PA/328/P:
    1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
    2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
    If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
    greater than the listed test condition.
  2. Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:
    ATmega48A/PA/88A/PA/168A/PA/328/P:
    1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100 mA.
    2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100 mA.
    3] The sum of all IOL, for ports D0 - D4, RESET should not exceed 100 mA.
    If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
    than the listed test condition.

electrofunkdaddy:
Thanks Mike, Totally got a grip on it now :slight_smile: Thanks mucho mucho mucho appreciated. yer a star :slight_smile:

ah that give a bit of room :), If I actually draw 300ms I take it I would (not sure what the correct term is away to brush up on it) , split the current across several pins to sink them? with causes damages.

Crossroads, cheers for that will have to brush up on the specs and terminology, I think I get the gist of it :), some abbr start looking like gibberish haha :slight_smile: