What is the Shift Register:

The Shift Registers fundamental purpose is to increase the number of Input/Output pins of the Micro-controller. The Shift Register used can either be a 74HC595 which is made for increasing the Output pins, While the 74HC164 is the Shift Register made to increase the Input pins. The most important point to note is that a number of Shift Registers can be cascaded. So that the Micro-controller can control 8 to the power of n Output/Inputs using just 3 pins. This cascading can also be called as daisy chaining of the Shift Registers.

Pins of The Shift Register:

The most important pins of the Shift Register are listed as follows:

Serial In (PIN 14):

The pin which shift the next input for the Shift Register.

RCK (PIN 12):

When this pin is pulled high, it will shift the register.

Serial Clock (PIN11):

Needs to be pulled high to set the output to the new Shift Register values, This must be pulled high directly after SRCLK has gone LOW again.

QH' (PIN 9):

The significance of this pin is that it can be connected to the Serial In (PIN14) of the next Shift Register and the daisy chain can increase.

Working of The Shift Register:

The shift register can be compared to a game of data moving along junctions. They will move to the other junction when the RCK pin of the shift register changes to HIGH and thus the data can be transmitted to any number of Shift Registers using the following principle. The shift register can maintain the values using the Serial Clock (PIN 11). Whenever the serial clock pin goes high then the RCK pin will go low and so on till the required data is transmitted.

I have included a 123D Circuit diagram describing the connections of the Shift Register to the Arduino. As well as the basic connections needed for the shift register to work. The second 123d circuit diagram provided shows the connections for the second Shift Register and so on.

Daisy Chaining Shift Registers:

The Shift Registers can be increased by connecting the QH' pin with the second Shift Registers Serial in (PIN 14). Thus the number of output is limited only to the number of Shift Registers that can be connected. The code which is provided with the option to connect upto 40+ Registers. I have also provided a real time diagram of the module and the connections to the arduino using the modules.