LED weak on second shift register

I’ve built a setup with 2 shift registers just like here: http://www.arduino.cc/en/Tutorial/ShiftOut

However I don’t have enough room / resistors to add 8 more leds so I’ve settled with one for the second register (hooked to o0 of the second shift register).

The problem is that this led from the second register seems to go weak and wavers depending on how many leds of the first register are turned on. At first it works and then goes weak and kind of blinks lightly like it doesn’t get enough power and can’t catch up to the other leds who are lighting op strongly.

The problem shows up using the following code (turns all the leds on and off):

//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;

unsigned short b = 0x3;

#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);

void loop() {
  // count from 0 to 255 and display the number 
  // on the LEDs
    // shift out the bits:
	int carry = 0;
	if(CHECK_BIT(b, 15)){
		carry = 1;
	b = b << 1;
		b = b | 0x1;
	digitalWrite(latchPin, LOW);
	digitalWrite(latchPin, HIGH);
	digitalWrite(latchPin, LOW);
	digitalWrite(latchPin, HIGH);

void doubleShiftOut(unsigned short b){
	unsigned char b1 = (b & 0xff00) >> 8;
	unsigned char b2 = b & 0xff;
	shiftOut(dataPin, clockPin, MSBFIRST, b1);
	shiftOut(dataPin, clockPin, MSBFIRST, b2);

Your problem is in the hardware rather than the software. So you need to post the schematic of what you have. Also the power supply needs looking at to see if it has enough power. Finally you should add some decoupling capacitors across the supply pins of both shift registers. http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Adding a second 0.1uf capacitor to the ground of the second shift register worked. Thanks Mike!