My name is Mike and I'am currently living in the Netherlands. This year I started my first study: electrical engineering .So I went through some things what I could do to help me with my study and came out by the 3x3x3 LED cube.

Now I do understand almost everything and I should order my parts soon. This is my parts list:-3 2N3904 NPN to use as ground switch (40V/200mA)-3 22kOhms resistor for the NPN transistors.-27 green LED's (2.2V/20mA)-I calculated with this program: http://led.linear1.org/1led.wiz , that I needed 9*150ohms resistors. Though on the internet I found that most people uses ~220Ohms resistors. I'm not sure why they do that, so if anyone can tell me I would be thankful !-Perfboard, wires, etc-Arduino Uno rev1.

Each transistor is connected to 1 of the 3 cathode levels. Then all the 3 transistors are soldered to 1 gnd wire (which then need to plugged in, into a GND port from the arduino).Each transistor's base is connected to a digital pin from the arduino. When the cube is complete, it does look something like this: http://www.instructables.com/id/LED-Cube-and-Arduino-Lib/step3/Build-the-Circuit/

But I got a couple questions about what I can lit and what I can't:-How many LED's can I lit up at the same time?-Is it possible to lit LEDs on two different levels by grounding 2 or 3 levels at the same time and then let a current flow through a column? (So you can get a corner of 3 LEDs lit up the same time, without switching on high frequencies)-Is it possible to turn on all 9 LEDS at the same time on 1 level?

Technically, you could light up all the LEDs at one time, but that isnt how the software usually works. Usually you light up one led, or you light up the leds on a plane at one time, but that isnt true of all cubes. For your 3x3x3 cube, you will likely light up between 0 and 9 LEDs at a time. using up to 180mA at a time. each LED has a 33% duty cycle.

You probably want the 150 ohm resistors, but the only problem with using 220 ohm resistors is that they wont be as bright, so it will still work, and the LEDs will last longer at 220 ohms, but it may be insignificant. People using 220 ohm resistors maybe using LEDs with lower forward voltages, red are usually very low.

I think Its possible to do all the other things you list, but you probably wont want to do them.

Ok then I will lower the value from the resistor to around 180 ohm (to be in the middle of safe and bright ). So you are saying I can switch on all the grounds from each level (3 grounds in total) and then turn on 1 column so I get a vertical line that is lit. So I also can make a wall of LEDs just by turning on all the grounds and turning on 3 columns?

And I don't get your last sentence "I think Its possible to do all the other things you list, but you probably wont want to do them." Are you reffering to an easier way to make a 3x3x3 LED?

You could turn all 3 planes low, and turn one column high, lighting up all 3 LEDs, however, if you are resistored to drive your LEDs at 20mA, and you run 3 LEDs off one controller pin, you will be running 60mA on a device rated for 40, and will likely do damage to the microcontroller (if you run the leds at 10mA, you would be within spec.

You dont need to run the cube that way, the way you normally run a cube is by cycling through each layer, and lighting up just the LEDs in that layer that you want lit, then moving to the next layer. The LEDs appear to all be lit at the same time because of persistence of vision, but they are actually flashing on and off very quickly.

What i was referring to was the way you control the LEDs, there are many ways to do it, but will probably want to run things in loops things in sequence, but technically you dont have to do it that way.

-I calculated with this program: http://led.linear1.org/1led.wiz , that I needed 9*150ohms resistors. Though on the internet I found that most people uses ~220Ohms resistors. I'm not sure why they do that, so if anyone can tell me I would be thankful smiley!

Because trying to run LEDs at exactly 20mA with resistors is a BAD IDEA.

There's about a million threads on the subject in these forums but here's the short version:a) LED resistance isn't constant, it varies with voltage.b) At the "20mA" point, the change in resistance is exponential, ie. a tiny error in voltage can produce a massive error in current.c) Individual LEDs can easily vary by 10% so the error in (b) will happen, damaging the LED.

Solution, either:i) Aim for 15mA (which won't be much dimmer), orii) Use a constant-current circuit (eg. LED driver chip)

The people who choose 220 Ohm resistors are going for the option (i), ie. run at 15mA.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Thanks to you all! Then I will get resistor aimed @15mA. As well with the programming I will only lit up 1 layer at the time !

Control question:If I want to lit up the whole cube, I need to do the following:-Select layer 1 (turn off layer 2/3)-Turn on all LED columns-Turn off all LED columns-Select layer 2 (turn off layer 1/3)-Turn on all LED columns-Turn off all LED columns-Select layer 3 (turn off layer 1/2)-Turn on all LED columns-Turn off all LED columns

Or is this possible as well? (I'm newbie in programming as well ):-Select layer 1 (turn off layer 2/3)-Turn on all LED-Turn off layer 1-Select layer 2-Turn off layer 2-Select layer 3-Turn off layer 3

Control question:If I want to lit up the whole cube, I need to do the following:...Or is this possible as well? (I'm newbie in programming as well ):-Select layer 1 (turn off layer 2/3)-Turn on all LED-Turn off layer 1-Select layer 2-Turn off layer 2-Select layer 3-Turn off layer 3

That will work, yes... (for any pattern which is the same in all three layers)

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Ok thanks! Then If you can confirm the 22kOhm will be sufficient for the 2N3904 transistor: http://www.produktinfo.conrad.com/datenblaetter/150000-174999/163350-da-01-en-Transistor_2N3904.pdf. Then I will be ready to place my order .

Im probably not the best person to ask about what transistor to use. Im actually considering using tiny logic level mosfets instead of BJT type transistors for something that only needs a quarter amp. One of the features of using an n channel mosfet is no resistor required.

Is it possible for somebody to explain me why I need to use a resistor on the base from the transistor? I did alot of reading about why a resistor is needed on the base from the transistor (as NPN switch), but I keep seeing different answer on different forums this makes me understand it less and less. So if someone briefly can explain why a resistor is needed on the base (and how you calculate it) I would be very happy with it !