Read analog inputs in a matrix with multiplexer 4051

Status
Not open for further replies.
Hi All

I know I can read an 8x8 matrix of buttons using two 4051 multiplexers and a lot of diodes. Can one do the same for analog inputs (potentiometers)? What I am thinking is that the +V of the pots are the columns to which I send a value of 1023 via one multiplexer and then I the pot outputs are the rows, using the same reading method as for the button matrix. Is this feasable? Do I need diodes and if so on the input or the output side?

What about timing? Do the pots have a lag time once powered (via the columns) before I can read them?

Cheers

Chris
 
I'm building a midi controller. Due to space constraints I can fit the teensy and 4 multiplexer on the board. So 2 of them in a matrix drives 64 buttons that's cool. I need more than the 16 that 2 x 8 demux will give me. It does not need to be superfast just fast enough to detect a user moving a joystick that in turn will cause a moving head to move, or a fader to come down on the lighting software.
 
After looking a little harder i'm not sure it can be done, if you hook them up as I have done the second row will always interfere with the first row during reads. Even if you could set the input/gnd to high impedance it would still interfere since you have pots in series/parallel with each other.

If you wired several pots to 1 input and had the top/bottom of the pots tied to a logic IC that could give +/- and High inpedance it could be done.
I could go into more detail but I just noticed im late for work.....

vH9Z6xJ.jpg
 
Thanks Donziboy - please don't be late for work!! Thats whet we need to keep doing this stuff :cool:

So, It does not look good. Would a diode on the data line not fix the issue?
 
At work:D
Adding diodes will not work if you do a column of pots, if you had 8 pots in series the last one would have a max voltage of 1/8*vcc and a minimum of whatever the diode drop is.
Which most likely would be higher then the voltage on pot #8 could go.
 
Have you considered external ADC's? Like the MCP3208, there are tons of External ADC's on the market
 
I'm building a midi controller. Due to space constraints I can fit the teensy and 4 multiplexer on the board.

These large-number-of-input MIDI controller projects can be made easier or terribly frustrating by how easy or difficult your physical construction allows accessing the wires and parts. Almost all builds end up needing something fixed. If your wires plug and unplug easily with connectors you can access, and if the pots and buttons all produce 0 to 3.3V analog voltages you can easily check with a multimeter, troubleshooting is much easier. Likewise for a layout that is clear and easy to see which things go where.

Sometimes optimizing circuity with matrix scanning and compressing everything into a tight space makes troubleshooting very hard.
 
Well an external DAC would give me the same, 8 values and 8 values. I'm looking at creating a matrix of 64 pots. What I had in mind is something like the image below. Where C1 and C2 are the first 2 columns of the "sending" mux and W1 to W8 are the inputs of the receiving mux. The "sending" mux sends a value of 1023 to each column in sequence and the receiving mux reads the rows one by one for each column.

mux_pots.png
 
Sadly it wont work that way. If C1 is on and C2 is off you will have a path from R1 center to R9 Center and to ground again, then add C3-C8 to the mix and things get interesting. Which will screw up your reads. You would have to rapidly read all of the pots in the entire matrix then do a crap load of math to determine where everything is. And you would still have a lot of play in your readings leading to needing a lot of software filtering.

If your mux chips where capable of High Impedence output then it would be much easier. Your C and GND side do not have to be mux chips. If you replace them with a logic chip that can produce 3.3V/GND/High Z you could do it much easier. You basically have to limit the paths back to GND and 3.3V to only the column you want to read.
 
I keep saying use a Tri-state device but im actually having a hard time finding an 8 output device that can have its outputs individually set to High Z...
 
That circuit won't work. Matrix scanning this way works for pushbuttons because they fully disconnect when not pressed. The pots continue to have a resistive connection all the time. In terms of matrix scanning buttons, think of ALL the buttons always pressed. Will not work.
 
Status
Not open for further replies.
Back
Top