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

How to Use 74HC4051 CD4051 8-Channel Multiplexer: Examples, Pinouts, and Specs

Image of 74HC4051 CD4051 8-Channel Multiplexer
Cirkit Designer LogoDesign with 74HC4051 CD4051 8-Channel Multiplexer in Cirkit Designer

Introduction

The 74HC4051 CD4051 is an 8-channel analog multiplexer/demultiplexer manufactured by Generic. It allows one of the eight input channels to be connected to a single output, or vice versa, enabling the selection and routing of multiple analog or digital signals. This component is widely used in signal switching, data acquisition systems, and microcontroller-based projects.

Explore Projects Built with 74HC4051 CD4051 8-Channel Multiplexer

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
8-Channel Multiplexer with Pushbutton Inputs and Resistor Network
Image of 8 push pull buttons one mux: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
This circuit uses a SparkFun 74HC4051 8-Channel Multiplexer to read the states of eight pushbuttons. Each pushbutton is connected to a corresponding input channel on the multiplexer through a 2k Ohm resistor, allowing the multiplexer to sequentially read the button states and output them to a single data line.
Cirkit Designer LogoOpen Project in Cirkit Designer
Analog Multiplexer-Based Multi-Potentiometer Input System
Image of Copy of MIDI Control Surface: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
This circuit uses a 16-channel analog multiplexer to read the wiper positions of multiple rotary potentiometers, allowing for the selection and measurement of different analog signals. Additionally, an 8-channel multiplexer is used to read the states of multiple pushbuttons, enabling digital input selection.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Micro-Based Multi-Channel Analog Input System with Potentiometers and Toggle Switches
Image of Polivoks: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
This circuit features an Arduino Micro connected to three CD74HC4067 multiplexers, which are used to expand the number of analog inputs. Multiple potentiometers and toggle switches are connected to the multiplexers, allowing the Arduino to read various analog signals and switch states for further processing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Teensy 4.1-Based Multi-Channel Potentiometer Interface with 74HC4051 Mux and AMS1117 3.3V Regulator
Image of redrum: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
This circuit features a Teensy 4.1 microcontroller interfaced with a SparkFun 74HC4051 8-channel multiplexer to read multiple rotary potentiometers. The AMS1117 3.3V voltage regulator provides a stable 3.3V supply to the multiplexer and potentiometers, while electrolytic and ceramic capacitors are used for power supply filtering and stabilization.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 74HC4051 CD4051 8-Channel Multiplexer

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 8 push pull buttons one mux: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
8-Channel Multiplexer with Pushbutton Inputs and Resistor Network
This circuit uses a SparkFun 74HC4051 8-Channel Multiplexer to read the states of eight pushbuttons. Each pushbutton is connected to a corresponding input channel on the multiplexer through a 2k Ohm resistor, allowing the multiplexer to sequentially read the button states and output them to a single data line.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of MIDI Control Surface: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
Analog Multiplexer-Based Multi-Potentiometer Input System
This circuit uses a 16-channel analog multiplexer to read the wiper positions of multiple rotary potentiometers, allowing for the selection and measurement of different analog signals. Additionally, an 8-channel multiplexer is used to read the states of multiple pushbuttons, enabling digital input selection.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Polivoks: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
Arduino Micro-Based Multi-Channel Analog Input System with Potentiometers and Toggle Switches
This circuit features an Arduino Micro connected to three CD74HC4067 multiplexers, which are used to expand the number of analog inputs. Multiple potentiometers and toggle switches are connected to the multiplexers, allowing the Arduino to read various analog signals and switch states for further processing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of redrum: A project utilizing 74HC4051 CD4051 8-Channel Multiplexer in a practical application
Teensy 4.1-Based Multi-Channel Potentiometer Interface with 74HC4051 Mux and AMS1117 3.3V Regulator
This circuit features a Teensy 4.1 microcontroller interfaced with a SparkFun 74HC4051 8-channel multiplexer to read multiple rotary potentiometers. The AMS1117 3.3V voltage regulator provides a stable 3.3V supply to the multiplexer and potentiometers, while electrolytic and ceramic capacitors are used for power supply filtering and stabilization.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Signal routing in analog and digital systems
  • Data acquisition in microcontroller projects
  • Audio signal multiplexing
  • Sensor selection in embedded systems
  • Expanding the number of analog inputs for microcontrollers like Arduino

Technical Specifications

The following are the key technical details of the 74HC4051 CD4051:

Parameter Value
Supply Voltage (Vcc) 2V to 10V (CD4051), 2V to 6V (74HC4051)
Control Voltage Range 0V to Vcc
Analog Signal Range 0V to Vcc
Maximum On-State Resistance 70Ω (typical)
Maximum Switching Frequency 6 MHz
Operating Temperature Range -40°C to +85°C
Package Types DIP-16, SOIC-16, TSSOP-16

Pin Configuration and Descriptions

The 74HC4051 CD4051 is a 16-pin IC. Below is the pinout and description:

Pin Number Pin Name Description
1 E (Enable) Active LOW enable pin. When HIGH, all channels are disconnected.
2 S1 Select line 1 (used to select the active channel).
3 S2 Select line 2 (used to select the active channel).
4 S3 Select line 3 (used to select the active channel).
5 Z (Common I/O) Common input/output pin for all channels.
6 Y7 Channel 7 input/output.
7 Y6 Channel 6 input/output.
8 VEE Negative supply voltage (connect to GND for single-supply operation).
9 Y5 Channel 5 input/output.
10 Y4 Channel 4 input/output.
11 Y3 Channel 3 input/output.
12 Y2 Channel 2 input/output.
13 Y1 Channel 1 input/output.
14 Y0 Channel 0 input/output.
15 VCC Positive supply voltage.
16 GND Ground.

Usage Instructions

How to Use the 74HC4051 CD4051 in a Circuit

  1. Power Supply: Connect the VCC pin to a positive voltage source (e.g., 5V for 74HC4051) and GND to ground. For single-supply operation, connect VEE to GND.
  2. Channel Selection: Use the S1, S2, and S3 pins to select one of the eight channels (Y0 to Y7). The binary combination of these pins determines the active channel:
    • S3, S2, S1 = 000 → Y0 is connected to Z
    • S3, S2, S1 = 001 → Y1 is connected to Z
    • ...
    • S3, S2, S1 = 111 → Y7 is connected to Z
  3. Enable Pin: Ensure the E pin is LOW to enable the multiplexer. If E is HIGH, all channels are disconnected.
  4. Signal Connection: Connect the input/output signals to the Y0–Y7 pins. The selected channel will route the signal to/from the Z pin.

Important Considerations and Best Practices

  • Voltage Levels: Ensure that the input signal voltage does not exceed the supply voltage (VCC).
  • Decoupling Capacitor: Place a 0.1 µF decoupling capacitor near the VCC pin to reduce noise.
  • Unused Pins: Leave unused Y pins floating or connect them to GND through a pull-down resistor.
  • Switching Speed: Avoid exceeding the maximum switching frequency to maintain signal integrity.

Example: Connecting to an Arduino UNO

The 74HC4051 can be used to expand the number of analog inputs for an Arduino UNO. Below is an example code to read from multiple analog sensors:

// Define control pins for the 74HC4051
const int S1 = 2; // Arduino pin connected to S1
const int S2 = 3; // Arduino pin connected to S2
const int S3 = 4; // Arduino pin connected to S3
const int Z = A0; // Arduino analog pin connected to Z

void setup() {
  // Set control pins as outputs
  pinMode(S1, OUTPUT);
  pinMode(S2, OUTPUT);
  pinMode(S3, OUTPUT);
  
  // Initialize serial communication
  Serial.begin(9600);
}

void loop() {
  for (int channel = 0; channel < 8; channel++) {
    // Set the select pins to choose the active channel
    digitalWrite(S1, channel & 0x01); // Least significant bit
    digitalWrite(S2, (channel >> 1) & 0x01); // Second bit
    digitalWrite(S3, (channel >> 2) & 0x01); // Most significant bit
    
    // Read the analog value from the selected channel
    int value = analogRead(Z);
    
    // Print the channel number and its value
    Serial.print("Channel ");
    Serial.print(channel);
    Serial.print(": ");
    Serial.println(value);
    
    delay(500); // Wait for 500ms before reading the next channel
  }
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Signal Output on Z Pin:

    • Ensure the E pin is LOW to enable the multiplexer.
    • Verify that the S1, S2, and S3 pins are set correctly to select the desired channel.
  2. Signal Distortion or Noise:

    • Check that the input signal voltage is within the range of 0V to VCC.
    • Add a decoupling capacitor near the VCC pin to reduce power supply noise.
  3. Incorrect Channel Selection:

    • Double-check the binary combination of S1, S2, and S3 pins.
    • Ensure the Arduino or microcontroller pins are configured as outputs.
  4. High On-State Resistance:

    • If the resistance is too high, ensure the supply voltage is within the recommended range (e.g., 5V for 74HC4051).

FAQs

Q: Can the 74HC4051 handle digital signals?
A: Yes, the 74HC4051 can handle both analog and digital signals, as long as the signal voltage is within the supply voltage range.

Q: Can I use the 74HC4051 with a 3.3V microcontroller?
A: Yes, the 74HC4051 is compatible with 3.3V systems. Ensure that VCC is set to 3.3V and the input signals do not exceed this voltage.

Q: What happens if the E pin is left floating?
A: If the E pin is left floating, its state may be undefined, leading to unpredictable behavior. Always connect it to GND (LOW) to enable the multiplexer or to VCC (HIGH) to disable it.