Analog Multiplexing

Hi I was just wondering how you can multiplex some kind of analog "sensors" (let's say 16 potentiometers). I was thinking of using a 74HC164 for the rows, and then having each column either on an AnalogIn of the arduino, or using one ADC for each line. Is their a better way to do this (using less pin possible on the Arduino) ? Which kind of chip would you use ? Cheers.


What you want is the 74HC165, which is the other way around to a 74HC164 (parallel to serial). You can implement a 8 input external ADC with 4 pins for spi or 2 for i2c, plus 2 (or 3 if you want clock inhibit) pins for the shift registers. So an 8x8 input grid would take as few as 4 pins.

Or you can use two 4051 chips as seen on the playground.

I have code + PCB layout for using 2 4051 IC's to read 16 potentiometers.

If you want it let me know.

Thanks for the answers, guys.
I think I’ll dig into the 4051 chips, as those are the ones used on the MidiBox project, and I’m planning on making a MIDI controller.
MikMo : I’d be really interested on your schematics, at least ^^

It’s very simple there’s nothing but the two IC’s (and a lot of wires :slight_smile: )

Here it is