Explanation of the program:
5 minutes
If the soil moisture level (M) is less than 500
One second
It is a manual operation. The water pump operates for 5 seconds
The microbit shows the soil moisture level
Here is the screenshot of the microbit program: