electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software
Analog multiplexing using discrete components - how?
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
tysseng



Joined: Apr 14, 2013
Posts: 13
Location: Norway

PostPosted: Sat May 03, 2014 4:52 am    Post subject: Analog multiplexing using discrete components - how? Reply with quote  Mark this post and the followings unread

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 Very Happy


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:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

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 Very Happy
--
Joakim
Back to top
View user's profile Send private message
tysseng



Joined: Apr 14, 2013
Posts: 13
Location: Norway

PostPosted: Sat May 03, 2014 1:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

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)?
Back to top
View user's profile Send private message
richardc64



Joined: Jun 01, 2006
Posts: 679
Location: NYC
Audio files: 26

PostPosted: Tue May 06, 2014 3:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

Part of the problem appears to be the protection diode built into the 2N7000. When row 1 is on, in your example, all the on transistors have a path to the transistors above and below, thru the diodes, and, depending on the pot position, to ground.

Why not just use CD4066s?


matrix_snafu.gif
 Description:
...or find n fets without protection
 Filesize:  14.08 KB
 Viewed:  90 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

matrix_snafu.gif



_________________
Revenge is a dish best served with a fork... to the eye
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use