I have a fairly good understanding of how LED matrices work, and I've worked with them more than several times. However, one thing still puzzles me. According to standard calculation of current draw for a LED hooked to 5V and 220Ohm resistor, it's current it about 20mA. However, hooking the same LED with same resistor in a matrix makes a LED go a bit dimmer. Now I understand that in first case, 20mA is running through LED all the time, and in matrix it's not (for reference, in my setups I usually switch columns in LED matrices after 2mS). So, how much current does actually run through LED in a matrix? I've also read somewhere that when dealing with LED matrices, current limiting resistor can be of lower value, since in matrix only some kind of "peak" current runs through LED.
Hi,
The actual instantaneous current will be a bit less than 20mA because the transistors or other drivers on the columns and the rows will "drop" some of the 5V, so the voltage accross the LED + resistor could for example be as much as 1.5V less than the full 5V. This is is still true even if the Arduino outputs themselves are driving the matrix directly. Less voltage means less current, of course, but you could adjust the resistors to a lower value to compensate (as long as there is still enough voltage to drive your LEDs: blue and white LEDs can need up to 3.2V to run at all).
However, the main reason why LEDs are dimmer in a matrix is because of the multiplexing. It may appear that all LEDs are on at the same time, but if you had a slow motion video camera, you could see that they actually switch on and off in groups. Usually the groups consist of either all the LEDs in a row or all the LEDs in a column. For example in an 8x8 matrix, only 8 LEDs might be on at any instant. If they receive 20mA when they are on, they are receiving 20/8 = 2.5mA on average.
This may sound like it makes the display very dim, but there 2 reasons why it might not be. First, the human eye is not "linear" in how it perceives brightness. 20mA will not look twice as bright as 10mA, it will only look a little brighter. Secondly, LEDs can be "over-driven" to compensate for the multiplexing to some degree. If an LED is rated at 20mA maximum continuous current, it may be able to take 80 - 100 mA for short periods. You need to check the data sheet for the LED to find out how much and how long. Usually I have found its OK to use double the max continuous current, if the LEDs will be on for only one eighth of the time.
There is a danger to over-driving LEDs. If the multiplexing relies on your sketch running correctly (rather than using an external chip like max7219 to perform the multiplexing), then if your sketch stops for some reason, the LEDs that were switched on at the time will then receive more than their max current for a long time and could be damaged.
Paul
Many LEDs are spec'ed for higher current, but time limited as PaulRB says, for example:
Peak Forward Current (1/10th duty cycle, 0.1ms pulse width) : 50 mA
Look for those kind of numbers for the LED you are using.
The 1/10 duty cycle, 0.1mS seems pretty common. I've seen up to 100mA.
PaulRB:
Hi,The actual instantaneous current will be a bit less than 20mA because the transistors or other drivers on the columns and the rows will "drop" some of the 5V, so the voltage accross the LED + resistor could for example be as much as 1.5V less than the full 5V. This is is still true even if the Arduino outputs themselves are driving the matrix directly.
That is the case in my current project. 2x5 (rows/columns) LED matrix.
Less voltage means less current, of course, but you could adjust the resistors to a lower value to compensate (as long as there is still enough voltage to drive your LEDs: blue and white LEDs can need up to 3.2V to run at all).
I'm using blue ones.
If an LED is rated at 20mA maximum continuous current, it may be able to take 80 - 100 mA for short periods. You need to check the data sheet for the LED to find out how much and how long. Usually I have found its OK to use double the max continuous current, if the LEDs will be on for only one eighth of the time.
That's the issue when you order bunch of LEDs on eBay. The 5mm blue ones I've got didn't come with that information (short period current).
There is a danger to over-driving LEDs. If the multiplexing relies on your sketch running correctly (rather than using an external chip like max7219 to perform the multiplexing), then if your sketch stops for some reason, the LEDs that were switched on at the time will then receive more than their max current for a long time and could be damaged.
I'm fairly sure that can never happen - I'm testing my code for couple of months already. But, yeah, it relies on sketch running correctly and that is useful information.
So, I shouldn't expect any issues connecting that same 2 row/5 column matrix on Arduino using 100 Ohm resistors for rows?
If they were my LEDs, and they were not expensive, and I had 10 more, I would risk it.
If they are going to blow, it may well not happen straight away, so test them for as long as you can before soldering up the final project.
Yeah I do have lots of them, but considering that I should finish the project within a next few weeks, I'll go with safer route and put 220 Ohm resistors. Arduino shouldn't have trouble with it I suppose (even tho the maximum sink is 40ma).
According to standard calculation of current draw for a LED hooked to 5V and 220Ohm resistor, it's current it about 20mA.
As PaulRB mentions, that depends on the LED, a blue one will drop approx 3.5v , leaving 1v5 across the 2k2, = less than 1 mA through both.
Boffin1:
According to standard calculation of current draw for a LED hooked to 5V and 220Ohm resistor, it's current it about 20mA.
As PaulRB mentions, that depends on the LED, a blue one will drop approx 3.5v , leaving 1v5 across the 2k2, = less than 1 mA through both.
Hi boffin1, I think you must have mis-read! The resistors are 220R, not 2K2, so its 10mA.
kustom:
Yeah I do have lots of them, but considering that I should finish the project within a next few weeks, I'll go with safer route and put 220 Ohm resistors.
In my experience of buying cheap leds from eBay, I would test them for as long as time allows, regardless of the resistor value!
PS. How many Arduino outputs are you using to run the matrix, 7? Did you realise it can be done with 4?
Hi Paul
Yes I misread the 0 and the O in the ohms
So 1v5 across a 220 ohm would give you less than 7 mA
(5V-2.2V (typical Vf for Red))/220ohm = 12.7mA
What is Vf of the LEDs?