Go Down

Topic: Selecting a Multiplexor Chip(s) for Connecting Multiple Sensors (Read 3078 times) previous topic - next topic

lasithg

Hi Everyone, I'm rather new to Arduino, and I have few Arduino Uno Boards. I am setting up a project which has multiple Photodiode sensors (Approx 60 for the moment) and looking at how to gather the inputs via Arduino. By looking at Existing projects and reading online I feel one of the following products are good,although I cannot distinguish which is Best.

74HC4067N
DG406CJ+
SN74150
MAX7301
4051

Since the Arudino has 8 digital inputs, I think its possible to connect up Max 8 x 16 Inputs - Is this correct ?, and can I select beween inputs ICs.

I have read information on

This is the best idea that I have based on a previous project
http://fluidforms.eu/docs/MultiplexedArduinoWiringDiagram.pdf

and http://miscellanea.com/how-to-get-more-arduino-analog-inputs/

Thanking you in advance,
Lasith

CrossRoads

Uno has 6 analog/digital capable IO
Uno has 14 digital capable IO.

4 16:1 muxes (64 analog inputs),
4 pins to select which of the 16 inputs will be read at an analog input
4 pins to select from 1 of 4 muxes, (no external demux needed)
2 pins for serial I/O.

6 pins free still.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

lasithg

Thank You very much CrossRoads!. Is it possible to recommend a suitable 16:1 Mux Chip ? My Project needs the digital input only. (i.e I dont take the voltage difference from the photo transistors, just 1/0)

Also could you kindly explain the Serial I/O pins requirement you mentioned ? what purpose does it serve ? (If I read via USB)

CrossRoads

USB is still serial, just has a chip between the ATmega pins and the PC taking care of the conversion.

The analog I/O can be digital I/O as well.
Find the least expensive 16:1 mux you can in a package you can work with.
All should be able to switch fast enough while your code picks 1 of 16, then 1 of 4, then does the actual read of the input.
Course you could use Port reads and read 4 at a time, so then it would select 1 of 16, read 4 at once.
Read the datasheets, unless the change over time from address to data going thru the part is horrendous, like hundreds of nanoseconds, you'd be okay.

If 8:1 muxes are even less expensive, you might consider those:
8 inputs with 8:1 mux
3 outputs to select 1 of the 8 inputs to each mux
Put them all on the same port and read all 8 at one time.
11 pins, 9 free for other things!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Well, except the only port with all 8 pins has the 2 Serial lines, so do 2 reads, 4 on PortB and 4 on Port C.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

Quote
I am setting up a project which has multiple Photodiode sensors (Approx 60 for the moment)

and
Quote
My Project needs the digital input only.

Don't quite add up. A photodiode is not a digital light sensor and I would be surprised if you could get a digital signal from it.

A photo transistor on the other hand is much more likely to give you an output that you could treat as a digital one. The problem is that around the threshold you will get some instability. It is best if you can put the signal through an input with a bit of hysteresis first to clean it up. The 74LS14 has six such inputs on the inverters.

If you want to switch analogue values then see this project:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html

lasithg

Correction I used the wrong term..I WAS using phototransistors (Vishay Electronics BPW77NB) connected using Common Collector arrangement with 10K Resistors. I use a IR Laser (10mW) to beam to each sensor, so I dont think I'll have much issues near threshold. I do need some help in multiplexing the chips (I selected is 74HC4067N). Hoping to connect upto 64 Sensors (16 per IC). I know that I need to connect four selector inputs (S0-S3) in paralell to each IC, but I cant seem to figure out how to select each Chip - I think I need to use the Enable Pin on 4067. This is how I think it's gotta be done...

Use two selector pins from Arudino (S4,S5) and prepare a logic circuit in such a way that the Mux Chips (A,B,C,D) are operated one at a time : NOT(S4) AND NOT (S5) = A, NOT (S4) AND S5 = B, S4 AND NOT S5 = C, S4 AND S5 = D

And to construct that I think I need 1-2 ICs with a few NAND Gates....

Grumpy_Mike


Go Up