DrDiettrich:
You nearly understood a multiplexed display
When you only turn on one row at a time, only these (five) LED can draw current at a time. If you prevent all rows from ever being on together, what may happen during a reset or power off of the Arduino, you're fine so far.
Now for the current calculation, assuming that you drive the rows and columns by 5+5 output pins. Then the controller limits the total output current to 200mA (typically, see data sheet), and the individual output pin current to 40mA.
The column outputs drive only a single LED at a time, no problem so far. The row outputs instead drive all LED in a row at the same time, here up to 5*led_current, so that a single LED can be driven at 40mA/5 = 8mA. When a LED is on for 1/5 of time only, this will result in an average (effective) LED current of 8/5 = 1.6mA - not really much
If you need brighter LEDs, you have to add transistors to at least the row outputs, that withstand higher currents.
When a LED is specified at 20mA continuous current, it usually will tolerate the same effective current when pulsed. If so, the pulse current can be increased by the pulse duty cycle (20mA/(1/5)=20mA*5=100mA). When driven from 5V logic outputs the column resistor would be >= (5V-2V)/100mA=30 Ohm.
Since we already know that an output pin supports only 40mA, this would damage our poor Arduino. So let's calculate the resistor for the this limit: 40mA/5colums=8mA, (5V-2V)/8mA=375 Ohm. Now you see that your choice of 220 Ohm is much too low
As a quick solution you can replace the resistors by 2 in series (440 Ohm), or by 390 Ohm if at hand.
DrDiettrich:
You nearly understood a multiplexed display
When you only turn on one row at a time, only these (five) LED can draw current at a time. If you prevent all rows from ever being on together, what may happen during a reset or power off of the Arduino, you're fine so far.
Now for the current calculation, assuming that you drive the rows and columns by 5+5 output pins. Then the controller limits the total output current to 200mA (typically, see data sheet), and the individual output pin current to 40mA.
The column outputs drive only a single LED at a time, no problem so far. The row outputs instead drive all LED in a row at the same time, here up to 5*led_current, so that a single LED can be driven at 40mA/5 = 8mA. When a LED is on for 1/5 of time only, this will result in an average (effective) LED current of 8/5 = 1.6mA - not really much
If you need brighter LEDs, you have to add transistors to at least the row outputs, that withstand higher currents.
When a LED is specified at 20mA continuous current, it usually will tolerate the same effective current when pulsed. If so, the pulse current can be increased by the pulse duty cycle (20mA/(1/5)=20mA*5=100mA). When driven from 5V logic outputs the column resistor would be >= (5V-2V)/100mA=30 Ohm.
Since we already know that an output pin supports only 40mA, this would damage our poor Arduino. So let's calculate the resistor for the this limit: 40mA/5colums=8mA, (5V-2V)/8mA=375 Ohm. Now you see that your choice of 220 Ohm is much too low
As a quick solution you can replace the resistors by 2 in series (440 Ohm), or by 390 Ohm if at hand.
Hi, I changed my question a bit because it seemed very vague after reading it back. Basically, each column is "pillar" of 5 led's connected by the anodes. Each row is 25 leds connected by their cathodes. So for example, pulling column 1 to high and all the rows to low will result in all the 5 led's of column 1 to light. If only row 1 is low, then only one led of the column will light up.
Some questions I have about your answer:
-
The tl;dr is that 220 Ohm's per column(of 5 leds) is not enough, I need somewhere around 400 Ohms?
-
Will 220 Ohms damage the led's or the arduino(or both?).
-
what do you mean by 5+5 output pins?
-
What do you exactly mean with on for 1/5 of the time? Lighting up the leds in sequence, so if one column is lit up for 50 second then each single led is lit up for 10 seconds?
-
When a LED is specified at 20mA continuous current.... You lost me after this
-- What is the difference between continuous current and effective current?
-- What is is pulse current?
-- 30 Ohm is the resistance of all the leds on a column without adding any resistors?
When using transistors, the output pins of the arduino activate the flow of current through the transistor. This way, higher current fllow can be used. But what would be the ground for the transistors in this case? Back to the power source I guess? But how can I pull an Arduino pin high if it's not connected to the ground of the arduino?
Ow and the led cube is running for an hour now without any trace of damage :P. Honestly I would rather have the arduino brake than the led's because soldering the led's is a big pain.