Comparators & Mixed-Signal Building Blocks

an analog switch

An analog switch is an electronic version of a relay or a light switch, but with no moving parts — a gate you open and close with a digital control line, that passes or blocks an analog signal in between. When closed it behaves like a short piece of wire; when open, like a broken connection. Crucially it passes the signal faithfully in either direction, so the smooth analog voltage on one side appears on the other, controlled by a simple 1 or 0.

Inside, it is built from MOSFETs — usually an N-channel and a P-channel in parallel, called a transmission gate, so it can pass the whole voltage range cleanly. A logic HIGH on the control turns the transistors on, presenting a small on-resistance (typically a few ohms to a couple of hundred ohms) between the two analog terminals. A logic LOW turns them off, leaving a very high resistance that blocks the signal. Because it is just a resistance when on, it does not amplify or buffer — whatever drives the input must supply the current, and the on-resistance forms a divider with the load. Example: a 100 ohm switch feeding a 10 kΩ load loses about 1 percent of the signal; feeding a 100 ohm load it would lose half.

Analog switches (the 4066, the DG-series, ADG parts) route audio, select which sensor a single amplifier reads, build sample-and-hold circuits, and steer signals under software control. The honest caveats are real: the on-resistance is not perfectly constant — it changes with the signal voltage, adding a little distortion; the switch can only pass signals that stay within its supply rails; and fast control edges leak a small charge into the signal (charge injection), which matters in precision sample-and-hold. For pure on/off logic signals you would use a logic gate, but for routing an analog waveform intact, the analog switch is the tool.

A four-channel analog switch lets one op-amp read four sensors in turn: the microcontroller closes one switch at a time, routing each sensor's voltage to the shared amplifier. With 50 Ω on-resistance into a 100 kΩ amplifier input, the signal loss is a negligible 0.05 percent.

A solid-state gate that passes analog either way under digital control.

An analog switch is a resistance, not a buffer. Its on-resistance forms a divider with the load and varies with signal voltage, so driving a low-impedance load through one loses signal and adds distortion.

Also called
CMOS switchtransmission gatebilateral switch傳輸閘