Electronics

IC Shift Register 8-Bit DIP 74HC595N

AED 6.30

1

Description

The IC Shift Register 8-Bit DIP 74HC595N is a type of integrated circuit that can store and output digital information in the form of binary code. It has a capacity of 8 bits and is commonly used for expanding the number of outputs on microcontrollers or other digital circuits. The 74HC595N uses serial communication to load data into its internal registers and can then output the data in parallel to control external devices such as LEDs, motors, and relays. easy integration with breadboards and other prototyping platforms.

Package Includes:

  • 1 x Shift Register 8-Bit DIP 74HC595N

 

Features:

  • High-speed operation: it can operate at clock speeds up to 100MHz.
  • Low power consumption: it can operate at low voltages and has low power dissipation.
  • 8-bit serial input and parallel output: it can store and shift out 8 bits of data.
  • Cascadeable: multiple ICs can be connected together to create larger shift registers.
  • CMOS technology: it is constructed using CMOS technology, which allows for high noise immunity and low power consumption.
  • Wide operating temperature range: it can operate over a temperature range of -40°C to 125°C, making it suitable for a wide range of applications.

 

Description:

 

The 74HC595N is an 8-bit shift register IC with a storage register and 3-state outputs. It is designed to work with digital circuits and can be used for serial-to-parallel or parallel-to-serial data conversion. It has a wide operating voltage range from 2V to 6V, making it compatible with many microcontrollers and logic families. The IC has an output enable input and serial data input, which makes it easy to daisy chain multiple ICs together. Additionally, the 74HC595N has a latch enable input that allows the storage register to be loaded with data from the shift register. It is available in a DIP package, making it easy to use on breadboards or PCBs. Overall, the 74HC595N is a versatile and commonly used IC for controlling multiple LEDs, driving displays, and various other applications in digital electronics.

 

Principle of Work:

The 74HC595N is an 8-bit serial-in, parallel-out shift register IC that works by shifting in data serially (one bit at a time) through its data input pin (DS), while the clock signal (CP) controls the shift register's internal clock, allowing the input data to be latched into the shift register on each rising edge of the clock pulse. Once all 8 bits of data have been shifted in, a high pulse on the latch enables (ST_CP) pin to be used to transfer the 8 bits of data from the shift register's internal storage registers to the output pins (Q0-Q7) in parallel, allowing all 8 bits to be accessed simultaneously. This allows the 74HC595N to be used as a simple method of expanding the number of output pins of a microcontroller or other digital device since multiple shift registers can be daisy-chained together to provide even more output pins. The 74HC595N can also be used to drive a wide range of digital devices such as LEDs, relays, and motors, by providing the necessary control signals for these devices through its output pins.

 

Pinout of the Module:

 

  • GND: should be connected to the ground of Arduino.
  • VCC: the power supply for the 74HC595 shift register which we connect the 5V pin on the Arduino.
  • SER (Serial Input) pin: used to feed data into the shift register a bit at a time.
  • SRCLK (Shift Register Clock): the clock for the shift register. The 595 is clock-driven on the rising edge. This means that in order to shift bits into the shift register, the clock must be HIGH. And bits are transferred in on the rising edge of the clock.
  • RCLK (Register Clock / Latch): very important pin. When driven HIGH, the contents of the Shift Register are copied into the Storage/Latch Register; which ultimately shows up at the output. So the latch pin can be seen as the final step in the process of seeing our results at the output, which in this case are LEDs.
  • SRCLR (Shift Register Clear): allows us to reset the entire Shift Register, making all its bits 0, at once. This is a negative logic pin, so to perform this reset; we need to set the SRCLR pin LOW. When no reset is required, this pin should be HIGH.
  • OE (Output Enable): negative logic too: When the voltage on it is HIGH, the output pins are disabled/set to a high impedance state and don’t allow current to flow. When OE gets low voltage, the output pins work normally.
  • QA–QH (Output Enable): the output pins should be connected to some type of output like LEDs, 7 Segments, etc.
  • QH’: outputs bit 7 of the shift register. It is there so that we may daisy-chain 595s: if you connect this QH’ to the SER pin of another 595, and give both ICs the same clock signal, they will behave like a single IC with 16 outputs. Of course, this technique is not limited to two ICs – you can daisy-chain as many as you like if you have enough power for all of them.

 

 

Applications:

  1. LED Display Control: The 74HC595N can be used to drive LED displays by providing the necessary current to each LED. By shifting in data to the shift register, you can control the state of each LED in the display.
  2. Multiplexing: The 74HC595N can be used to multiplex a large number of inputs or outputs. By connecting multiple 74HC595N chips together, you can control a large number of inputs or outputs with a small number of microcontroller pins.
  3. Data Storage: The 74HC595N can be used to store data for a short period of time. By latching the output data, you can hold the data until it is needed.
  4. Motor Control: The 74HC595N can be used to control the direction and speed of motors. By using the shift register to output the necessary control signals, you can control the motor.
  5. Digital to Analog Conversion: The 74HC595N can be used to convert digital signals to analog signals. By using the shift register to output the digital signal, you can generate a pulse-width modulated (PWM) signal that can be used to control analog devices.
  6. Serial Communication: The 74HC595N can be used to convert serial data to parallel data. By using the shift register to receive the serial data, you can convert it to parallel data for further processing.
  7. Control Signals: The 74HC595N can be used to generate control signals for other devices. By using the shift register to output the necessary control signals, you can control other devices such as relays, switches, and solenoids.

 

 

Circuit

To build the LED chaser, follow these steps:

 

 

  1. Connect both sides of the breadboard with a jumper wire to power the shift register.
  2. Attach the LEDs one by one, ensuring that the LED's GND pin is connected to the ground side of the breadboard. Also, add a 220-ohm  resistor to protect the LED from high currents.
  3. Connect the shift register to the breadboard.
  4. Connect shift register pin 16 to 5V.
  5. Connect shift register pin 8 to GND.
  6. Connect shift register pin 10 to 5V.
  7. Connect shift register pin 13 to GND.
  8. Connect the shift register to the Arduino by connecting shift register pin 11 to Arduino digital pin 2, shift register pin 12 to Arduino digital pin 3, and shift register pin 14 to Arduino digital pin 4.
  9. Connect the output pin of the shift register to the LEDs.
  10. Connect ShiftRegister pin 15 to LED 1 and ShiftRegister pin 1 to LED 2. Connect all the other LEDs one by one up to ShiftRegister pin 7.
  11. Connect the positive side of the breadboard to the Arduino 5V pin.
  12. Connect the negative side of the breadboard to the Arduino GND pin.

 

Library: 

No Library was used.

 

Code:

 

// Define the pins used to control the shift register
int clockPin = 2;
int latchPin = 3;
int dataPin = 4;

// Define a variable to store the state of the LEDs
byte leds = 0;

void setup() {
  // Set the pins used to control the shift register as outputs
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
}

void loop() {
  // Turn off all the LEDs
  leds = 0;
  updateShiftRegisterR();  // Update the shift register with the new LED state
  delay(100);

  // Turn on each LED in sequence from right to left
  for (int i = 0; i < 8; i++){
    bitSet(leds, i);  // Set the i-th bit in the LED state variable to turn on the i-th LED
    updateShiftRegisterR();  // Update the shift register with the new LED state
    delay(100);
  }

  // Turn off all the LEDs
  leds = 0;
  updateShiftRegisterL();  // Update the shift register with the new LED state
  delay(100);
}

// Function to update the shift register with the current LED state
void updateShiftRegisterR() {
  digitalWrite(latchPin, LOW);  // Set the latch pin low to start sending data to the shift register
  shiftOut(dataPin, clockPin, MSBFIRST, leds);  // Send the LED state to the shift register, starting from the rightmost LED
  digitalWrite(latchPin, HIGH);  // Set the latch pin high to update the shift register with the new LED state
}

// Function to update the shift register with the current LED state in reverse order
void updateShiftRegisterL() {
  digitalWrite(latchPin, LOW);  // Set the latch pin low to start sending data to the shift register
  shiftOut(dataPin, clockPin, LSBFIRST, leds);  // Send the LED state to the shift register, starting from the leftmost LED
  digitalWrite(latchPin, HIGH);  // Set the latch pin high to update the shift register with the new LED state
}




This code implements a simple LED chaser that turns on each LED in sequence from right to left, then from left to right. The updateShiftRegisterR() and updateShiftRegisterL() functions update the shift register with the current LED state, either starting from the rightmost LED or the leftmost LED, respectively. The leds variable stores the current LED state as a byte, where each bit represents the state of one LED. The bitSet() function is used to turn on a specific LED by setting its corresponding bit to 1. The delay() function is used to control the speed of the LED animation.

 

Technical Details: 

  • Supply voltage: 2V to 6V DC
  • Maximum output current: 35mA per output
  • Maximum clock frequency: 25 MHz
  • Number of input bits: 8
  • Number of output bits: 8
  • Output type: 3-state
  • Output voltage level: TTL compatible
  • Package type: 16-pin DIP (Dual In-line Package)
  • Operating temperature range: -40°C to +125°C 

 

Resources:

 

Comparisons:

The 74HC165 and 74HC595N are both shift registers, but they have some differences. Here's a comparison between the two:

  1. Number of Bits: The 74HC165 is an 8-bit parallel-in, serial-out shift register, whereas the 74HC595N is an 8-bit serial-in, parallel-out shift register with a storage register.
  2. Input/Output Type: The 74HC165 has 8 parallel inputs and a single serial output, while the 74HC595N has a single serial input and 8 parallel outputs with 3-state capability.
  3. Package Type: The 74HC165 is available in a 16-pin DIP (Dual In-line Package), while the 74HC595N is available in a 16-pin DIP.
  4. Applications: The 74HC165 is commonly used for parallel-to-serial conversion, input expansion, and other applications that require multiple inputs to be read with a single pin. The 74HC595N is commonly used in LED matrix displays, multiplexing of signals, and other applications where multiple outputs are needed.
  5. Power Consumption: The 74HC595N has a slightly higher power consumption compared to the 74HC165, due to its storage register and 3-state outputs.

The choice between the two depends on the specific application requirements. The 74HC165 may be preferred for input expansion or parallel-to-serial conversion, while the 74HC595N may be preferred for applications that require more outputs or more complex functionality.