I'm trying to build a 8x32 LED matrix the rows are controlled by a 74hc595 shift register connected to the base of 8 BC547B transistors. The output current of the shift register is regulated by 560 ohm on each output pin. The BC547Bs connect the cathode of the LEDs to ground if the corresponding output of the shiftregister is high. The anode of the LEDs is connected to the outputs of 2 4/16-demultiplexers which supply one column at a time with VCC (5V). The current through the LEDs is regulated with 470 ohm resistors.
All parts are supplied with power by a mini-usb with 5V/2.1A
This is the part of the circuit diagram with the 74hc595 and the BJTs:
Now. This is the problem. I control the shift register with my arduino due. The MR pin of 74hc595 is connected to GND and the OE to 5V.
Sometimes when I power the whole thing up it works well and everything does what it's supposed to but in some cases all LEDs in the currently active row shut off and the 74hc595 starts to heat up.
After disconnecting the whole thing I let the IC cool down. And tried to reconnect it but now all 8 outputs are high or in some cases nothing happens.
Can anyone help me to solve this overheating? This destroyed 2 ICs since the first tests.
I will give you more information on request.
Edit: Full circuit
I do not think that the reason is too much current to ground. The current to the LEDs is about 10mA. Output current of the sift register is about 7.7mA if one output is enabled and 71mA when all 8 outputs are on. The ground should be able to handle this current. The problem occured in both cases first all 8 outputs were on and the second time only one output was driven high.
Something about the functionality of the circuit:
The columns are controlled by 2 demultiplexers which "scan" through the cloumns applying 5V on one column at a time scanning all 32 columns. So there will never be 2 columns active at the same time. The shift register controls which row is connected to ground. This results in lighting 0-8 LEDs up at the same time. The matrix should be able to display simple characters.

