Types of multiplexers
In the trade offer of integrated circuit manufacturers you can find numerous distributions of multiplexers, differing in the way they work, the type of signals to be switched, the range of parameters and the number of channels and possible connections, and even... the way of control. In order not to get lost in this technological thicket, it is worth to separate three groups of solutions from each other at the beginning: multiplexers (switches) analogue, digital and designed for special tasks. In the former case, the systems are used to switch analog signals, i.e. those that change smoothly to a certain extent - usually not exceeding the supply voltage of the system itself (although even here one can find numerous deviations from this rule). For analog switches it doesn't matter much which side of the circuit is the input (signal source) and which side is the output (e.g. next amplifier or filter input). Digital multiplexers allow to switch binary signals, so only the outputs of other logic circuits can be the source of input signals. In this case there are usually also strictly defined directions of data transmission. The third group is made up of specialized integrated circuits, which allow switching of strictly defined types of circuits - e.g. SCL and SDA data lines of I2C interface. Such circuits are tailored to the specific requirements of the target application situation, so they can contain additional features not required in simple, classic multiplexers.
4052 as an example of a universal multiplexer
For example, "let's take a workshop" very popular - and for many years now - analog 4-bit multiplexers from CMOS 4000 family. 4052 model, also known as CD4052, HCF4052 or UTC4052, is offered in 16-leg THT (DIP16) and SMD (SO16) mounting housings, although there are also other, less "typical" SMD versions. This model has two common inputs/outputs (X and Y) and eight inputs/outputs in two groups (X1..X4 and Y1..Y4). Both sections are controlled simultaneously by two digital address inputs (A, B) and one additional enabling input (INH). If a low state is given to the INH input the multiplexer is switched on - from that moment on the connection of one of the X1..X4 and Y1..Y4 outputs to the corresponding common pin (X or Y) will depend on the combination of logical states on the address inputs. The control is in BCD code, which means that X0-X and Y0-Y connections will be active for A=0, B=0, for A=1, B=0 - X1-X and Y1-Y, for A=0 B=1 - X2-X and Y2-Y, and for A=1, B=1 - X3-X and Y3-Y. As you can see, in every moment of working with a common input only one selectable input is connected - hence the circuits of this type are sometimes called 4:1 double multiplexers.
Examples of applications of 4052 chip
One of the basic application examples of the 4052 cube is to operate two sets of sensors (up to 8 units in total) via just two lines of the ADC microcontroller. This can be the case, for example, in a mini sumo robot, which both in front and back, contains 4 optical line sensors each. Using 4052 makes it easy to separate the two analog/digital inputs of the processor into all sensors, saving ADC lines for other purposes. Another example is audio circuitry - with the help of 4052 switches, switching of signal sources and/or line outputs can be successfully implemented. In addition to the obvious advantage of such a solution, resulting from the lack of outdated mechanical switches on the front panel of the mixer, such a solution has another, very desirable feature - it allows to switch signals in a "soft" way, without unpleasant crackles caused by contact vibrations. You can easily use any microcontroller or e.g. a set of hardware touch switches to control the 4052 cube.