Source: https://mokxi.com/parts/74hc4051
Updated: 2026-11-16

Part

# 74HC4051 analog multiplexer

Eight channels to one pin through analog switches: three address lines pick which one.

See every part

- 16 pins
- 1 setting
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The 74HC4051 analog multiplexer in brief

What it is, and every setting the properties panel gives it.

The 74HC4051 is an 8 channel analog multiplexer, eight analog switches with one common pin in a 16 pin DIP: three address lines pick which channel reaches Z. The pins are Y0 to Y7, the eight channels, Z, the common pin, S0, S1 and S2, the channel address with S0 the least significant bit, E, enable, active low, which opens every switch when high, VEE, the negative analog supply, tied to GND on an Arduino, and VCC and GND, 2 to 6 V. Each switch passes current in either direction, so one analog pin reads eight sensors, or one pin drives eight outputs in turn. The model property picks the 74HC4051 or the CD4051B, which runs from 3 V to 18 V with a much higher on-resistance: 470 ohms against 70.

Family

Logic

Pins

16

model

74HC4051 (or CD4051B)

Pins

## 16 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

Y4

Y6

Z

The common pin, to an analog input (or a PWM output).

Y7

Y5

E

Enable, active low. High opens every switch. Tie it to GND if unused.

VEE

The negative analog supply. On an Arduino, tie it to GND.

GND

Ground.

S2

The channel address, S0 the least significant bit.

S1

The channel address, S0 the least significant bit.

S0

The channel address, S0 the least significant bit.

Y3

Y0

Y1

Y2

VCC

Supply, 2 to 6 V.

How to use it

## How to read eight knobs on one analog pin with a 74HC4051

Z, the common pin, goes to A0. The three address pins S0, S1 and S2 go to Uno pins 2, 3 and 4. E, enable, VEE and GND all go to ground: E low turns the switches on, and VEE is tied to GND on an Arduino. VCC is on 5 V. The three knobs’ wipers go to Y0, Y1 and Y2.

The sketch writes the channel number onto the three address pins, bit 0 to S0, waits 50 microseconds for the switch to settle and reads A0. It reads channels 0, 1 and 2 and prints them every 300 ms. The same pins would read eight channels. The 74HC4051 is the smaller cousin of the CD74HC4067, which has sixteen.

Part pin

Board pin

Z

A0

S0, S1, S2

Pins 2, 3, 4

Y0, Y1, Y2

The three knobs’ wipers

E, VEE, GND

Ground

VCC

5 V

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Pick a channel, then read

Common errors

## Common 74HC4051 analog multiplexer errors and fixes

What goes wrong

The fix

Every channel reads nothing.

E is active low. High opens every switch, so tie it to GND if unused.

The channels read each other.

Wait a few tens of microseconds after changing the address before analogRead(), as the sketch does.

The analog values are clipped.

VEE is the negative analog supply. On an Arduino tie it to GND, and keep signals between GND and VCC.

Questions

## Questions and answers

### How many analog pins does a 74HC4051 save?

It reads eight sensors on one analog pin and three digital pins.

### What is the difference between the 74HC4051 and the CD4051B?

Same pins. The CD4051B runs 3 V to 18 V and has a much higher on-resistance: 470 ohms typical at 5 V against 70 ohms.

### Can the 74HC4051 output as well as input?

Yes. Each switch passes current in either direction, so one pin can drive eight outputs in turn.

How it is modeled

## What is true about the 74HC4051 analog multiplexer, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

From the Nexperia 74HC4051 and TI CD74HC4051 datasheets: E low joins the
addressed channel to Z through the switch's on-resistance, both ways round, and
leaves the others open; E high opens them all. The on-resistance is about 70
ohm at 4.5 V and more at lower supplies, so a load on Z divides against it.
The address and enable are CMOS inputs read against half the supply; an address
that is not a clean level opens every switch.

### Not modeled

The switching time, break-before-make, charge injection, leakage, the
on-resistance's change with the signal voltage, and signals below ground: VEE
is not read, as if it were tied to GND.

From 74HC4051 8-channel multiplexer, in full.

Projects

## See the 74HC4051 analog multiplexer in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the 74HC4051 analog multiplexer in it.

- Arduino Uno R3

Keep going

## Keep going

- Analog vs Digital Pins, and ADC Resolution
- Shifting a Byte In, One Edge at a Time
- CD74HC4067 analog multiplexer
- Potentiometer
- Eight-channel ADC, MCP3008

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the 74HC4051 analog multiplexer

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
