The 74HC595 is an 8-bit serial-in, parallel-out shift register with an output latch, manufactured by Arduino under the part ID "UNO". This component is widely used for serial-to-parallel data conversion, allowing users to control multiple output pins using only a few input pins. It is particularly useful in applications where microcontroller I/O pins are limited, such as LED matrix displays, seven-segment displays, and data storage systems.
By cascading multiple 74HC595 chips, users can expand the number of output pins even further, making it a versatile solution for projects requiring a large number of outputs.
The following table outlines the key technical details of the 74HC595:
Parameter | Value |
---|---|
Supply Voltage (Vcc) | 2V to 6V |
Input Voltage (VI) | 0V to Vcc |
Output Current (IO) | ±35 mA (per pin) |
Maximum Clock Frequency | 25 MHz (at 4.5V to 5.5V Vcc) |
Operating Temperature | -40°C to +125°C |
Package Type | DIP-16, SOIC-16 |
The 74HC595 has 16 pins, as described in the table below:
Pin Number | Name | Description |
---|---|---|
1 | Q1 | Parallel output pin 1 |
2 | Q2 | Parallel output pin 2 |
3 | Q3 | Parallel output pin 3 |
4 | Q4 | Parallel output pin 4 |
5 | Q5 | Parallel output pin 5 |
6 | Q6 | Parallel output pin 6 |
7 | Q7 | Parallel output pin 7 |
8 | GND | Ground (0V) |
9 | Q7' | Serial data output for cascading additional 74HC595 chips |
10 | MR | Master reset (active low) |
11 | SH_CP | Shift register clock input |
12 | ST_CP | Storage register clock input (latch pin) |
13 | OE | Output enable (active low) |
14 | DS | Serial data input |
15 | Q0 | Parallel output pin 0 |
16 | Vcc | Supply voltage |
DS
pin (14) to the microcontroller's data output pin.SH_CP
pin (11) to the microcontroller's clock pin.ST_CP
pin (12) to the microcontroller's latch pin.DS
pin while pulsing the SH_CP
pin to shift the data into the register.ST_CP
pin to latch the data into the output register.OE
pin (13) is connected to ground to enable the outputs.Q7'
pin (9) of the first chip to the DS
pin (14) of the next chip.Below is an example of how to use the 74HC595 with an Arduino UNO to control 8 LEDs:
// Define the 74HC595 control pins
const int dataPin = 2; // DS pin (14) connected to Arduino pin 2
const int clockPin = 3; // SH_CP pin (11) connected to Arduino pin 3
const int latchPin = 4; // ST_CP pin (12) connected to Arduino pin 4
void setup() {
// Set control pins as outputs
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(latchPin, OUTPUT);
}
void loop() {
// Example pattern to display on LEDs
byte ledPattern = 0b10101010; // Alternating LEDs on/off
// Send the pattern to the 74HC595
digitalWrite(latchPin, LOW); // Disable latch
shiftOut(dataPin, clockPin, MSBFIRST, ledPattern); // Send data
digitalWrite(latchPin, HIGH); // Enable latch
delay(500); // Wait for 500ms
}
shiftOut
function sends 8 bits of data to the 74HC595, starting with the most significant bit (MSBFIRST).latchPin
is toggled to transfer the shifted data to the output pins.ledPattern
variable defines which LEDs are turned on or off.Outputs Not Responding:
OE
pin (13) is connected to ground.ST_CP
pin (12) is being pulsed after shifting data.Incorrect Output Pattern:
Chip Overheating:
Q: Can I cascade multiple 74HC595 chips?
A: Yes, connect the Q7'
pin (9) of the first chip to the DS
pin (14) of the next chip. Repeat for additional chips.
Q: What is the purpose of the OE
pin?
A: The OE
pin enables or disables all outputs. When high, all outputs are in a high-impedance state.
Q: Can the 74HC595 drive motors directly?
A: No, the 74HC595 cannot handle the high current required by motors. Use a motor driver circuit instead.