Arduino code for water flow sensor yf-s401 (urgently)!

Hi everybody. Maybe someone has or can write a program for arduino so that the relay works when the water flow sensor turns and when it stops , then the relay opens ?

Relay (IRF 520 )
sensor (YF-S401)

READY TO BUY THE PROGRAM

Do you need Arduino or Ardupilot code for this?

If it is do an Arduino Code, I am pretty sure you can find it on Google…

Regarding ArduCopter, it provides support for both things. I think you can integrate them using LUA Scripts. Check these links and have fun:

https://ardupilot.org/copter/docs/common-fuel-sensors.html

https://ardupilot.org/copter/docs/common-relay.html

https://ardupilot.org/copter/docs/common-lua-scripts.html