presumably you periodically check some sensor to determine if a particular valve needs to be open. you can count the number of valves that are open. If the count is > 0, turn/leave the pump on, if the count == 0, turn the pump off.
Most three-phase equipment is intended to rotate in one direction. Pumps are good examples. An impeller that rotates in the wrong direction will do no useful work and may damage the equipment if left in this condition. The direction of the motor rotation is related to the phase rotation of the power system. This rotation can be changed simply by switching the order of two of the three power conductors connected to the equipment. Motor protection relays provide reverse phase protection aid in the proper installation of the equipment and also detect and protect motors if a change occurs in the power system. This can occur in the replacement of a transformer or other wiring upstream of the motor control cabinet.
KareemWaheed:
i can know the relay state now from the digital pin,
If your program has set the state of the I/O pin why would you need to check the pin - just keep a record of the states of the pins as your program sets them.
OR, better still ...
Have your program write the relay state into an array and use the content of the array to set the I/O pins.
Any time you need to know if one of the relays is OFF you can just check the values in the array.
Robin2:
If your program has set the state of the I/O pin why would you need to check the pin - just keep a record of the states of the pins as your program sets them.
My thinking too, which is why I asked what controlled the relays in the first place.
Keep a counter, numberOfRelaysThatAreCurrentlyTurnedOn, initialise 0. Every time you turn one one, increment the counter; when you turn one off, decrement. Check the counter any time you like to see if at least one is on...