This is an old revision of the document!
The two analog input channels of the ADALM1000 provide a high input impedance and wide dynamic range which is very helpful for many of the measurements that students would be making around their laboratory activities. However, there are only the two analog inputs. Often, there are many more than two signals in the circuit or system under investigation that you would like to monitor. Or there could be a number of low bandwidth sensors, such as ambient temperature or light levels around a room, that need to be measured or monitored over long durations of time when gathering experimental data. As a solution to this need, the following multi-channel analog multiplexer is proposed.
A first example incarnation of this very simple design uses one CD4052 dual 4:1 analog multiplexer (or the equivalent 74HC4052/74HCT4052 ) to switch one or both analog input channels, see the schematic in figure 1. The 4:1 mux added to the two input channels allows the board to measure up to 8 signal channels.
Figure 1, Analog multiplexer example schematic
For ease of use the 6 pins on the digital connector (DIGITAL) pass through to the second digital connector (DIGITAL2). Similarly the 6/8 pins of the ANALOG connector pass through to one row of the 2×8 pin second analog connector (ANALOG2). The 8 analog inputs of the mux fill out the other row of 8 pins on the ANALOG2 connector. The X and Y outputs of the mux can be connected to either the CHA/B pin or optional input only AIN/BIN pins through jumpers JPA and JPB.
Digital outputs PIO 0 and 1 are used to address the four mux channels. Digital output PIO 2 drives the INH inhibit input of the mux which turns off all the switches.
The multiplexer is powered from the fixed + 5V supply on the ALM1000 analog connector which will limit the allowed range of analog input voltages to be within the same 0 to + 5V supported by the analog inputs. The 6/8 analog connector pins of the ALM1000 including the +5 volt and +2.5 volt power supplies are included in the female connector on the right and can be used to power sensor electronics, up to the current limits of the ALM1000 power supplies.
Figure 2 is a rendering of what the top of the PCB will look like. Design files for all the example board layouts are included in the zip file linked to at the end of this document.
Figure 2, Analog multiplexer PCB top layer
Here is another smaller incarnation of the analog multiplexer in figure 3, with the multiplexed connections on a separate single row female header rather than putting everything on the 2×8 header. This one stacks well with the two ALM1000 breadboard adapters proposed in this document.
Figure 3, Alternate version Analog multiplexer PCB top layer
In figure 4 we have a modified version of the protoboard/breadboard adapter which now includes the multiplexer and two of the input resistor divider networks.
Figure 4 Breadboard adapter with analog MUX and input attenuators
There are other analog multiplexer configurations in the generic CD4XXX series of CMOS ICs. The CD4051 is a single 8:1 mux and the CD4067 is a single 16:1 mux. The old Motorola MC14529B analog selector can be a configured as a dual 4-channel or single 8-channel device depending on how the input controls are used. By using 3 or all 4 of the digital PIO bits and two of these single multiplexers either 16 or even 32 signal channels could be measured. These two mux breakout boards are available from SparkFun, the 74HC4067 16:1 mux and the 74HC4051 8:1 mux. Either works well with the ALM1000.
Another functionally similar option is the dual 4:1 ADG609 and single ADG608 8:1 multiplexers, which have a different pin-out than the generic CD4051/52 multiplexers. Through-hole and surface mount ADG609 based boards similar to the one in figure 3 are also included in the zip file.
While the generic CD4052 is lower cost than the ADG609, there are two main advantages of using the ADG609 over the CD4052. The ADG609 on resistance maximum spec is 30 ohms, where the CD4052 on resistance maximum spec is 240 ohms and the 74HC4052 on resistance maximum spec is 120 ohms. This higher resistance could cause errors and distortions in the measurements under certain conditions.
The TTL compatible digital input minimum logic high voltage spec for the ADG609 is 2.45 V where the CD4052 and 74HC4052 minimum logic high voltage spec is 3.15V which is just slightly lower than the 3.3V typical logic high output voltage generated by the ALM1000. The actual logic threshold for the CD4052 is probably closer to VDD/2 ( 2.5V ) at room temperature and seems to work ( given this will probably be used at room temperature ) but there could be little margin in certain cases. The TTL compatible 74HCT4052 has a 1.6 volt typical logic high threshold which is perfect for the 3.3 V CMOS outputs of the ALM1000.
This analog multiplexer data acquisition add-on board is a perfect candidate for writing a custom program using the ALM1000 Python interface software package (libpysmu). A basic example Python program (eight-channel-mux.py) is written with a minimal display but provides all the ALM1000 libpysmu specific code to pole the dual 4:1 MUX inputs through the two analog input channels A and B. The display window as shown in figure 5 displays the 8 raw voltage values. The program can of course be further customized by the user to display the input signals in the appropriate scale factor with any gain and offset calibration for the sensor(s) being used. A copy of the Python program is included in the zip file.
Figure 5 Basic 8 input MUX data display
A modified version of the ALICE Python scope program has been developed which turns the ALM1000 into a four ( five counting Channel A ) input scope. The program uses a technique common in analog CRT oscilloscopes ( with a single electron beam ) where multiple input channels were switched in on alternating sweeps of the beam. This trick requires periodic signals and that each sweep be “triggered” or synced from the same input signal. In our case this will be channel A which is not multiplexed. This could be either the function generator output of channel A or a signal input to channel A in Hi-Z mode. As an example note the screen shot in figure 6.
Figure 6. Four channel MUX version of ALICE scope program
In this example a CD4024 binary counter is driven by a 0 to 5 V square wave output from channel A. The divide by 2, 4, 8 and 16 outputs of the counter drive a 4 bit resistor DAC using an AD8541 rail to rail CMOS opamp as an inverting summing amplifier. The top green trace is the output square wave from channel A. The bottom orange trace is the DAC output on CB0. The other three inputs, CB1, CB2 and CB3 ( yellow, magenta, red traces ) are connected to the 0 to 5 V binary counter outputs which make up the 3 least significant bits of the DAC.
One important feature of the program is that a sync or sweep start pulse is output on the PIO 3 digital output pin just before each analog sweep starts. This pulse is used to reset the CD4024 digital counter to the same starting condition for each sweep. Using this “reset” pulse would be necessary whenever this program is used to observe a circuit that contains “state” as in this example with a digital counter.
The program has much of the same functionality as the full ALICE program but because it is assumed that a MUX is connected to channel B the output functions for that channel have been removed and also since channel B is always a voltage input the current waveform for that channel has also been done away with. To allow the program to be used with multiplexers with active low control signals ( INH in the CD4052 ) or active high control signals ( EN in the ADG609 ) a widget to set PIO 2 low or high is included under the Options drop down menu. A copy of the Python program ( alice-mux-1.0.pyw ) is included in the zip file.