How to run 4 Mux Shield II's on one Arduino Mega

Hi All,

I am working on a project where I need to run 4 Mux Shield II’s using one Arduino Mega. The digital outputs of the shields need to be active low and only one output will ever need to be on at a time. I am controlling approximately 190 relays so I will need to use every output pin on the shields. I am wondering how you would connect and program this many Mux Shields with one Arduino Mega?

Thank You!

Mux_Shield_II_User_Guide.pdf (805 KB)

Well, of course the first thing that is obvious is that the "Mux Shield II" is the completely wrong approach for your purpose. But I suppose you pretty much realised that already.

What you need is quite a number of the TPIC6B595 modules, and the one you want is two of Crossroads' 96 Bit LED driver boards. Scroll down to about 70% of the way down the page.


Crossroads is a contributor here, his email is robert@crossroadsfencing.com.

Paul_B,

Why would the Mux Shield II not work? Additionally, this project is a prototype at my company and the purchasing process is much easier through larger vendors like Digi_Key or Mouser.

Then you are giving conflicting messages.

The Mux Shield II is not designed for this purpose. The board I cited is. If you are genuinely involved with a serious engineering enterprise then either you would have the expertise to implement the design or the common sense to contract Crossroads - who clearly does have that expertise - to do it for you.

Paul_B,

That is all fair. I am still wondering why the Mux Shield II board would not work? I will be using the SainSmart Relay Board linked below. This board uses optocouplers so very low current is required to activate a relay. The purpose of the Mux Shield is to expand the I/O capabilities of an Arduino. Can you please explain to me why this approach is not the correct one?

Ah! Entirely new information! Using relay boards, not just relays. Will re-assess the situation when time allows.

Hi mcguiremicky1,

Did you ever come up with a solution for your project. I have a situation somewhat similar. I need 192 analogue input pins to but don’t know how to go about expanding the Arduino Mega’s capabilities. My initial thoughts were to use 4 mux shields to read 192 voltage inputs.

The other option was to use two mega’s or uno’s (with two mux shields on each) and write to a file on a shared SD card.

geefja:
Hi mcguiremicky1,

Did you ever come up with a solution for your project. I have a situation somewhat similar. I need 192 analogue input pins to but don't know how to go about expanding the Arduino Mega's capabilities. My initial thoughts were to use 4 mux shields to read 192 voltage inputs.

The other option was to use two mega's or uno's (with two mux shields on each) and write to a file on a shared SD card.

You can use e.g. 12 times Analog/Digital MUX Breakout - CD74HC4067.

Hello Gaz.

Unfortunately, your problem is entirely different to the OP on this thread; you want a large number of analog inputs - or so you say, so the "mux shield" is of no particular use.

I am going to call the "XY Problem" here - tell us why you want to do this, and we may suggest the best approach.

Oops! I started typing this yesterday - 20 hours ago - and other things intervened. Someone else has answered! :grinning: Not sure if that helps or not.

Sorry for time wasting Paul.

In short, I'm designing a data logging system for a battery bank. The MEGA will take a cell voltage reading once every x hours. There are 192 battery cells in the bank and hence 192 analogue inputs. The MEGA obviously only has 16 which I need to expand on to take the additional inputs.

So, that's where the question of "How to run 4 Mux Shield II's on one Arduino Mega" came from.

The following has been taken from the arduino website:

"The Mux Shield II adds the capacity for up to 48 inputs or outputs on the Arduino and Arduino Mega. Using three Texas Instruments CD74HC4067 Analog Multiplexers, the Mux Shield makes it possible to have 48 analog/digital inputs or digital outputs in many combinations."

If you could suggest other possible solutions I'm open to exploring the idea.

Cheers.

Every few weeks a question like this comes up.

A 74HC4067 can not switch any voltage outside it's own supply/ground (5volt).
Leo..

Umm, yes, there is the problem. A common question relating monitoring batteries - and essentially the same one just recently but I haven't the time presently to find it.

I am going to presume these cells are in series rather than in parallel. If so, you have a whole world of hurt ahead in this question! :astonished:

Hi Leo.

Paul…

Don’t worry about the whole world of hurt. I have a working prototype that does exactly what I need it to do… but only for 15 analogue inputs (15 battery cells). Yes I’m aware of the limitations of the 5v that the boards can take, I’ve implemented a N-channel MOSFET activated potential divider to solve this. The battery cells are divided into separate series strings for monitoring purposes.

Again… all I need to do is increase my analogue inputs to 192 and I was wondering if stacking 4 Mux Shield II’s is the way forward?

Thanks

Gaz

What chemistry are you measuring. 15 LiPo cells is 63volt.
Not much resolution left when measuring the top cells.
Assuming your mosfet assisted voltage divider works (seen many ‘mistakes’ posted here).

Four shields stacked might be unreliable, and you have to cut/re-route many pins.
Sparkfun has a schematic on the page of the shield.
I think a Mega with several 74HC4067 breakout boards could be a better solution.

Tell us more.
Are you just measuring cells, or are they permanently connected in a stack.
If a stack, did you consider the ‘flying capacitor’ method (no unequal battery drain, no resolution loss).
Leo…

Leo,

The project idea:

Essentially, it's an attempt at automating a voltage check of a fixed UPS battery bank. The bank consists of 192 cells in a 6 string-series configuration (6 strings x 32 cells). A single string has a voltage of 73v and the batteries are lead-acid (2.31v at 20C).

I'm going off the MOSFET assisted divider idea mentioned in here. (about half way down the page).

I had a look at your suggestions with the breakout boards. Interesting, hadn't come across those before. I've bought one to have a play with.
Can't say I've come across the 'Flying capacitor' method, will look into this!

Thanks Leo!