A multiplexer (mux) is an electronic switch that selects one of several analog or digital input signals and forwards it to a single common output line. By using control pins to route multiple signals through one path, a mux drastically reduces microcontroller pin count, simplifies physical wiring in dense circuits, and allows a single analog-to-digital converter (ADC) to monitor an entire array of sensors. Whether you are building a custom macro keyboard or reading a bank of thermistors, understanding how to select and drive the right multiplexer IC is a foundational electronics skill.

The Core Mux Definition and Signal Routing Mechanics

At its core, a multiplexer is a "many-to-one" data selector. The number of input lines is typically a power of two ($2^n$), and the device requires $n$ select lines to choose which input connects to the output. For example, an 8-channel mux requires 3 select lines ($2^3 = 8$).

Think of a mux like a railroad switchyard: just as a single track switch routes a train from one of eight sidings onto the main line based on the lever positions, a mux routes a specific data line to the output based on the binary address applied to its select pins. However, the physical implementation depends heavily on whether you are routing digital logic or continuous analog voltages.

  • Digital Multiplexers: Built using standard logic gates (AND, OR, NOT). They output a clean, discrete HIGH or LOW logic level regardless of minor input voltage sag, making them ideal for routing SPI, UART, or parallel data buses.
  • Analog Multiplexers: Built using MOSFET transmission gates (pass gates). They act as physical resistors in series with your signal. They pass continuous AC or DC waveforms (like audio or sensor voltages) but introduce an on-resistance ($R_{ON}$) that can degrade signal integrity if not managed properly.

Real-World Multiplexer IC Specifications

Choosing the wrong mux for your application is a common bench mistake. Passing an analog audio signal through a digital 74HC151 will clip and destroy the waveform, while using a high-resistance analog mux for a precision current loop will introduce massive measurement errors. Below is a specification comparison of four common multiplexer ICs you will encounter in 2026 hobbyist and prototyping environments.

IC Part Number Type Channels $V_{CC}$ Range $R_{ON}$ (On-Resistance) Typical Price (2026)
74HC151 Digital 8:1 2.0V - 6.0V N/A (Logic Gates) $0.45
CD4051B Analog 8:1 3.0V - 15.0V ~120Ω (at 5V) $0.60
TCA9548A I2C Bus 8-Channel 2.3V - 5.5V ~4Ω (Switch) $1.85
MAX14662 Analog (Precision) 16:1 1.8V - 5.5V ~15Ω $2.10
Pro-Tip on $R_{ON}$: The on-resistance of an analog mux is not perfectly flat; it varies slightly depending on the input voltage and temperature. If you are multiplexing precision load cells or RTDs, always check the "$R_{ON}$ flatness" graph in the manufacturer's datasheet, such as the Texas Instruments CD4051B documentation, or buffer the mux output with an op-amp.

Worked Example: Addressing and Analog Voltage Drop

Let's look at two practical scenarios: setting the digital address lines, and calculating the real-world signal degradation caused by analog on-resistance.

1. Digital Addressing (74HC151)

Suppose you have eight limit switches wired to the inputs ($D_0$ through $D_7$) of a 74HC151 digital mux, and you need to read the state of switch $D_5$. The select pins are $S_2$ (MSB), $S_1$, and $S_0$ (LSB).

Convert the target channel (5) to binary: $5 = 101_2$.
Therefore, you must drive the select pins as follows: $S_2 = HIGH, S_1 = LOW, S_0 = HIGH$. The output pin $Y$ will now mirror the exact logic state of switch $D_5$.

2. Analog Voltage Drop Calculation (CD4051B)

You are using a CD4051B to route a 4-20mA industrial sensor signal to a microcontroller's ADC. The sensor is currently outputting 12mA (0.012A). The CD4051B, powered at 5V, has a typical $R_{ON}$ of 120Ω.

Using Ohm's Law ($V = I \times R$), the voltage dropped across the multiplexer's internal switch is:

$V_{drop} = 0.012A \times 120\Omega = 1.44V$

The Result: You just lost 1.44V of your signal headroom before it even reaches the ADC. If your ADC reference is 3.3V, this massive voltage drop will cause severe non-linearity and measurement errors. The Fix: Swap the CD4051B for a precision mux like the MAX14662 ($15\Omega$ $R_{ON}$), which drops only 0.18V, or place a unity-gain op-amp buffer immediately after the mux output to eliminate the loading effect.

Where You Meet Multiplexers in Practice

Multiplexers are ubiquitous in modern embedded systems. Here is where you will actively use them on the bench:

  • I2C Bus Expansion: The I2C protocol relies on fixed hardware addresses. If you want to connect four identical BME280 environmental sensors (all sharing address 0x76) to a single ESP32, you will use an I2C mux like the NXP TCA9548A. It creates eight isolated I2C sub-buses, allowing you to route the master SDA/SCL lines to one sensor at a time.
  • Keyboard Matrices: Custom mechanical keyboards use multiplexing (often via shift registers or dedicated matrix scanners) to read 100+ key switches using only a dozen GPIO pins.
  • Audio Routing: In DIY guitar pedals or synthesizers, analog muxes (like the 4051 or 4052) are used to switch between different capacitor/resistor networks in real-time, effectively creating programmable analog filters without using mechanical relays.
  • Display Driving: Charliplexing and LED matrix displays use high-speed multiplexing to illuminate thousands of LEDs by rapidly switching power to specific rows and columns, exploiting persistence of vision.

Common Confusions: Mux vs. Demux vs. Encoder

When ordering parts or reading schematics, it is easy to mix up similar routing components. Here is how to keep them straight:

Multiplexer (Mux): Many inputs, one output. Routes data from a selected input to the output. (e.g., selecting which sensor feeds the ADC).

Demultiplexer (Demux): One input, many outputs. Routes data from a single input to a selected output. (e.g., taking one serial data stream and sending it to one of eight different displays).

Encoder: Many inputs, few outputs. Does not route data. Instead, it outputs a binary code representing which input line is currently active. (e.g., a priority encoder detecting which of 8 buttons was pressed and outputting the number '5' in binary).

For a deeper dive into the logic gate implementations of these circuits, the All About Circuits multiplexer tutorial provides excellent schematic breakdowns of the internal AND/OR gate arrays.

Ultimately, mastering the mux definition means moving beyond the abstract concept of "data selection" and understanding the physical realities of on-resistance, propagation delay, and bus capacitance. By matching the right IC to your signal type—digital logic, precision analog, or communication buses—you can build denser, more efficient circuits without sacrificing signal integrity.