tysseng
Joined: Apr 14, 2013 Posts: 13 Location: Norway
|
Posted: Sat May 03, 2014 4:52 am Post subject:
Analog multiplexing using discrete components - how? |
|
|
Hi!
I am working on a little project, trying to build a module-based midi controller. The basic concept is that one can connect small blocks containing single controls (buttons, potentiometers etc) into a larger grid. Have a look at it here: www.controllerblocks.com
However - how does one make a scanning matrix for analog input devices?
The grid is scanned/time multiplexed by a microcontroller. This is easy for buttons, but seems to be conciderably harder for analog input devices such as potentiometers.
Had the pots all been connected to a single board, one could use a multiplexer such as the 4051 to select column to read at the time (using one 4051 per row). However, since the modules in my case only contain a single controller, there is no natural place to put the 4051 without having to run separate data lines to each module.
Instead, I am hoping to approach this in a manner more similar to the key scanning, where each module is self contained. My problem is that I am not very good at ANALOG design, so to get this thing off the ground I am in desperate need of some help
My idea is this: On each module, use a transistor as a switch to connect/disconnect the potentiometer viper from the 'column' data lines. Let the 'row' data lines turn the switch on/off. This way, one can turn on all the columns of a row with a single row data line, much the same way as one would scan the key matrix. Here is my initial design:
While this works _somewhat_, it does not work as well as I hoped.
To start off with, there are a few limitations that have to be concidered when designing the circuit:
- The row control signal (logical 0 and 1 from the mcu) reach about 4.7V when the supply voltage is 4.9V. This may be a problem because it is lower than the maximum voltage one wants to pass through the transistor
- I am hoping to use the supply voltage (+5V) elsewhere in the final circuit, so it should preferrably not be any lower than this. (But this may be changed if we have no other option - it could possibly be reduced to 3.3V).
Here is what I am seeing when I'm testing the circuit:
- When testing a single block, with potentiometer R1 is at the far left, input to the 2N7000 is about 4.9V. When row0 is 4.7V (logical 1 from the mcu), the output on COL0 is about 3.6V. I assume that this is because the transistor is not 'fully on'?
- When connecting two blocks (Block 1 and 3) and time multiplexing them, I can read two values on COL0.
- However, setting row0 to ON and row1 to Off (0V), gives me a reading of about 3.1V on COL0. In other words, the block that is turned off (Block 3) still affects the result.
Now, I am sure these effects are just what to expect (if one knows what one is doing...).
Soooo, finally - do anyone have any input on how this can be done? I want to keep the parts count as low as possible, both for space reasons and to make the modules as cheap as possible for people to build.
Any help is greatly appreciated. PS: I am bringing my project to MidiHack (www.midihack.com) in two weeks time. If you are going or would like to help make controllerblocks a reality, feel free to contact me
--
Joakim |
|
tysseng
Joined: Apr 14, 2013 Posts: 13 Location: Norway
|
Posted: Sat May 03, 2014 1:47 pm Post subject:
|
|
|
I've googled a lot more and realized that the way the 2N7000 is mostly used is to connect any load at D to ground at the S, clearly not the way I've connected it in my schematics above.
I am still no wiser though. Really, what I want to achieve is a single cell / switch similar to that in a CD4066 (but with 0-5V supplies and the ability to pass close to 0 and close to 5V DC signals - is it at all possible)? |
|
richardc64
Joined: Jun 01, 2006 Posts: 679 Location: NYC
Audio files: 26
|
|