OK New tank fully cycled and 1 wire digital I/O has been installed. ..
and tonight was the first fully automatic water cycle...I have an illuminated push button that starts the sequence....One press starts the cycle, however you can abort each phase if you press the button again during draining and it stops draining and starts the fill...press again and it will skip fill if you want. Although the drain and fill times are just based upon time I do have a float switch installed which will stop filling when the tank is full. Thus press the utton and it will do everything for you. The latest owfs had trouble reading my flow meter so it'll be a little while until I drain based upon metered water draining from the tank. At this stage approx 30 minutes drain time = 50 litres and it takes twice as long to fill. A good thing about this is the fact the tank temperature only drop .5 degrees from start to finish without heating the water
This is an early pic of the 1wire relay control board mounted into the tank when first installed.
this is the two solenoids Drain / Fill with the small pump..all is 24VDC
For those interested in reading code here is rev 1....
#!/bin/bash
d_max=30 # Max drain timeout minutes
f_max=60 # Max Fill timeout minutes
DO_1="/opt/owfs/bin/owwrite -s 3001 12.276B45000000/PIO.BYTE" # Power
DO_2="/opt/owfs/bin/owwrite -s 3001 12.267745000000/PIO.BYTE" # Fill
DO_3="/opt/owfs/bin/owwrite -s 3001 12.A37645000000/PIO.BYTE" # Drain
DO_4="/opt/owfs/bin/owwrite -s 3001 12.D37245000000/PIO.BYTE" #
## Calculate script loop time based upon sleep = 2 seconds ##
d_max=`expr $d_max \* 60 / 2`
f_max=`expr $f_max \* 60 / 2`
### Reset all Outputs to OFF ###
$DO_1 0
$DO_2 0
$DO_3 0
$DO_4 0
### Main Loop (Wait for button to be pressed) ###
while true ; do
DI_4=$(/opt/owfs/bin/owread -s 3001 uncached/05.FC152D000000/sensed) #Waiting for button press
if [ $DI_4 == 0 ]; then
f_time=0
d_time=0
$DO_1 1 # Enable 24VDC Power
sleep 1
$DO_3 1 # Turn on Drain
while (( d_time <= d_max ))
do
DI_4=$(/opt/owfs/bin/owread -s 3001 uncached/05.FC152D000000/sensed) # Check if button is pressed to abort
if [ $DI_4 == 0 ];
then
break
fi
((d_time +=1 ))
sleep 2
done
$DO_3 0 # Turn drain off
sleep 1
$DO_2 1 # Turn on fill
while (( f_time <= f_max ))
do
DI_4=$(/opt/owfs/bin/owread -s 3001 uncached/05.FC152D000000/sensed) # Check if button is pressed to abort
DI_3=$(/opt/owfs/bin/owread -s 3001 uncached/05.65142D000000/sensed) # Abort if level sensor is HIGH
if [ $DI_4 == 0 ] || [ $DI_3 == 1 ];
then
break
fi
((f_time +=1 ))
sleep 2
done
$DO_2 0 # Turn off fill
sleep 1
$DO_1 0 # Turn power off
fi
sleep 2
done