Need help with timer

I want to program my ardiuno for my water sensor project but there is an issue with the delay timer

The conditions are

  1. First a sensor has to detect the water.
  2. After sensing the water I need a buzzer for 5 minutes till that I don't want to turn on my motor.
  3. After 5 minutes I want to switch on the motor and turn off the buzzer.
  4. If the water stops I want to stop everything.

I tried using delay and millis functions but I couldn't get the desired output please help me out guys

You need to post your sketch , so prople can look for problems.
Don’t forget the code tags !

Mavericksiva:
I tried using delay and millis functions but I couldn't get the desired output please help me out guys

Then there is probably something wrong with the code you didn't post.

The internet (including this forum) is full of Arduino timing examples. Reading your post, it seems like your project is not fundamentally different from what you can find online, so it's probably a good idea to do some more research first.

Pieter