Is it possible to monitor analog multiplexer inputs without changing the selector signal

analogmicrocontrollermultiplexer

If you have 8 analog input sensors (or 2 or 9 or 738479) is there a chip / is it possible with microprocessor programming to actively monitor all of the channels? Say you had 8 rotary potentiometers attached to each i/o pin on the mux, would you have to change the selection inputs every time you wanted to use a different potentiometer? It seems like this would make a mux much less useful than I thought it was. So if I wanted to use the pot on i/o pin 1 and then the pot on i/o pin 8 immediately following the first, I would have to tell the microcontroller / processor to change to reading pin 8 before I could use the peripheral attached to it? Or is there a way to make it monitor all of the i/o pins at once so that I could use the peripheral on pin 1 then on pin 7 then on pin 2 without having to do anything at all regarding changing the io pin being read, so long as I only use one at a time?

CD74HC4051MM96EP is the mux I already have tons of, and I'm using teensyduino (arduino code library) / teensy 3.1 to send midi messages. I'd like to read all kinds of different input sensors.

Best Answer

The idea behind using a multiplexer is that you would read all of the inputs in a sequence very quickly and then loop around and do it again. It's a trade-off of bandwidth and latency vs. port count. It lets you divide the available bandwidth and required port count down by the same factor. If you have an ADC that can sample at 10 KSps and an 8 port mux, then with 1 input you can sample at 10 KSps on that input, with 2 inputs you can sample at 5 KSps on both inputs, with 4 inputs you can sample at 2.5 KSps on each input, etc. One side-effect is that the samples are interleaved in time as you can't look at all of the inputs at exactly the same time. With 2 inputs, there will be an offset of 1 sample period between readings on alternate channels where the first sample from input 1 will occur at 'T=0', the second sample will come from input 2 and will occur at T=100us, the third sample will come from input 1 and will occur at T=200us, etc.

If you're just trying to read from POTs, you should be fine as the signals coming out of them will change very slowly. All you need to do is write a for loop that will cycle through all of the mux settings and read in the corresponding analog value.