Multiple multiplexers connected to 1 analog input

Hi everybody,

I have a project where I will need to read out many (so so many) analog inputs (different resistor values). After googling around I learned that multiplexers will really help me out here. I have an idea (and a schematic sketch attached) but I seeing how I’m fairly new to this business I was hoping some of you more experienced folk can take a look and maybe detect foreseeable problems.

The idea:

I use and Arduino mega in combination with about 48 multiplexers (HC4067). All the multiplexers are connected to 1 analog input. 4 Digital outputs are used to control all the input selectors on the multiplexers. 48 Digital outputs are connected to the individual enable ports on the multiplexers to select which multiplexer to read from.

I have a gut feeling this might not work so easily as I hope… Any tips or feedback is appreciated!

Greetings.

I use and Arduino mega in combination with about 48 multiplexers (HC4067). All the multiplexers are connected to 1 analog input. 4 Digital outputs are used to control all the input selectors on the multiplexers. 48 Digital outputs are connected to the individual enable ports on the multiplexers to select which multiplexer to read from.

So you have to read from over 750 analog signals?

The overall setup probably works but you have to keep a few things in mind:

  • The multiplexers have an internal resistance
  • Transporting analog signals over longer distances don't work reliably
  • You might have to take the cabling systems capacitance into account
  • Reading all signals need quite some time

I have a project where I will need to read out many (so so many) analog inputs

48 chips x 16 = 768 analog inputs? Sounds like a nightmare! :smiley: I hope you are making a custom PC board.

connected to 1 analog input

Why are you only using one input? The MEGA has 16 analog inputs. That could greatly simplify your hardware-addressing. (Internally, the chip has only one multiplexed ADC.)

48 Digital outputs are connected to the individual enable ports on the multiplexers to select which multiplexer to read from

If you're using a MEGA you can do that but typically you'd use an [u]address decoder[/u]. With 10-bits you can "count to" 1023 so with 10 digital control lines ("address lines") you could address 1024 analog inputs.

If I've done my math right you could address 4 Trillion analog inputs with 48 address lines! And, if my math is wrong, it's still a ship-load!

P.S.
If you haven't done so already, try 2 multiplexers as proof-of-concept.

With the analog multiplex chips you may want to add some pull down resistors to ensure the control lines don't float. You probably find out if what you want to do will work by simply testing with a couple HC4067 chips.

CodyMoltar:
…I’m fairly new to this business…

You will find that up-scaling (building it) is not as easy as you might think.
Wire/trace length (capacitance/cross-talk), fan-out, etc.

I would use the internal muxer of the Mega, say 12 analogue inputs, and four blocks of twelve 74HC4067 chips.
All enable pins of a block of 12 to one pin of the Mega, and the 12 outputs to 12 analogue inputs.
The other three blocks of 12x4067 to a different Mega pin, and all 12 outputs to the same 12 analogue inputs.
All four address pins of the 4067s can in theory connect to four Mega pins (fan-out problems?).

Keep the voltage dividers on the inputs of the switches.
No resistors on the Mega’s analogue pins, so 4067 switch resistance becomes irrelevant (yes, 768 pull up/down resistors).
Each if the 768 inputs could also require a 100n cap to ground, to minimise cross-talk.
Leo…

Hi everyone, and thanks for your responses!

To specify the project: the analog inputs are used to measure if and which puzzle piece is placed. This means every spot for a piece has 3 states (no piece, piece A or piece B). This is why the accuracy of the reading is not super important. I just have to know if it has a high, medium or low resistance.

I will try out a small proof of concept with a couple of multiplexers!

So, now you reveal the details, we can deal with the XY Problem

These piece positions would be wired as a matrix, each position corresponding to one row and one column.

If we may assume that the piece cannot be placed so that the two terminals are swapped, then a green LED is the appropriate part to use on the piece. Piece “A” has the LED one way round, piece “B” has the LED the other way round.

You use four of these PCF8575 modules connected to your Arduino Nano to create a 16 by 16 matrix with 1024 positions.

This allows you to sense each position by alternately pulling a row LOW and determining which columns are pulled low (you can read the whole column at once) and alternatively pulling a column LOW and determining which rows are pulled low.

The green LEDs are not intended to be seen. :grinning:

CodyMoltar:
To specify the project: the analog inputs are used to measure if and which puzzle piece is placed. This means every spot for a piece has 3 states (no piece, piece A or piece B).

Right. That's a very different problem than you said first.

Is it possible to have three contact points per piece? Then you can have piece A make one connection, piece B another, and no piece of course no connection. A bit more of a matrix but that doesn't matter for an Arduino. Still needs a diode for every input, as it's really just a button matrix.

Paul__B:
If we may assume that the piece cannot be placed so that the two terminals are swapped, then a green LED is the appropriate part to use on the piece. Piece "A" has the LED one way round, piece "B" has the LED the other way round.

Why green LED specifically? Instead of a regular diode?

I think I see how your idea would work; but it does seem to rely on using specifically the PCF8575 chips, which can only really sink current, so a short through the diodes or LEDs (as they can be placed either direction) between the one input set LOW (driven) and a column set HIGH (pull-up resistor) wont do any damage.

I just don't see the need for LEDs, rather than simply diodes.

wvmarle:
Why green LED specifically? Instead of a regular diode?

I knew someone would ask that!

Because the diodes can go either way round. Solves the phantom problem. :sunglasses:

How would an LED solve the phantom problem where a diode can't? At least a regular diode is more robust with reverse voltages...