Multiplexers (MUX)
Clarus Goldsmith, June 2024
What is a multiplexer?
Essentially acts like a switchboard. Only inputs with their respective control signal (marked with # in left figure) set to high (i.e., 1) will transmit through the MUX. For ex, input signal 1 will only transmit to output 2 if 13 is set to 1.
Multiplexing vs. Demultiplexing
Multiplexing refers to taking a single input and sending it to multiple possible outputs
Demultiplexing refers to taking in multiple inputs and switching which is sent to a common output
Hardware considerations for a MUX
Using a MUX with a microcontroller
A common use for multiplexers is to functionally expand the number of ports available on a microcontroller. By wiring all of the output pins together and attaching them to a microcontroller pin, you can send multiple input signals into the pin by cycling which command pin is high. By keeping track of this cycling, you can then record these multiple signals distinctly. In this way, a single port can functionally play the role of 2-4 ports. This is particularly invaluable for analog signals, as microcontrollers typically have only 10-18 analog ports. For cases involving, for example, 36 analog strain signals from a hexapod robot, demultiplexing is the only way to record all signals simultaneously.
Example demultiplexing code
This code was originally created for use with the 18 input MUX circuit that can be found here.
Last updated