My 3x3x3 and 5x5x5 LED cube

The resistor limits the current which might go in and out of whatever is driving the base of the transistor,
such as an arduino pin.