Hello, I would like to detect any water flow rate through my water line that happens for extended periods using a flow meter/sensor, and have Arduino shut down my water pump if a certain time limit is reached. I have these simple logic steps but I don't quite know how to program it. I'm hoping it's fairly easy and that someone could possibly help with the code. Thank you in advance.
Command Loop: IF flow detected THEN start timer IF flow stops THEN stop and reset timer
Sub-Command: IF timer reaches 500 seconds THEN send signal to pump relay to shut off pump AND THEN end/pause/stop/sleep program