Its time for all this monitoring to meet my new tank....I have setup a journal in the amazon garden, thread = "Vision Journal"....showing the installation..
rob
Printable View
Its time for all this monitoring to meet my new tank....I have setup a journal in the amazon garden, thread = "Vision Journal"....showing the installation..
rob
For the last year I resisted running anything else than a small NSLU2 device as my Aquarium computing platform. I had been admiring those VIA EPIA all in one computers and had been looking around for a cheap one.
Well Yesterday I ended up purchasing a barebones system...This is so that I can get a higher power web server that I can let people into and also setup a web site that the kids can develop. My web server at the moment has really been for local viewing and my dial in purposes.
So cash up, NOT! I have purchased one of these that I will be creating a small home server...
http://www.i-tech.com.au/products/11..._AMD_S754.aspx
I already have 512M of memory and HD in the cupboard so all I need is an old AMD CPU. I have one on order AMD 64 2800+ for $45.00
So all up for ~250.00 I'll get a small footprint linux server with a decent amount of power to run Apache, Samba etc etc. Hopefully I'll get all the parts this week although do not know what Linux distribution to load as I was hoping to use it as a headless server and log into it with my windows machine and a secure shell as the interface. The system only has a mini-pci port on it so I might throw in a mini-pci intel wifi card which are on ebay at the moment for $12.00
Update of Web Interface Progress
Have not done much over the last 2 months however a huge potential has come my way with help from the guy's at owfs (Christian). I stumbled across imagemagick a command line image manipulation tool which is just soo powerful. I have amended my collection script so that it updates real time variables onto my web header, I knew I put that image (which is just above the trends) there for something !. Thus I get trends and the last values taken from the aquarium...which is polled every 90 seconds.
http://img.photobucket.com/albums/v3.../newupdate.jpg
Next task is to get some gauges working..Imagemagick enables you to not only combine multiple images, ie scale and pointer it also allows you to rotate one of them..ie rotate the pointer before merging onto gauge scale.
This is my full script that does the data collection now ....as I do not think I have posted this before in full
#!/bin/bash
OWWRITE="/opt/bin/owwrite -s 3002"
OWREAD="/opt/bin/owread -s 3002"
AWK="/opt/bin/awk"
hwclock -s
echo "`date` -- 1Wire Data Collection Script Started -- " >>/public/nohup.out
while true
do
### Force Simulataneous 1wire conversion ###
$OWWRITE simultaneous/voltage 1
$OWWRITE simultaneous/temperature 1
### Read 1wire data and convert into engineering units #ph was 2.6667##
PH=$($OWREAD 20.B71F05000000/volt.A | $AWK '{printf "%4.2f\n",((($0-1)/1.6)+5.5)}')
US=$($OWREAD 20.B71F05000000/volt.B | $AWK '{printf "%3.0f\n",($0*100)}')
ORP=$($OWREAD 20.B71F05000000/volt.D | $AWK '{printf "%3.0f\n",($0*100)}')
TempAqua=$($OWREAD 20.B71F05000000/volt.C | $AWK '{printf "%3.1f\n",((($0-1)*5)+20)}')
LITRES=$($OWREAD 20.952A05000000/volt.D | $AWK '{printf "%3.1f\n",(($0-2.900)*60)}')
TempOut=$($OWREAD 28.11BF97000000/temperature | $AWK '{printf "%3.1f\n",($0)}')
TempAmb=$($OWREAD 28.D70598000000/temperature | $AWK '{printf "%3.1f\n",($0)}')
TempRes=$($OWREAD 28.A6EE97000000/temperature | $AWK '{printf "%3.1f\n",($0)}')
Accum_flow=$($OWREAD 1D.EBEF0900000034/counters.A | $AWK '{printf "%g\n",($0/4100)}')
### Out of Range Error trap -Do not log data ###
PHtest=`echo $PH |cut -f1 -d'.'`
if [ -z $PHtest ] || [ $PHtest -gt 7 ]; then
echo "`date` PH reading error $PH" >>/public/nohup.out
PH="U"
fi
ORPtest=`echo $ORP |cut -f1 -d'.'`
if [ -z $ORPtest ] || [ $ORPtest -gt 600 ]; then
echo "`date` ORP reading error $ORP" >>/public/nohup.out
ORP="U"
fi
UStest=`echo $US |cut -f1 -d'.'`
if [ -z $UStest ] || [ $UStest -gt 500 ]; then
echo "`date` Conductivity reading error $US" >>/public/nohup.out
US="U"
fi
TEMPtest=`echo $TempAqua |cut -f1 -d'.'`
if [ -z $TEMPtest ] || [ $TEMPtest -gt 33 ] ; then
echo "`date` Aquarium Temp error $TempAqua" >>/public/nohup.out
TempAqua="U"
fi
### Calculations based upon Data ###
C12=$(/opt/bin/awk -v PH="$PH" '{printf "%3.1f\n",((3*$0)*(10^(7-PH)))}' /public/kh_value.txt)
Todayflow=$(/opt/bin/awk -v AF="$Accum_flow" '{printf "%g\n",(AF-$0)}' /public/lastflow.txt)
Weekflow=$(/opt/bin/awk -v AF="$Accum_flow" '{printf "%g\n",(AF-$0)}' /public/weekflow.txt)
### Update Realtime Web Header Image (Uses Imagemagick convert) ###
Update=$(/bin/date +%H:%M:%S)
convert /website/images/phheader.png \
-pointsize 14 -fill white -undercolor '#00000080' \
-gravity West \
-draw "text 414,2 '$PH'" \
-draw "text 508,2 '$TempAqua'" \
-draw "text 615,2 '$ORP'" \
-draw "text 712,2 '$US'" \
-draw "text 810,2 '$C12'" \
-pointsize 10 -fill white -undercolor '#00000080' \
-draw "text 962,2 '$Update'" \
/website/phheader.png
### Push Data into NEW Trend Files ###
rrdtool update /public/rrd/aqua_ph.rrd N:$PH
rrdtool update /public/rrd/aqua_orp.rrd N:$ORP
rrdtool update /public/rrd/aqua_temp.rrd N:$TempAqua:$TempRes
rrdtool update /public/rrd/aqua_co2.rrd N:$C12
rrdtool update /public/rrd/aqua_cond.rrd N:$US
rrdtool update /public/rrd/aqua_level.rrd N:$LITRES
rrdtool update /public/rrd/weather_temp.rrd N:$TempAmb:$TempOut
rrdtool update /public/rrd/aqua_waterchange.rrd N:$Todayflow:$Weekflow
sleep 90
done
OK New tank fully cycled and 1 wire digital I/O has been installed. You can see the installation in the garden forum...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.
http://img.photobucket.com/albums/v3...ionrelay-1.jpg
http://img.photobucket.com/albums/v3...y/IMG_0022.jpg
this is the two solenoids Drain / Fill with the small pump..all is 24VDC
http://img.photobucket.com/albums/v3...y/IMG_0025.jpg
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
Well it been a couple of months and now the Web monitoring is using a pc based platform, instead of an embedded platform...thus if you would like to take a look head to www.rjconway.homeip.net
I handle system messages and water change reports alot better now with this interface.
The system currently provides monitoring for:
1 x ph
1 x conductivity
1 x orp
3 x temperatures
1 x water level via pressure transmitter
1 x water flow, via pulsed output turbine flow meter
and then monitor 4 DI and control 4 DO that provides automated water changes
cheers
Rob, Inspirational. I did mechatronics at sydney uni so I appreciate the work gone into this. Well done.
Now that you've got it all to this stage, what do you think a basic automated setup for water changes only would cost using the hardware platform you've implemented for this project?
Price Estimate...As I have kids and myself to consider I made a decision to use low voltage 24VDC equipment...Valves/pumps which is more expensive. You can now get low pressure drip valves which may save some money as the valves I used are industrial quaility. I use the valves and pumps manually via switches for a long time before moving to full automation.
Computing platform
You need an old PC running linux or a nice embedded platform is the NSLU2 aka SLUG, which is quite easy to implement and get running. NSLU2 $150.00 plus USB hard disk (any size)
1Wire I/O interface
? x DS2601 (single digital I/O) free as samples from dallas
1 wire USB interface US25.00
Some cat5 ethernat cable to connect the digital I/O chips to the USB adapter.
relay interface
futurlec relay board AUD17.00
Valves
Well I paid AUD$100.00 each needing 2 valves...you could get cheaper ones
pump
I use a 24VDC pump which runs at 1-2 litres / min..ebay purchase as used in water filter equipment $100.00
power supply
I use a 24VDC power supply for the valves and pump...low voltage = safe
AUD$50.00
Float switch
in tank float switch US5.00 ebay (get two for redundancy)
Relays
I have one relay which turns power off to the fill valve independent of the 1wire interface. This relay connects direct to the float switch.
Filter
ebay purchase AUD25.00
Cabinet
ikea medicine cabinet AUD$55.00 to house valves
Software
FREE !!!!!!!
Single button Automated Water changes
PRICELESS :lol:
rob
Thought I'd just share a little more progress with respect to the interface. Under the main buttons I now have a set of tabbed buttons that display different things where the picture is. An exmaple follows the main picture of the water change reports. I now also monitor the power usage in KW and KWH. This is done by an optical sesnors that monitors the revolutions of the kwh meter.....sensor provides the No. of revolutions which I count. although need some more work on the web interface to this part.
http://img.photobucket.com/albums/v3...ay/newweb1.jpg
Water Change report...only show partial report as you need to use the slider bars within the window
http://img.photobucket.com/albums/v3...ay/newweb2.jpg
If you want a direct link to the site just pm me.
cheers
rob
Rob - legend status mate :D Great stuff - great interfaces and intelligence behind it all. this has to be the way we will all go (one day) in the future.
Rob, really cool that you keep us updated. I am still figuring out how to create the best possible PH amplifier since the 1-wire protocol only measures between 0 and 5 volt. Do you have any suggestions or can you send me some Eagle files? Ultimately it would be really cool if you could supply also some sort of amplification for the Redox and ORP electrodes if you have it..
Will the Vernier amplifier work for that purpose?
(http://www.vernier.com/probes/ea-bta.html)
Hi Giles,
DIYJunkie had a separate post on how to build a ph amplifier. Have you seen this ?