One Arduino Mega to control multiple tasks

Hello guys!
Your expert advice is highly appreciated!

I have a diesel water pump whish I use for my farm needs.
I would like to control it remotely, i.e:
start/stop the engine
control water pressure
control motor variables (temp, oil pressure, voltage, rpm, water level)

I would want this Arduino module to communicate via webserver so
I can operate/monitor the engine via my phone

I would want you to tell me if Arduino is capable of doing that many tasks reliably?

I'm aware how to do all of these tasks in separate, just not sure it's good idea to
put them all into one module.. For example, app measures shaft RPM using hall effect sensor and at the same time it should send data to the server via SIM800L module.. Also it should poll webserver by some interval to check for any command
to either stop engine or change motor RPM

What model of Arduino <-> webserver communication you could recommend for fast communication? Otherwise I see it that way: Arduino polls webserver for new commands by some interval and serves it if there is any..

Hope you get my idea :slight_smile:
Thanks in advance for all your opinions!

Hope you get my idea

If it's simple PID loop controls for the individual items, not much too worry about. Just make sure you control external equipment appropriately.

I would go a step further and setup a two step system. Unless both systems are in agreement, the system is shut off. Basic safety system redundancy.

how far away from the engine do you wish to control it - if within a few metres consider bluetooth
otherwise do you have WiFi in the area?
if so you could use an ESP32 for control the engine and communicate with a webserver or mobile phone

Hello d187

This is a nice task to get started.

An Arduino is able to handle all these tasks

Take a piece of paper, a pencil and design, based on the IPO model, a program structure plan before start coding.
Identify functions and their depencies. Now start with coding and testing, function by function.
At the end merge all tested function together to get the final sketch.
The basics for coding the project are to be found in the IDE as examples.

Have a nice day and enjoy coding in C++.

Nice idea, could you please describe it a bit more? What agreement between them did you mean? thank you

I would want to use GSM module (SIM800L) as no WiFi available in the range

Thank you :slight_smile:
Could you please recommend me some communication model between Arduino and WebServer?

For now I see it as the following: Arduino polls webserver (http get) for every 20 seconds and serves a command if there is any. Also it sends all motor status data on each check.

Not sure if I need it to communicate instantly.. Also I'm not sure I can have something like websockets and listen to it a background while monitoring engine state..

Please advise! Thanks

you can use a SIM800L to communicate with a webserver
try a web search for sim800l connect to webserver
check you have mobile coverage in the area

Hello d187

I´m sorry. I´m not a network specialist using webserver.

Viewed from above, each Arduino collects the motor data with a time stamp in place and sends it on request, however it comes about.

Have a nice day and enjoy coding in C++.

Sure. For example, an 'Engine run' signal. Two Mega's, each with an output to two individual relays. Each Mega will use D2 as their output to turn on one relay. The normally open contacts of both relays is wired in series to provide power to the engines fuel pump, ECU, whatever allows it to run. Both Mega's have to provide an output for the engine run circuit to complete. The D2 from Mega one, would go to D3 on the opposite Mega and vice versa. They should both run identical code (aside from IP addresses or other unique values) so if one detects the others run signal when it shouldn't, you set a fault and notify the web server.