Multplexing, potentiometers and LEDs...

Basically, i'm building a monome clone using an arduino as its brains. I really want to add more than 5 pots to it. I hear this is possible with multiplexing. However after looking at the 4051 playground article it doesn't look like that willl suit me. I want to have 10 pots split into 2 groups and you activate each group with a 2 way switch [on-off-on].So when the switch is left, the left 5 pot are active and so on.
Is this possible? Or easy?

Another question, is it possible to have an LED assigned to each pot which gets brighter when the pots resistence decreases? I thought maybe attaching the led between the pots gnd and the arduino would work?

And one more question. Most people seem to be building 8x8 button arduinome but t cut costs and size i only want 48 buttons arraged in a 4x12 grid. Is this possible?

Sorry for the probably really obvious questions.
Thanks alot, Steve.

For the pots you could use 2 4051 IC's use the same 3 pins to address them both and just hook up 5 pots to each. Then you could use the two way switch to pull the enable pins of each of the 4051's low in the left and rigt positions.

I don't think it's a good idea to put the LED in the pot ground line, this will have an influence on the voltage the analog pin will see, and mess with the 0 - 1023 value range of the analog to digital conversion. One solution might be to hook up the LED to a PWM pin and set the PWM value based on the input from the pot. This is limited by the number of PWM pins on Arduino though.

Thanks alot. I don't think i'll bother with the leds, it was only to make it lok cool anyway.
Could you expand a little bit more on the 4051 idea...i get lost pretty quick. I thought that if i had 2 chips (5 pots on each) then i'd have to first select the chip and then select the pot. Therefore only 1 usable pot at any one time. I want 5 pots at a time...i'm probably just not getting something here...

Thanks again.

Well you do really only have one pot at a time, but it takes very little time to address the 4051 read the value of all 5 pots one at a time, so you would just make a routine that reads all 5, and call that routine very frequently and update 5 variables with the values, and just use the value you need.

so it will read only one at a time but i can write a script to tell it to scan them one by one very very quickly? sounds cool.
however...i think im giving up on that idea. i think i'll just go with 5 pots, therefore not needing the 4051.
How easy is it to get the values from the pots and converting them into midi cc values anyone have any clue? i did read a post somewhere involving a midi java library and the proMIDI processing plugin. But to be honest i don't know what that means :-/

Basically, i'm building a monome clone using an arduino as its brains.

Have you checked the work done by unsped, jordan Achenbaum, Owen Wallis, Julien Bayle, ... (and a little bit by myself)?
http://docs.monome.org/doku.php?id=tech:ports:arduino
http://melka.one.free.fr/blog/?cat=4

For the pots you could use 2 4051 IC's use the same 3 pins to address them both and just hook up 5 pots to each. Then you could use the two way switch to pull the enable pins of each of the 4051's low in the left and rigt positions.

Wouldn't it be easier to use only one 4051, then have 2 pots per input. Let's sat you have 2 groups, A and B. You wire A1 & B1 to input 1, A2 & B2 input 2, ...., then have 2 supply lines, one for each group, and just switch between the supply lines for the pots ? Maybe you can forget the 4051 in this case and directly wire the pots to the analog inputs.

I don't think it's a good idea to put the LED in the pot ground line, this will have an influence on the voltage the analog pin will see, and mess with the 0 - 1023 value range of the analog to digital conversion. One solution might be to hook up the LED to a PWM pin and set the PWM value based on the input from the pot. This is limited by the number of PWM pins on Arduino though.

The shield made by unsped for the Arduinome already uses 4 of the 6 the PWM pins of the arduino...

Maybe wiring the LED to the output line as dovemouse suggested could work with a little bit of mathematics on the code to compensate the 0-1023 range...
Or you could wire a TLC5940, but that might be overkill.

And one more question. Most people seem to be building 8x8 button arduinome but t cut costs and size i only want 48 buttons arraged in a 4x12 grid. Is this possible?

From the electronics side, yes, you can. But you'll have to find the right monome apps that can use this layout. Most of the apps are made for "square" monomes, so unless you want to wire objects in max/msp, I would not recommend this.

so it will read only one at a time but i can write a script to tell it to scan them one by one very very quickly? sounds cool.

In fact, there's no multitasking on a CPU like the ATmega168 used in the arduino (not totally correct but let's keep it simple). Everything is sequential, making one thing after the other. The only thing is that it happens so fast that you can't feel it as a slow human being. 16MHz = 16.000.000 operations per second... For exemple, on the real monome, all the lighting, button press reading and communication with the computer is made one step after the other, but once again, really fast. You can't figure it, even with a monome 256 (256 buttons & 256 leds).

How easy is it to get the values from the pots and converting them into midi cc values anyone have any clue? i did read a post somewhere involving a midi java library and the proMIDI processing plugin. But to be honest i don't know what that means

As you are building a monome clone, you might want to use the monome protocol so that you can use all the neat monome apps already existing.
http://docs.monome.org/doku.php?id=tech:protocol:40h
http://docs.monome.org/doku.php?id=tech:protocol:serial:series
With this protocol, you don't have to bother converting values into midiCC etc... as everything is done in Max/MSP (or chuck or another language), you just need to send a message formatted for the protocol with you value in it.
But if you don't want to use the monome apps and just need a neat controller, I would suggest writing a proxy in Processing, using the Serial library and proMIDI, yes.

http://www.texone.org/promidi/
A crappy exemple of data conversion between the Arduino and MIDICC messages.
http://melka.one.free.fr/blog/?p=34

Yay, lots of help. Thanks alot.
I'm planning to use the Arduinome Serial with the arduinome firmware. Is there anyway reading pot data with this setup?
I've used firmata with PureData and that worked fin outputting midi from analogue inputs.
I'd rather not be using Max/MSP because i quite like to play around and you can't do that with the free runtime. Anything for PD anywhere?
Which applications are you refering to when it comes to squares? What functionality would i be losing by going for a 4x12?

Thanks a lot for the help.