Hello,
I'm fairly new (and by that I mean this is my first ever project) in Arduino so I cannot be 100% sure if my problem is an Arduino board error or human error.
I'm building a led cube (3x3x3) and when I test it, all LEDs light up individually but when I try to light the whole row (9 LEDs) the first five light up and the rest 4 are very light dimly. I'm using a brand new Arduino UNO board bought from eBay (I received it yesterday).
I have uploaded a video to demonstrate my problem. I use pins 0 to 8 for the individual columns and pins 9 to 11 for the rows. In this demo I have the top row (pin 11) lit and I rotate between pins 0 to 4, pins 5 to 8 and then all together so you may see what I mean. When all of them are lit, the top 4 leds look like they're just reflecting the other LED's light but they are lit, just very faintly.
For each of the rows I use one 2N2222 transistor which connects to each row through a 1k Ohm Resistor. I get GND from the Arduino GND Output. I used Arduino to test each of the leds individually and they light up just fine.
All I need to know is whether this is somehow my fault (too many variables to go wrong there...) or I use a faulty board.
All I need to know is whether this is somehow my fault (too many variables to go wrong there...) or I use a faulty board.
With really nothing more than a general "I've got a problem" with what you are doing, I say that there is a 99% chance that it is some type of human error.
Billypap:
I use pins 0 to 7 for the individual columns and pins 9 to 11 for the rows.
That's only 8 columns - surely you need 9? Perhaps you are using pin 8 as a column as well?
Billypap:
For each of the rows I use one 2N2222 transistor which connects to each row through a 1k Ohm Resistor.
It sounds to me that you have the resistors in the wrong place. As I understand it, you have just 3 resistors, one for each row. What you need is 1 resistor in series with each column pin (9 in all), and no resistors in the rows. So at any one time, each resistor is only supplying current to at most 1 LED, rather than the current through one resistor being shared between up to 9 LEDs.
dc42:
That's only 8 columns - surely you need 9? Perhaps you are using pin 8 as a column as well?
Yeah, you're right, it's 0-8 for the columns. I'm gonna correct my first post.
dc42:
What you need is 1 resistor in series with each column pin (9 in all), and no resistors in the rows.
Thank you for your reply. It worked! I saw other projects that used resistors on the LED anodes and some on LED cathodes and I went with the least soldering effort one. Silly me, I should have known...