here Ivebeen trying to control 3 different capacity tanks.Initilally code was working perfectly when applied for only one tank.Now I have tried to extend same code for 3 tanks.
following logic want to introduced in code:
Note: First of All system makes sure Sump water is available then following steps to impliment:
If any 0f tank Low Level reaches that time all 3 valves should Open/On and Motor start to fill liquid.
if any tank level reaches High level then dedicated tank valve should be closed/off & motor keeps running.
When all 3 tanks High Level reaches then all 3 valves should be closed/off & motor should be Turned Off simuntaneously.
I am new to Arduino, I would really appreciate if any guidance can be provided that how I can implement the project.
When a tank is full, and another gets low, you turn on the motor and open all the valves.
Immediately the you will close the valve(s) on the tank(s) that were already full. That did not trigger the motor.
Your tanks, valves and motors, so OK, I don't care. It just seems stupid. Also, I wonder how much over High level you are willing to let an already full tank get, bit by bit, as its valve is briefly opened a few times because another tank needs filling.
May be I am wrong ,intension is to not to wait till low level reaches,if motor is running for others tank why not utilise this opporunity to refill tank to its High level so that water will available all time.
If I understand right you want to fill up the tanks anytime a tank is below maximum.
Then this logic is enough
if any of the three sensors
highLevel1
highLevel2
highLevel3
reports water level is not at maximum
and sump-levelsensor reports "there is water to fill in"
then ==> switch on pump
if highLevel1 indicates tank is completely full close valve1
if highLevel2 indicates tank is completely full close valve2
if highLevel3 indicates tank is completely full close valve3
if all three sensors
highLevel1
highLevel2
highLevel3
report "tank is full"
switch off pump.
if sump-sensor reports "no water to pump" switch off pump
You have created some kind of code that seems to be really complicated and hard to maintain
because almost everything is hidden behind numbers.
What is the purpose of the low-level sensors?
based on my description above you don't need them.
If the pump shall only start if one of the three low-level-sensors reports
"tank at lowest level"
you could use a boolean flag to switch on the pump only if this flag-variable is set to true
Thanks for your time,exactly this is my project requirement.Switch off Pump as well as all valves.
As far as Low Level concern,it will work as normal case.Like if Anytank water level goes bellow Low Level.All Valve will be Opened & Motor will start filling water into all tanks.
Reasonbeing my project require Minimum switching opearation of motor.Let me clarify further.
Suppose we have 3 tanks
a) Tank1 is at Full Level (and motor is running to fill other tanks,No chance to open Tank1 Valve1 as HIGH Level Condition)
b) Tank2 level is bellow Full Level & above Low Level (and motor is running to fill tank1 as Tank2 is at Full Level,Grab this opportunity to Re-fill tank 2 to again its High Level by just opening its Valve2)
c) Whenever all 3 High Level touched,All valve & motor will be turned off.
d) repeat Cycle, if any Tank gets Low Level again then all 3 Valve should Open & motor to start filiing dedicated tank & Re-filling other Tanks if needs to be.