2 water pump (like swimming pool) part2

Α few days ago I had post that :

I want to make a code project for 2 water pump (like swimming pool) . everyone can help me how to write the code? i just start to programming.

I will put 2 water pump 230vac with 4 relay's 250vac with 3 water sensors and some leds to see when the the motor of water pump is on.

And the project is:

When the tank level reaches 60% of its capacity (Level 2), the pump 1 will operate, until the level down to 20% (Level 1).
The next time the water level will rise in level 2, will operate the pump 2, until the level down to level 1 (alternately operating the two pumps to have similar wear to the two motors).
If the tank level reaches 80% of its capacity (level 3), you pump 1 must be operated simultaneously and 2, until the level drops to level 1.

circuit: https://sofianidis.files.wordpress.com/2012/12/tk.jpg

thanks a lot

Have you written any code at all? If so please post between code tags.
How do your level switches work? Are they closed or open (HIGH or LOW) when the water is BELOW them?
How do your relays work? Are they energized with a HIGH or LOW signal?

I dont know how to programming to arduino, i just know the basics automation.

But i had find this code , but i dont know if working

const int WATER_SENSOR = 2; // the number of the switch pin
const int MANUAL_ON_BUTTON = 3; // button that will manually turn on pump if needed
const int PUMP = 0; // the number of the pump control pin
const int WATER_LEVEL_LOW_LED = 1; // the number of waterlevel low indicator
const int PUMP_AUTO_WORKING_TIME = 10000; // pump will work for this period of time if sensor showed Low water level
const int PUMP_MANUAL_WORKING_TIME = 100; // pump will work for this period of time if button was pressed
const int ALARM_LED = 4; // Led that will be turned on if something went wrong
const int ALARM_LED_DELAY = 600; //Delay for alarm blinking
short autoCyclesCounter = 0;

void setup() {
// initialize the pump control pin as an output:
pinMode(PUMP, OUTPUT);
// initialize the water level low led pin as an output
pinMode(WATER_LEVEL_LOW_LED, OUTPUT);
// initialize alarm led as output://
pinMode(ALARM_LED, OUTPUT);
// initialize the watersensor pin as an input:
pinMode(WATER_SENSOR, INPUT);
digitalWrite(WATER_SENSOR, HIGH); // pull-up resistor
// initialize manual ON button as an input:
pinMode(MANUAL_ON_BUTTON, INPUT);
digitalWrite(MANUAL_ON_BUTTON, HIGH); // pull-up resistor
}

void turnPumpOff(){
digitalWrite(PUMP, LOW);
}

void turnPumpOn(int timeToWork){
digitalWrite(PUMP, HIGH);
delay(timeToWork);
turnPumpOff();
}

void turnLowLevelIndicatorOn() {
digitalWrite(WATER_LEVEL_LOW_LED, HIGH);
}

void turnLowLevelIndicatorOff() {
digitalWrite(WATER_LEVEL_LOW_LED, LOW);
}

void turnAlarmLedOn() {
digitalWrite(ALARM_LED, HIGH);
}

void turnAlarmLedOff() {
digitalWrite(ALARM_LED, LOW);
}

void doAlarmState() {
while(true) {
turnAlarmLedOn();
delay(ALARM_LED_DELAY);
turnAlarmLedOff();
delay(ALARM_LED_DELAY);
}
}

boolean isManualyTurnedOn() {
boolean turnedOn = false;
int manualOnState = digitalRead(MANUAL_ON_BUTTON);

if (manualOnState == LOW) {
turnedOn = true;
}

return turnedOn;
}

boolean isWaterLevelLow() {
boolean levelLow = false;

for (int i = 0; i < 50; i++) {
int waterLevelState = digitalRead(WATER_SENSOR);

if (waterLevelState == LOW) {
levelLow = true;
turnLowLevelIndicatorOn();

delay(100);

} else {
levelLow = false;
turnLowLevelIndicatorOff();
break;
}
}

return levelLow;
}

void loop(){

if (isWaterLevelLow()) {
autoCyclesCounter++;

// We allow only 2 automated fillings in a row in other case show alarm state
if (autoCyclesCounter > 2) {
turnLowLevelIndicatorOff();
doAlarmState();
} else {
turnPumpOn(PUMP_AUTO_WORKING_TIME);
}

} else if (isManualyTurnedOn()) {
turnPumpOn(PUMP_MANUAL_WORKING_TIME);
} else {
autoCyclesCounter = 0;
turnPumpOff();
}
}