Data acquisition and control using atmega2560 (Arduino mega 2560 for prototype)

Greetings,

I am working a project where I have to collect weights data from 16 load cells. Also I have to control 16 associated LEDs. There are also 16 solenoid valves which are to be operated depending on 16 input switches. All the data collection is supposed to be done via ethernet and using modbus protocol (28 devices/boards to be connected with the client via a network switch).

So far I have figured out to use ethernet library and "mudbus" library. Also I have done initial test of a single load cell using bodge's hx711 library.. and I am planning to use shift registers to operate valves and leds.
16x2 i.e. 32 pins for load cells
16 pins for switches
3 pins for leds (2 shift registers)
3 pins for valves ( 2 shift registers connecting to uln which drives relays/mosfets to operate solenoid valves)
5 pins for ethernet (w5100)

This is the pin count so far.

My question is will this system work like will all libraries come along without any internal clashes?
What shall be the pin assignment and any thing to keep in mind?
Also am I being ambitious or is this project is doable?

Any feedback will be much appreciated.

Thank you,
Have a great day

It looks like the only possible library clash would be between the HX17 library and wifi but I don't see any reason that they would conflict - try it.

I count 59 pins there - more than the mega has. Can you use another shift register for your switches?

wildbill:
It looks like the only possible library clash would be between the HX17 library and wifi but I don't see any reason that they would conflict - try it.

I count 59 pins there - more than the mega has. Can you use another shift register for your switches?

The reason I am concerned about clashes is because a lot of timed events will be occurring at a time.. I don't know how these libraries actually function.
I can shift the switches to shift registers, I look into it. But it's doable right?

wildbill:
It looks like the only possible library clash would be between the HX17 library and wifi but I don't see any reason that they would conflict - try it.

I count 59 pins there - more than the mega has. Can you use another shift register for your switches?

Can I use tx/rx1, tx/rx2, and tx/rx3 pins of Arduino mega 2560?

pvakharwala32:
Can I use tx/rx1, tx/rx2, and tx/rx3 pins of Arduino mega 2560?

Yes.

pvakharwala32:
The reason I am concerned about clashes is because a lot of timed events will be occurring at a time.

What do you mean by that? You will only be able to read the load cells one at a time and the wifi hardware will take care of some of the concurrency too.

wildbill:
What do you mean by that? You will only be able to read the load cells one at a time and the wifi hardware will take care of some of the concurrency too.

Thank you for pointing that out I didn't think about that. Well now my concern is different all along. How do I read all load cells at once?

pvakharwala32:
How do I read all load cells at once?

I don't think you can. It looks like reading from the scale is pretty fast though, so it'll be nearly at once. How simultaneous does it need to be?

wildbill:
I don't think you can. It looks like reading from the scale is pretty fast though, so it'll be nearly at once. How simultaneous does it need to be?

If not at once. scanning frequency of 10Hz is acceptable

I’d use millis or micros and measure how long it took to read the scale in your single load cell test.

wildbill:
I'd use millis or micros and measure how long it took to read the scale in your single load cell test.

Okay, I'll try that