Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use 74HC165: Examples, Pinouts, and Specs

Image of 74HC165
Cirkit Designer LogoDesign with 74HC165 in Cirkit Designer

74HC165 Shift Register Documentation

1. Introduction

The 74HC165 is an 8-bit parallel-in/serial-out (PISO) shift register designed for high-speed data transfer. Manufactured by Arduino (Part ID: UNO), this component is widely used in digital electronics to convert parallel data into serial data streams. It is particularly useful in applications where microcontrollers or processors have limited input pins but need to read multiple parallel signals.

Common Applications:

  • Expanding input pins for microcontrollers (e.g., Arduino UNO)
  • Reading multiple switches or sensors
  • Data acquisition systems
  • Serial communication systems
  • Digital signal processing

The 74HC165 is a versatile and cost-effective solution for interfacing multiple parallel inputs with a microcontroller.


2. Technical Specifications

The following table outlines the key technical details of the 74HC165:

Parameter Value
Supply Voltage (Vcc) 2V to 6V
Input Voltage (VI) 0V to Vcc
Output Voltage (VO) 0V to Vcc
Maximum Clock Frequency 25 MHz (at 4.5V)
Quiescent Current (Icc) 1 µA (typical)
Operating Temperature -40°C to +125°C
Package Types DIP-16, SOIC-16, TSSOP-16

Pin Configuration and Descriptions

The 74HC165 has 16 pins, as described in the table below:

Pin Number Pin Name Description
1 SH/LD̅ Shift/Load Control (Active Low). Loads parallel data when LOW.
2 CLK INH Clock Inhibit. Disables the clock when HIGH.
3 CLK Clock Input. Shifts data on the rising edge.
4 QH Serial Data Output. Outputs the last bit of the shift register.
5-12 D0-D7 Parallel Data Inputs. Accepts 8-bit parallel data.
13 QH̅ Complementary Serial Data Output (optional, inverted QH).
14 SER Serial Data Input. Used for cascading multiple 74HC165 ICs.
15 Vcc Positive Power Supply.
16 GND Ground.

3. Usage Instructions

Connecting the 74HC165 to an Arduino UNO

The 74HC165 can be easily interfaced with an Arduino UNO to read multiple parallel inputs using only a few pins. Below is a step-by-step guide:

  1. Wiring the Circuit:

    • Connect the Vcc pin (Pin 15) of the 74HC165 to the 5V pin of the Arduino.
    • Connect the GND pin (Pin 16) to the Arduino's GND.
    • Connect the SH/LD̅ pin (Pin 1) to a digital pin on the Arduino (e.g., Pin 8).
    • Connect the CLK pin (Pin 3) to another digital pin on the Arduino (e.g., Pin 9).
    • Connect the CLK INH pin (Pin 2) to GND (or control it via another Arduino pin if needed).
    • Connect the QH pin (Pin 4) to a digital input pin on the Arduino (e.g., Pin 10).
    • Connect the D0-D7 pins to the parallel data source (e.g., switches or sensors).
  2. Arduino Code Example: The following code demonstrates how to read 8 parallel inputs using the 74HC165 and display the results in the Serial Monitor.

    // Pin definitions for the 74HC165
    const int loadPin = 8;  // SH/LD̅ pin (Pin 1)
    const int clockPin = 9; // CLK pin (Pin 3)
    const int dataPin = 10; // QH pin (Pin 4)
    
    void setup() {
      pinMode(loadPin, OUTPUT);  // Set loadPin as output
      pinMode(clockPin, OUTPUT); // Set clockPin as output
      pinMode(dataPin, INPUT);   // Set dataPin as input
      Serial.begin(9600);        // Initialize Serial Monitor
    }
    
    void loop() {
      digitalWrite(loadPin, LOW);  // Load parallel data into the shift register
      delayMicroseconds(5);       // Small delay for stability
      digitalWrite(loadPin, HIGH); // Return to shift mode
    
      byte data = 0; // Variable to store the shifted data
    
      for (int i = 0; i < 8; i++) {
        digitalWrite(clockPin, LOW);  // Generate clock pulse
        delayMicroseconds(5);         // Small delay for stability
        data |= (digitalRead(dataPin) << (7 - i)); // Read bit and shift it
        digitalWrite(clockPin, HIGH); // Complete clock pulse
        delayMicroseconds(5);
      }
    
      Serial.print("Input Data: ");
      Serial.println(data, BIN); // Print the 8-bit data in binary format
      delay(500);                // Wait before the next read
    }
    

Important Considerations:

  • Ensure the SH/LD̅ pin is LOW when loading parallel data and HIGH during shifting.
  • Use pull-up or pull-down resistors on the D0-D7 pins if they are connected to switches.
  • Avoid exceeding the maximum clock frequency (25 MHz at 4.5V).

4. Troubleshooting and FAQs

Common Issues and Solutions:

Issue Possible Cause Solution
No data is being read by the Arduino. Incorrect wiring or loose connections. Double-check all connections and ensure proper wiring.
Data is inconsistent or noisy. Floating inputs on D0-D7 pins. Use pull-up or pull-down resistors on the input pins.
Data does not shift correctly. Incorrect clock signal or timing issues. Verify the clock signal and ensure proper delays in the code.
Serial output is always HIGH or LOW. SH/LD̅ pin is not toggled correctly. Ensure the SH/LD̅ pin is LOW during loading and HIGH during shifting.
Multiple 74HC165 ICs are not cascading. Incorrect connection of SER and QH pins. Connect the QH pin of the first IC to the SER pin of the next IC in the chain.

Frequently Asked Questions:

  1. Can I cascade multiple 74HC165 ICs? Yes, connect the QH pin of the first IC to the SER pin of the next IC. Repeat this for additional ICs.

  2. What is the maximum number of inputs I can read with cascading? Theoretically, there is no limit, but practical constraints like timing and signal integrity should be considered.

  3. Can I use the 74HC165 with a 3.3V microcontroller? Yes, the 74HC165 operates with a supply voltage as low as 2V. Ensure the logic levels are compatible.

  4. What happens if the clock frequency is too high? The IC may fail to shift data correctly. Ensure the clock frequency does not exceed the specified maximum.


This documentation provides a comprehensive guide to using the 74HC165 shift register. Whether you're a beginner or an experienced user, this component is an excellent choice for expanding input capabilities in your projects.

Explore Projects Built with 74HC165

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
STM32-Controlled LED Display with 74HC595 Shift Register and 12-Bit DAC
Image of Harry Stim Breadboard: A project utilizing 74HC165 in a practical application
This circuit uses a 74HC595 shift register to control multiple LEDs via a common ground configuration, with a microcontroller providing serial data input. It includes decoupling capacitors for stability and a 12-Bit DAC, potentially for analog signal generation or reference voltage application.
Cirkit Designer LogoOpen Project in Cirkit Designer
Teensy 4.0 and MAX7219-Based 7-Segment Display Counter
Image of dispay: A project utilizing 74HC165 in a practical application
This circuit uses a Teensy 4.0 microcontroller to control a MAX7219 LED driver, which in turn drives three 7-segment displays. The microcontroller runs code to display numbers from 0 to 999 on the 7-segment displays, with the SN74AHCT125N buffer providing signal integrity and the necessary capacitors and resistors ensuring stable operation.
Cirkit Designer LogoOpen Project in Cirkit Designer
Logic Gate and Binary Adder Experimentation Board
Image of BCD to full adder and subtractor: A project utilizing 74HC165 in a practical application
This circuit is a digital logic system that likely performs arithmetic operations and logical processing based on user inputs from push switches. It includes binary full adders for arithmetic functions, various logic gates for processing signals, and output interfaces such as 7-segment displays and LEDs for displaying results or statuses.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Controlled 74HC595 Shift Register LED Driver
Image of cube: A project utilizing 74HC165 in a practical application
This circuit consists of multiple 74HC595 shift registers daisy-chained together, controlled by an Arduino UNO. The shift registers are used to expand the number of digital outputs from the Arduino, allowing for control of multiple outputs with only a few pins. The circuit likely drives an array of LEDs or similar devices, as indicated by the series resistors connected to the outputs of the shift registers.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 74HC165

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Harry Stim Breadboard: A project utilizing 74HC165 in a practical application
STM32-Controlled LED Display with 74HC595 Shift Register and 12-Bit DAC
This circuit uses a 74HC595 shift register to control multiple LEDs via a common ground configuration, with a microcontroller providing serial data input. It includes decoupling capacitors for stability and a 12-Bit DAC, potentially for analog signal generation or reference voltage application.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of dispay: A project utilizing 74HC165 in a practical application
Teensy 4.0 and MAX7219-Based 7-Segment Display Counter
This circuit uses a Teensy 4.0 microcontroller to control a MAX7219 LED driver, which in turn drives three 7-segment displays. The microcontroller runs code to display numbers from 0 to 999 on the 7-segment displays, with the SN74AHCT125N buffer providing signal integrity and the necessary capacitors and resistors ensuring stable operation.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of BCD to full adder and subtractor: A project utilizing 74HC165 in a practical application
Logic Gate and Binary Adder Experimentation Board
This circuit is a digital logic system that likely performs arithmetic operations and logical processing based on user inputs from push switches. It includes binary full adders for arithmetic functions, various logic gates for processing signals, and output interfaces such as 7-segment displays and LEDs for displaying results or statuses.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of cube: A project utilizing 74HC165 in a practical application
Arduino-Controlled 74HC595 Shift Register LED Driver
This circuit consists of multiple 74HC595 shift registers daisy-chained together, controlled by an Arduino UNO. The shift registers are used to expand the number of digital outputs from the Arduino, allowing for control of multiple outputs with only a few pins. The circuit likely drives an array of LEDs or similar devices, as indicated by the series resistors connected to the outputs of the shift registers.
Cirkit Designer LogoOpen Project in Cirkit Designer