74HC4052, 74HC4053 and 74HC4066 analog switches

Switches you close with a logic level: a small resistance between two pins when on, an open circuit when off, passing a signal either way.

They let a microcontroller route an audio signal, a sensor line or a button contact, read several analog inputs through one pin, or press a button on another device. The 74HC4052 and 74HC4053 are the siblings of the 8-channel 74HC4051 (which, like these, also has a CD4051B model), and the CD74HC4067 is the 16-channel one. Aliases: 4052, 4053, 4066, CD4052, CD4053, CD4066, CD4052B, CD4053B, CD4066B, CD74HC4052, CD74HC4053, CD74HC4066, HEF4066B, analog multiplexer, analog switch, bilateral switch, transmission gate.

74HC4052: dual 4-channel multiplexer

Two 4-to-1 multiplexers sharing one address. S1 S0 (S0 the 1s bit) joins 1Y0 to 1Y3 to 1Z and 2Y0 to 2Y3 to 2Z, both at once. E (active low) opens every switch when it is high. Two channels switching together is what a stereo signal needs: one chip picks between four stereo sources.

Pin Name What it does
12, 14, 15, 11 1Y0 to 1Y3 Channels of mux 1.
13 1Z Common pin of mux 1.
1, 5, 2, 4 2Y0 to 2Y3 Channels of mux 2.
3 2Z Common pin of mux 2.
10, 9 S0, S1 The channel address, S0 the 1s bit.
6 E Enable, active low. High opens every switch.
7 VEE Negative analog supply. Tie it to GND.
8 GND Ground.
16 VCC Supply.

TI's CD4052B data sheet names these pins differently (X0 to X3, Y0 to Y3, X COM, Y COM, INH, A and B); the part uses NXP's names in both models.

74HC4053: triple 2-channel multiplexer

Three single-pole, double-throw switches. S1 joins 1Z to 1Y0 when low and to 1Y1 when high; S2 does the same for 2Z and S3 for 3Z, each on its own. E (active low) opens every switch when it is high.

Pin Name What it does
12, 13 1Y0, 1Y1 Switch 1 throws.
14 1Z Switch 1 common.
11 S1 Switch 1 select. Low: 1Y0. High: 1Y1.
2, 1 2Y0, 2Y1 Switch 2 throws.
15 2Z Switch 2 common.
10 S2 Switch 2 select.
5, 3 3Y0, 3Y1 Switch 3 throws.
4 3Z Switch 3 common.
9 S3 Switch 3 select.
6 E Enable, active low. High opens every switch.
7 VEE Negative analog supply. Tie it to GND.
8 GND Ground.
16 VCC Supply.

TI's CD4053B names the pins ax, ay, a COM and so on, with INH, A, B and C.

74HC4066: quad bilateral switch

Four independent on/off switches, each joining nY and nZ while its enable nE is high. It has no VEE.

Pin Name What it does
1, 2 1Y, 1Z Switch 1.
13 1E Switch 1 enable, active high.
4, 3 2Y, 2Z Switch 2.
5 2E Switch 2 enable, active high.
8, 9 3Y, 3Z Switch 3.
6 3E Switch 3 enable, active high.
11, 10 4Y, 4Z Switch 4.
12 4E Switch 4 enable, active high.
7 GND Ground.
14 VCC Supply.

TI's CD4066B names the pins SIG A IN/OUT and so on, with CONTROL A to D.

Truth table

74HC4052:

E S1 S0 Joined
1 x x Nothing
0 0 0 1Y0 to 1Z, 2Y0 to 2Z
0 0 1 1Y1 to 1Z, 2Y1 to 2Z
0 1 0 1Y2 to 1Z, 2Y2 to 2Z
0 1 1 1Y3 to 1Z, 2Y3 to 2Z

74HC4053 (each switch on its own select):

E Sn Joined
1 x Nothing
0 0 nY0 to nZ
0 1 nY1 to nZ

74HC4066: nE high joins nY to nZ; low opens it.

Properties

model, which chip it is:

  • 74HC4052, 74HC4053, 74HC4066 (the defaults): 2 V to 6 V. The 74HC4052 and 74HC4053 switches are 70 ohms from a 4.5 V supply, 100 ohms from 3 V and 160 ohms below that. The 74HC4066's are lower: the data sheet gives 25 ohms typical at 4.5 V (35 ohms mid-supply) and 20 at 6 V, and the model uses 30 ohms from 4.5 V, rising at lower supplies in the same proportion as the 4052's.
  • CD4052B, CD4053B, CD4066B: the same parts in the 4000 series, 3 V to 18 V, with a much higher on-resistance: 470 ohms typical at 5 V, 180 ohms at 10 V and 125 ohms at 15 V, in straight lines between and rising below 5 V. That 470 ohms is why a CD4066 on a 5 V supply is a poor switch for anything but a light load.

What the model gets right

Each switch is a resistor between its two pins: the on-resistance when closed and an open circuit when open, both ways round, so a signal passes in either direction and a load on the far side divides against the on-resistance as it does on the bench. The on-resistance follows the supply and the model. The control pins are CMOS inputs read against half the supply, and an address or enable that is not a clean logic level opens every switch.

What it does not model

Switching times, break-before-make, charge injection, leakage, the on-resistance's change with the signal voltage, and signals beyond the supplies. VEE is not read: the model behaves as if it were tied to GND, which is what every Arduino circuit does, so a signal below ground is not passed as it would be with VEE negative.

Common mistakes

Leaving E or VEE unconnected on the 74HC4052 or 74HC4053. Getting the enables the wrong way up: E is active low on the multiplexers, but the 74HC4066's nE is active high. Expecting a CD4066B on 5 V to switch a load like a relay would: 470 ohms in series with an LED and its resistor leaves it noticeably dimmer. Reading the common pin straight after changing the address through a large source resistance: give the input a moment to settle.

See it in action

Browse the example circuits at /templates.