Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
09.02.2010 at 19:53:05
News: Server upgrade went fine, you are now at the new system


Pages: 1 2 
extenion for more knobs (Read 19102 times)
vedran
Guest




extenion for more knobs
31.01.2006 at 07:13:21
 
hi again!
is there any way to connect more than 5 analog inputs (more than 5 pots)?
and does it require some advanced knowledge in electronics?

vedran
Back to top
 
 
  IP Logged
David Cuartielles
YaBB Administrator
*****
Offline

hallo kompis

Posts: 840
MMX
Gender: male
Re: extenion for more knobs
Reply #1 - 31.01.2006 at 07:15:45
 
Hej,

you can actually connect 6!! (from 0 to 5 there are 6 different addressable analog imputs)

anyway, you can use a multiplexer like the 4051 chip that will allow you to connect 8 inputs to one single one.

/David
Back to top
 
 
View Profile | WWW   IP Logged
vedran
Guest




Re: extenion for more knobs
Reply #2 - 31.01.2006 at 07:46:52
 
thats great!
i have found this:
http://en.wikipedia.org/wiki/Multiplexer
so i have an idea of multiplexer Smiley
is it easy to integrate with normal version, on the board?
and what about programing side, will i see this new pots in software or i'll have to upgrade chip?
uhhh... so many quetions...

cheers,
vedran
Back to top
 
 
  IP Logged
nick
Full Member
***
Offline



Posts: 108
london
Gender: male
Re: extenion for more knobs
Reply #3 - 31.01.2006 at 15:32:20
 
the extra inputs will not 'appear' to the arduino - you will have to write the code (or find code others have written) to work with the chip.

You will need to use some of the digital output pins to control the multiplexer so that you know which analogue input is being multiplexed onto the pin, and then read it to the relevent variable.

HTH

Nick
Back to top
 
 
View Profile   IP Logged
vedran
Guest




Re: extenion for more knobs
Reply #4 - 31.01.2006 at 19:46:35
 
hi!
thnx for repy!
i understand the software side (i'm not a programer but i have a lot of experiance with action script), so i'll just have to write the code to work with this setup, that's nice.
did someone do that kind of setup and have some nice documentation? i'll apriciate it a lot!

vedran
Back to top
 
 
  IP Logged
Massimo_Banzi
YaBB Administrator
*****
Offline

I find plain
exciting

Posts: 156
Italy
Gender: male
Re: extenion for more knobs
Reply #5 - 01.02.2006 at 02:55:20
 
hello vedran

let's take the mc14067 (http://www.onsemi.com/pub/Collateral/MC14067B-D.PDF) as an example
this is an 16 channel analogue multiplexer. i've use this a lot of times.


connect pin 24 to 5V and 12 to GND. then connect a 10K resistor from 5V to pin 15.
this is powering the chip and enable the switch that lets you pick which input to read.

now connect pin 1 to analogue input 0.

now we need to tell the chip which channel we want to read. this is done by connecting 4 digital outputs to pins 10,11,14,13. By using a combination of digitalWrite commands you can set the input channel to read.

all the other 16 pins are inputs where you will connect up to 16 pots (or any analogue sensor)

the code will look like this:

for (i=0; i <16; i++) {
 write i in binary on 4 output pins
 this selectes the input

 val = analogRead(0)
 store val somewhere or send it on
 the serial port

}

now the cool part is that if you hook up one of these to each analogue input you can have 96!!!! analogue inputs

is this enough ?Smiley)

massimo

Back to top
 
 
View Profile | WWW   IP Logged
vedran
Guest




Re: extenion for more knobs
Reply #6 - 01.02.2006 at 23:41:11
 
thnx for explanation!
i think it's enough Smiley
arduino rules!
now i only have to wait for the board....

vedran
Back to top
 
 
  IP Logged
woo_oow
YaBB Newbies
*
Offline

shrz

Posts: 37

Re: extenion for more knobs
Reply #7 - 24.08.2006 at 22:03:45
 
hello,
im trying to use the multiplexer below.
my question is how to calculate binary numbers out of decimal chiffres.
greetings
woo

Massimo Banzi wrote on 01.02.2006 at 02:55:20:
hello vedran

let's take the mc14067 (http://www.onsemi.com/pub/Collateral/MC14067B-D.PDF) as an example
this is an 16 channel analogue multiplexer. i've use this a lot of times.

the code will look like this:

for (i=0; i <16; i++) {
 write i in binary on 4 output pins
 this selectes the input

 val = analogRead(0)
 store val somewhere or send it on
 the serial port

}




Back to top
 
 
View Profile   IP Logged
mellis
YaBB Administrator
*****
Offline



Posts: 3006
Cambridge, MA
Re: extenion for more knobs
Reply #8 - 27.08.2006 at 01:10:12
 
This tutorial on bit masks might help: http://www.arduino.cc/en/Tutorial/BitMask
Back to top
 
 
View Profile | WWW   IP Logged
woo_oow
YaBB Newbies
*
Offline

shrz

Posts: 37

Re: extenion for more knobs
Reply #9 - 27.08.2006 at 11:26:52
 
thanks,
this will help!
i just worked with a FOR loop but i think this works better

woo
Back to top
 
 
View Profile   IP Logged
spanky
YaBB Newbies
*
Offline

Arduino rocks

Posts: 2

Re: extenion for more knobs re to message #5
Reply #10 - 24.03.2007 at 20:23:51
 
so to get 16 digital outputs with the MC14067 (i'm controlling lots of motors, separate power/logic), rather than digital inputs. i assume we're connect to pins 10,11,13,14 on the multiplexer but to where on the arduino?

i would guess one has to connect to pins 9, 10 or 11 on the arduino?  (though it'd be so much nicer for organizing to connect to 4 with 12 outpus, than 3 with all 16, to get 48, which may be the max.)

thanks a bunch
Back to top
 
« Last Edit: 25.03.2007 at 19:24:01 by spanky »  
View Profile   IP Logged
macario
YaBB Newbies
*
Offline

Arduino rocks

Posts: 4

Re: extenion for more knobs
Reply #11 - 07.06.2007 at 10:04:28
 

Thanks for the info, I have a little doubt: how does one tells the pin 1 from the 24 of the multiplexer?  Roll Eyes

Back to top
 
 
View Profile   IP Logged
spanky
YaBB Newbies
*
Offline

Arduino rocks

Posts: 2

Re: extenion for more knobs
Reply #12 - 07.06.2007 at 18:06:27
 
multiplexing is putting together analog signals into one channel, and de-multiplexing is divvying an analog signal to multiple channels.  most of the info on this page (and in searching the web all over) is about multiplexing.  the components that de-multiplex are primarily also multiplexers (set to a different mode), so folks use the one word to refer to both things, but rarely talk about anything but the one word.  what a mess.  however, this may be what you're looking at?  somebody please correct me where i'm wrong, but this is what i've culled ...

one thing is that addressable latches, work almost identically but have the added ability to remember the values.  to see why that's even a cool thing though, download any data sheet on multiplexers.  they all wok pretty much the same.  and the pins for addressable latches are also pretty much the same.

an example, a multiplexer/latch that allows for 8 output/channels (which i found pretty common and cheap) has 16 pins, and needs 3 digital + 1 analog from the microconroller or arduino.  (note the arduino only can run a max of 3 of the 8 channel latches, before running out of outputs).  8 pins (in ther middle, for no apparent reason) send out PMW or analog like you'd expect.  1 pin (why the 4th one?  who knows.) gets one analog value.  3 more pins determine, in binary with digital on/offs, which output channel gets that value.

here's a diagram for turning (encoded) servos to 1 of five middle positions using a latch.  often the mode values will also decide if multiplexers act like de-multiplexers.  so look at the data sheets.



but for this application, there are "motor drivers" that (from what i've heard) will work a lot better.  they generally plug in to serial ports and also power/ground the motors (i've seen ones for servos and steppers).  these are generally much more expensive ($60-$200 rather than .50-4 bucks) but often control 20 motors.  (which might avoid some spaghetti wiring with the arduino)  most servo "brains" can also just be used with LEDS, solenoids, etc.  there aren't many options for actuators, so this may be a better way to go for you?  good luck.
Back to top
 
 
View Profile   IP Logged
macario
YaBB Newbies
*
Offline

Arduino rocks

Posts: 4

Re: extenion for more knobs
Reply #13 - 08.06.2007 at 07:08:40
 
Thing with arduino is that lets a lot of people with no previous involvement with electrons play with wires but it can get very frustrating when you don't know what you are doing as is my case. So please can anyone post some pictures of how to connect the 14067B to the arduino? newbies will apreciate that.

Here's how i connected it, for some reason is not working:



I just have red, black and white wire and light is not good so it may not be clear, tomorrow I will take another one with better lighting.

As Massimo posted I've connected the pin 24 of the 14067B to 5V, a green 10K resistor from 5V to pin 15 (what's the difrence between brown and green resistors?) and digital pins 2 to 5 of my arduino to pins 10, 11, 13, 14 of the 14067.

Is that configuration right?

heres my code:

Code:
byte mask = 1;
byte serialOut;
byte i;
int val;

void setup()
{
  
  //Declare the pins used for controlling the multiplexer as inputs
  for (i = 2; i < 6; i++){
    pinMode(i, OUTPUT);  
    digitalWrite(i, LOW);
  }
  
  Serial.begin(9600);
  Serial.print("Ready to go");
}

void loop()
{
  delay(100);
  for (i = 0; i < 16; i++) {
    
    val = readAnalogM(0, i);
    if (i == 0 ) Serial.println(val);
  }  
}


int readAnalogM( int analogIn, int channel ){
    /*
      analogIn - board's analog pin conected to the output of a multiplexer
      channel - multiplexer channel being read, 0 to 15
    */
    
    //We are using the pins 2 to 5 labeled serialOut to comunicate with the multiplexer
    serialOut = 2;
    
    //Get binary form of the channel and send it through serialOuts
    for ( mask = 1; mask < 16 ; mask <<= 1 ){
    
       if ( mask & channel ) {
         digitalWrite( serialOut++, HIGH );
       } else {
         digitalWrite( serialOut++, LOW );
       }
    }
    return analogRead( analogIn );
}

 




If i understood right i have to send the binary number for the multiplexer port i want to read to the multiplexer pins labeled A, B, C and D but that makes me wonder:

how does the multiplexer tells when I finish sending a port number and started sending another? does that has to do with the INHIBIT pin? the resistor from 5V to pin 13 has to be a brown one? what am I doing wrong?

Hope someone can help me to work it out..

thanks
Back to top
 
 
View Profile   IP Logged
macario
YaBB Newbies
*
Offline

Arduino rocks

Posts: 4

Re: extenion for more knobs
Reply #14 - 08.06.2007 at 07:19:11
 

well now it's working, I've just disconected the inhibit pin (number 13) from the resistor that went to 5V, but unless I am reading port 0 it behaves erratically. shall I leave it disconnected?
Back to top
 
 
View Profile   IP Logged
Pages: 1 2