LED CUBE 4x4x4

I build a RGB 4x4x4 LED Cube with shiftregister and the code is inspired from Kevin Darrah.

At the moment the multiplexing do not work and I do not why, it only light up random leds and I do not how to solve that

Always when i start the Cube it shows me Random Colors and no changes are happening (multiplexing)
(see attachment)

Code:
(see attachment)

Schematic:

Layout:

LED_CUBE_4x4x4.ino (48.9 KB)

Some quick remarks: You need to increase your resistor values.

HC595 can at max. source or sink 70mA per Chip.
Any more and you risk damaging it.

Also, your base resistor values on the NPNs seem very low at 34 Ohms. That would amount to almost 150mA base current - which the Arduino pins cannot provide. Again, there is a large risk here that the Arduino might be damaged.
Side question: Does your Arduino happen to get hot quickly when you run your code?

Go for 5mA per LED, that will still be very bright, even with 1:4 multiplexing.
Also, something like 1k for the base resistors should be enough except when your NPNs have a very low hFE. In that case you can use a smaller NPN to drive the larger ones.
However, if you’re going for 5mA per LED as I suggested you would at most have to switch 240mA per Layer - which a simple and cheap BC337 can easily handle. And a BC337, in turn, will be fine with a 1k base resistor.

Shuzz: Also, something like 1k for the base resistors should be enough except when your NPNs have a very low hFE.

hFE is irrelevant!