Step 2Basic wiring and operation
The 74HC164 is a 14 pin chip, it has 4 input pins, 8 output pins, power and ground, so lets start from the top.
Pins 1 and 2 are both serial inputs, they are setup as a logical AND gate, meaning that they both have to be logic high (ie 5 volts) in order for the bit to be seen as a 1, a low state (0 volts) on either will read as a zero. We dont really need this and its easier to deal with in software, so choose one and tie it to V+ so it always reads high. I choose to use a jumper from pin 1 to pin 14 (V+) since you can just pop a breadboard jumper over the chip. The one remaining serial input (pin 2 in my schematics) will goto digital pin 2 of the arduino.
Pins 3,4,5,and 6 of the 74HC164 are the first 4 bytes of output
Pin 7 connects to ground
Jumping to the right, pin 8 is the clock pin, this is how the shift register knows the next serial bit is ready for it to read, this should be connected to digital pin 3 on the arduino.
Pin 9 is to clear the entire register at once, if it goes low, you have the option to use it, but nothing in this inscrutable does, so tie it to V+
pins 10, 11 12 and 13 are the last 4 bytes of output
pin 14 is the chips power
Operation
First you need to set the serial input of the register (digital pin 2 on the arduino) high or low, next you need to flip the clock pin (digital pin 3) from low to high, the shift register will read the data on the serial input and shift the output pins by 1, repeat 8 times and you have set all 8 outputs.
This can be done by hand with for loops and digital writes in the arduino IDE, but since this is a very common hardware level communications (SPI) they have a single function that does it for you.
shiftOut(dataPin, clockPin, bitOrder, value)
Just tell it where the data and clock pins are connected to the arduino, which way to send the data and what to send, and its taken care of for you (handy)
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|
















































