Need help to use multiple 74HC4051/4067 multplexer in one Arduino Uno

Hey people, newbie here. Just made myself to Arduino yesterday and it's been great :D. Just some little (maybe stupid) question to ask to you guys (and of course, to Arduino gods XD).

Okay, I'm actually planning to make a prototype of smart road for a competition next year (and maybe Google Science Fair) using only Arduino and my PC as it's main computer. Okay, plan made. I've drawn all the diagram (nope.. i'm not sharing it.. XD ) and had planned all things that I need. I've also bought an Arduino Uno board and currently using it and my uncle is kind enough to give me 2 4051 and 2 4067 multiplexer for me to use in my project for now. Sweet!

So, as far as I know, Arduino Uno has only 6 analog input, while for my project I need minimum 16 inputs. Problem solved by using those multiplexers. So right now I get 8 to 16 inputs. I'm using this tutorial

https://www.inkling.com/read/arduino-cookbook-michael-margolis-2nd/chapter-5/recipe-5-8

and this tutorial

http://bildr.org/2011/02/cd74hc4067-arduino/

for how to connect Arduino to 4051/4067 multiplexer. By following those tutorials, I managed to get my muxes connected to arduino and read up to 16 photoresistors without any problem. Sweet! :smiley:

Now, for the real stuff, I would like to use more 4051/4067 muxes to read up to 96 photoresistors. I could understand how to connect only one mux, but I don't know how to connect more.

So the question is, how do I connect more than one 74HC4051/74HC4067 multiplexer into an Arduino Uno? And how do I read inputs from them? Thank you very, very much.

In case if you guys would like to know my sketch, just refer to the links above. I copy and pasted them directly. :wink: And hehe, please be nice with me. I'm a complete noob in arduino. Thank you again.

I think you can do this with one 4067. You will need 6 analog pins and 4 digital pins. The 4 digital pins control the 4067 as a demultiplexer. Its input is connected to 5V and its outputs to 16 row lines. 6 column lines connect to the 6 analog pins. The columns also connect to ground via 6 suitable resistors, perhaps 10K. The photoresistors connect the column lines to the row lines in a 16x6 grid. To read all 96 photoresistors, use the 4 digital lines to select one row at a time in turn. For each row, read all 6 analog inputs in turn. Hope that makes sense.

Paul

You are however going to need 96 diodes in addition if you do that.

Paul__B:
You are however going to need 96 diodes in addition if you do that.

Whoops! Quite correct Paul. Thanks for that.

Thanks for the replies guys. Wow. 96 diode.. Heh, dont have enough budget for that. A little stupid question from me. Whats the function of the diode?

And btw, I'm planning to use 4051 muxer since thats the only my uncle could give me for low price. So what I got right now is a bag of muxers. So if anyone could help me with something like diagrams, that would be excellent. I've search before bout this problem but I couldn't understand how to get inputs from the other muxer. Thanks in advance.

DashHax:
Wow. 96 diode.. Heh, dont have enough budget for that.

You'd be kidding me, wouldn't you?

Where are you going to get your 96 photoresistors then?

DashHax:
A little stupid question from me. What's the function of the diode?

The diodes go with the LDRs in the matrix so that only when the anode is pulled to 5V by the multiplexer (whose "common" is +5V) will the LDR feed current into the corresponding 10K pull-down resistor (to ground) on the corresponding ADC input.

DashHax:
And btw, I'm planning to use 4051 muxer since thats the only my uncle could give me for low price. So what I got right now is a bag of muxers. So if anyone could help me with something like diagrams, that would be excellent. I've search before bout this problem but I couldn't understand how to get inputs from the other muxer. Thanks in advance.

Well, if you have 4051s, you use two of them to emulate the 4067. You either use an extra digital pin to select one or the other, or you use an inverter so that the enable on one is the opposite of the other.