0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« on: May 09, 2011, 12:13:21 pm » |
hello I am very pleased to participate in this community! I recently developed an autonomous airship project. For this project I wish to receive information from 30 sensors and send commands to actuators 18. I have a Arduino mini pro 328 three multi / demultiplexers 74HC4067 buy from Sparkfun I learn about their installation and programming but I do not see: 1) how the physical cable to the card (ie if the 2 multiplexer and demultiplexer are on the same digital inputs?) 2) how to manage these two groups in programming
thank you to you! to help me in this project
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25455
Solder is electric glue
|
 |
« Reply #1 on: May 09, 2011, 12:39:01 pm » |
You cannot use a 74HC4067 to multiplex outputs. Well you can but only one output can be active at any one time and all the rest of the outputs will be high impedance. You are not the first to be caught out about this but there is a lot of wrong information about. To get multiple outputs you need to use either a shift register, port expander (like the 23S17), or something with a latch. For examples of these see my projects:- http://www.thebox.myzen.co.uk/Hardware/CNC_Conversion.html - uses port expander http://www.thebox.myzen.co.uk/Hardware/Transistor_Tester.html - uses latched multoplexer
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 242
Posts: 16479
Available for Design & Build services
|
 |
« Reply #2 on: May 09, 2011, 12:59:51 pm » |
To control these, you connect 4 arduino outputs to the S0-S1-S2-S3 pins, that will select which I/O path thru the device will be connected. Then you will have 4 more arduino outputs that will function as chip selects. You will write out S0-S3, then enable one device at a time.
Connect the common I/O pin (pin 1) for the 2 sensor selector parts together and connect to your digital input pin. The combination of S0-S3 and the 2 enable pins will select which of the 32 outputs will appear at your digital input pin.
Connect the common I/O pin for the 2 actuator selector parts together and connector to your digital output pin. The combination of S0-S3 and the 2 enable pins will select which of the 32 outputs will follow the actions of the digital output pin. Be aware that when no outputs are selected, the pins will not be Hi or Lo, you will need a pullup or pulldown resistor to put the actuator in its Off state.
If you want to use just 1 arduino pin to both read the sensors and drive the actuators, that is possible also. Connect the common I/O pin from all devices to the arduino. Your code will have to change the mode of the pin as you use it: for reading, pinMode(ioPin, INPUT); set S0-S3, enable one of the sensor input parts then read the signal
for writing, pinMode(ioPin, OUTPUT); set S0-S3, enable one of actuator output parts then write your actuator signal hi/lo, or lo/hi, as needed.
Does that make sense?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #3 on: May 09, 2011, 01:39:10 pm » |
great! thanks Grumpy_Mikegood projets...
CrossRoads yes that make sense to me! 2 solutions . can you make a drawing of them ? because y dont read english very well and y dont want too make mistake y dont need 32 actuator only 18 that s why y try to use only one demultiplexer
y try to use tree 74 hc 6067 bread bord
thanks a lot and have a caribeean sun
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 242
Posts: 16479
Available for Design & Build services
|
 |
« Reply #4 on: May 09, 2011, 07:12:59 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25455
Solder is electric glue
|
 |
« Reply #5 on: May 10, 2011, 04:06:25 am » |
This is the way to do it with latched outputs, so that once you have set an output to a level it stops at that level. Note this was drawn for an old computer, the reference to a "User Port" is what you would call an arduino pin. Note you can use any arduino pins but avoid pins 0 and 1 as they are for the serial comms.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #6 on: May 17, 2011, 07:41:13 am » |
hello my loggin name is angoo and y am talking with you in the forum about multiplexing/demultiplexing i m work on it but i dont know how to post image and code there is some information on the old forum but i dont find in this one thanks for help!
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25455
Solder is electric glue
|
 |
« Reply #7 on: May 17, 2011, 07:46:12 am » |
Just sent you a PM but for others. For code click the # icon above the reply box and paste the code between the brackets that pop up. For a picture click the Additional Operations... below the box and brows for your picture.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #8 on: May 17, 2011, 08:13:26 am » |
thank Grumpy for the explication the code downside it made by SHYWODD on the french forum /* S0 -> digital 7 S1 -> digital 8 S2 -> digital 9 S3 -> digital 10 Z -> analog 0
E -> 0v gnd -> 0v vcc -> 5v */
void setup(){ Serial.begin(9600); pinMode(7,OUPUT); pinMode(8,OUPUT); pinMode(9,OUPUT); pinMode(10,OUPUT); }
void loop(){ digitalWrite(7,LOW); digitalWrite(8,LOW); digitalWrite(9,LOW); digitalWrite(10,LOW); // Y0 Serial.println(analogRead(A0));
digitalWrite(7,HIGH); digitalWrite(8,LOW); digitalWrite(9,LOW); digitalWrite(10,LOW); // Y1 Serial.println(analogRead(A0));
digitalWrite(7,LOW); digitalWrite(8,HIGH); digitalWrite(9,LOW); digitalWrite(10,LOW); // Y2 Serial.println(analogRead(A0));
digitalWrite(7,HIGH); digitalWrite(8,HIGH); digitalWrite(9,LOW); digitalWrite(10,LOW); // Y3 Serial.println(analogRead(A0)); // etc ..... }

|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #9 on: May 17, 2011, 08:31:28 am » |
it s ok for the code part but not for picture ! what i do click on insert image it give me brows like that/img / /img/ (/ are for explication) clik on additional options there is attach i make "parcourir" and find my picture for example : C:\Users\tauliaut\Desktop\demux-demo.jpg i paste it on the /img]C:\Users\tauliaut\Desktop\demux-demo.jpg[/img/
i make prewiew it wrong!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 242
Posts: 16479
Available for Design & Build services
|
 |
« Reply #10 on: May 17, 2011, 09:47:56 pm » |
I don't believe you can use [ img ] link to your desktop [ /img ] for images on your computer. You need to use the Reply and Additional Options to attach pictures that will then upload as part of your post. This is used to link to images you have uploaded to the internet somewheree [ img ] http://www.link to flickr.com/your_picture.jpg [ /img], that knd of link.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25455
Solder is electric glue
|
 |
« Reply #11 on: May 18, 2011, 01:29:07 am » |
OK angoo I see your picture and your code now what is your question?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #12 on: May 18, 2011, 07:59:57 pm » |
i started from the CROSSROAD picture and make a one that s close off my mind 2 multiplexer and one demultiplexer do you thing it s good? thank a lot 
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6814
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #13 on: May 18, 2011, 09:17:07 pm » |
You do realize that you can't use 4067s for outputs unless you only need one output on at a time, it's been stated a couple of times but I'm not sure you've pick up on it. BTW, your picture links to your C drive, that ain't gonna work  ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25455
Solder is electric glue
|
 |
« Reply #14 on: May 19, 2011, 01:28:53 am » |
The select inputs to the first level of multiplexers are not going anywhere, so there will be no way to control them. Unless that is they are joined to the others. When drawing a schematic you should not have lines that cross and join together unless you put a dot on the intersection.
You also need supply decoupling as well.
|
|
|
|
« Last Edit: May 19, 2011, 01:30:58 am by Grumpy_Mike »
|
Logged
|
|
|
|
|
|