PDA

View Full Version : DIY Tank Monitor --> Tank Controller chat



diveboy
Tue Dec 05, 2006, 08:38 AM
This post has spawned from Bad Inferno's (Rob) post in the Amazon Garden section http://www.discusforums.com/forum/viewtopic.php?t=10076

After several comments about his pH graph, we all got deep and meaningful and started chatting about how to do it ourselves.

we are in two minds as to how far to go; the first being to implement a tank monitor and the second to implement a tank controller.

the second choices are sensor hardware.

1. Phidget sensors from http://www.phidgets.com
2. Using one wire sensors from http://www.owfs.org

either method, you will need some sort of controller (pc,laptop, nslu2, wrt54g) to get your data out to the web.

I think using either method, you will be able to build a monitor that will pump data out and possibly alert for less then AU$500.00

What do you think ? what features would you like ? how much would you spend ? how technical minded are you ? can you solder ? can you program ? would you prefer to just plug sensors in ?

Would you trust such a system to control your tank ? or would you use it only as a monitoring system that would email/sms/Beep ?

Would you want to use the one system to monitor more than one tank ?

Michael

Bad Inferno
Tue Dec 05, 2006, 09:02 AM
What options do we have for SMS....I understand there are companies that you can email the alert to, then they pass on via SMS....I did chase them up some months ago however seemed quite expensive....Email notification is easy and at no cost ? however I do like the idea of SMS...b

diveboy
Tue Dec 05, 2006, 09:12 AM
for sms,

http://www.mbox.com.au charge 13 cents an SMS, this was on the first page of google searching for "web sms service".

if you are with Three, you can sign up for the "email pack" for $3 a month and use it for notifications, get hourly reports, even send commands back for no extra cost

of course, this would assume you have an always on internet connection which is reasonable to expect these days.

Bad Inferno
Tue Dec 05, 2006, 10:21 AM
SMS...I was looking at the corporate guy's where you send an email to them with the number embedded within the message....This options seems cheaper...and I should easily be able to use it, especially if I setup a dedicated email account. thanks

Maybe we should look at a html based logging system where once you take manual readings of various parameters you just enter them into a web page and display a trend of these variables over time OK it wont be minute by minute however it maybe worth while to log weekly data. Some parameters like CO2 we can provide the calculation....This would allow a web front end to be developed with trends etc fed from manual data together with an event log
Thus if they wanted to move to automatically monitored variables it would be easily achieved.

I have an ulterior motive for this :) as I do need help developing an event log for my site, which shows :

Alarms...as monitored by the system,
Event Notifications..... ie filter clean next week,
Aqua Log...manual entry of what has happened..ie added fish, dead fish (needs an entry form)
Acknowledged alarm/events...List of archived alarms

I'll pm you with some thought's....was hoping to do this with simple ascii files being read from a cgi page without having to go to sql...the amount of data I believe would be minimal ~200 lines of events.

Bad Inferno
Sat Jan 13, 2007, 02:39 AM
SMS -Just realised this week bigpond mail does this for 0.25 per message you can set up a filter on your email sender or subject line and it just gets charged to your internet account.....After reading a post about a tank emptied onto the lounge room carpet I may use this SMS just to monitor tank level....outside of normal water changes.

Just need to be super careful that you only generate 1 message and not 1000's :)

ryan
Sat Jan 13, 2007, 08:36 PM
not a bad idea - I read the same thing and you can only imagine the feeling if it happened

i use a company called messagenet in the office which sounds like a similar service - you end up with a email being sent to 0412123456@messagene.net.au and the sms is sent that way - we prepurchase a block of sms - they are pretty cheap depending on the volume you buy ~20-22c

Bald_noggin
Thu Feb 22, 2007, 12:32 AM
Hello all,

I'm new to this web site and I'm finding it to be some interesting reading. I am about to purchase a 6x2x2 tank which I'll be seting up as a planted discus tank.

This topic however, has hit my sweet spot in the way of electronics and aquariums :D

I have already designed a microcontroller that performs the following operations:

-- Has a Real Time Clock.

-- Uses non-volatile memory to remember user settings should there be a power failure and returns to normal operation once power is restored.

-- LCD display with time and date (even adjusts for daylight savings depending on which state you live in).

-- Controls lighting including a sunrise/sunset simulator (over 5 minute periods) based on switch on/off times entered by the user.

-- Controls the temp of the tank to within 2 degress (ie if temp is set for 25 degrees, heater on at 24, off at 26).

-- Has both visible and audible alarm feature with a mute for the audible part should the temp go 2 degrees above or below the set temp.

The range of temp for the switching the heater on and off and alarms can be easily adjust in software and can be as low as 0.5 degrees but I think 1 degree is sufficient (for the heater) as the device (a Dallas DS18B20 for the technical people) has an accuracy of 0.5 degrees.

I can also add on sump level alarms using simple float switches.

A flow sensor could be used also to detect if a sump filter pump fails or simply a high level float switch to detect excess water in the sump.

The RS232 component of the micro has been reserved for future development. This can be used to send data to a computer at regular intervals to Log data or alert the user to an alarm but speaking of SMS, there is a kit available (which could be interfaced to this project) that uses old Nokia 6110's with a prepaid card or what ever, that can SMS the user of an alarm event and even tell them what the alarm is.

I have toiled with the idea of a pH meter, but that is going to take a bit more research but if implemented, could also be used to control a solenoid for CO2.

I have built this and bench tested it over several weeks to check out the automatic daylight savings adjustments, lights on/off, sunrise/sunset, temp control and alarms. Although it has not been tested in an actual aquarium environment yet, in its current form, it will work.

I would like to know how many people could be interested in such a project to deem if it is worthwhile to get some prototype boards made up.

Any questions, ideas and suggestions are welcome.

Cheers,
Col.

Bad Inferno
Sun Mar 04, 2007, 08:43 AM
you really need to find a reef forum to talk about automation...as they either have more money or more demanding Aquaria needs. We can obviously embrace automation for Discus however the reef guy's are just more active in this arena.

Bad Inferno
Fri Apr 06, 2007, 09:49 PM
After running my web enabled tank monitor now for probably 1 year its time to move into fully automated water change control, its been a long time comming. This will be done on a time basis and also a manual button request. Also be a fill only mode in case I do a vacuum and empty into bucket and just need an auto fill.

I have recently built some cheap digital I/O components. Futurlec provide very cost effective opto isolated I/O boards which are very easy to fit 1wire devices onto. This allows you easily to control each output and monitor voltage or contact inputs. In line with the objective of cost effective with inherent reliabilityand flexibility, both these boards cost ~$17.00 each

The DO board will control my fill solenoid and drain solenoid, which I currently have a simple switch onto at the moment. The Fill solenoid will have a float switch directly interlocked such that if my controller poops it self it will not overflow the tank
http://img.photobucket.com/albums/v319/rjconway/IMG_0027.jpg

The DI board will monitor a button to start water change and also the fact drain & fill solenoids are active. DI board not yet mounted in box.
http://img.photobucket.com/albums/v319/rjconway/IMG_0025-1.jpg

You can see only minor changes are needed for the DI board.
http://img.photobucket.com/albums/v319/rjconway/IMG_0023-1.jpg

cheers rob

ryan
Fri Apr 06, 2007, 09:53 PM
nice work rob - will be interested to hear about it when its up and running

Bad Inferno
Tue May 01, 2007, 09:11 PM
OK time seems to be getting away from me however have progressed into assembly and got the I/O boards mounted on a back plate. I am currently writing a simple script that will control the fill drain solenoids. You can see the float switch attached. This has been hooked up to my controller now for 2 weeks and seems very stable. This unit will be fitted into my new tank which I am saving for and hope to get in the next month...

http://img.photobucket.com/albums/v319/rjconway/IMG_0001_edited.jpg

I have also updated my web site....and can now see via a pull down on each trend 1 week, 1 month and 2 month trends.

http://img.photobucket.com/albums/v319/rjconway/Aqua-rev2.gif

This is the tank
http://img.photobucket.com/albums/v319/rjconway/450.gif

Bald_noggin
Tue May 01, 2007, 10:33 PM
Nice work BI!

I had just finished installing my two T5 QTi 2x54 Watt Dimmable ballasts on my tank. (I still have to purchase another one but that wont be for another month or two)

I am waiting on a microcontroller board and PSU from Futurlec :wink: to complete my lighting controller. I have already done a proof of concept and had a prototype working (both hardware and coding now complete and bug free) so I'm just waiting for these dedicated parts to turn up.

The controller has an LCD and Real Time Clock to display time, date and temp. When the switch on time is reached, the controller begins to bring the T5's up to full brightness over a 15 minute sunrise period. Obviouisly at night, the reverse happens. The T5's are dimmed over a 15 minute period to 1% birghtness.

The controller can be easily modified to control heating which will be done at a later date along with adding a keypad to enable user entry of time, date, switch-on/off time and a temperature set point. (The algorithm I use for the time and date has been coded to adjust for daylight savings automatically depending on which state it is set for)

I'll try to get some pictures posted soon as my tank is now up and running.

DIY
Sat May 05, 2007, 09:42 AM
Hi Guys,

havent been on the forum much for a while but it's great to see some interest in this area. I started playing with PIC micros for this some time ago, my original intention was PH monitoring, temp control/monitor then w/c control. I got sidetracked with other hobbies so didn't get further than a prototype temp control (ended up on my coffee machine!)

I also started thinking that owfs might be a more flexible way to go, you can even get free "sample" sensors sent to you direct from maxim/dallas if you register. Obviously these are raw chips so boardmaking soldering etc are required.

My preference is for pc based monitoring and probably owfs based sensors since I have an old laptop laying around that would be perfect, and some sample sensors.




What do you think ? I like it!

what features would you like? PH monitoring, possible ph control, Temp control, temp monitoring, possible advanced features like water level monitor (assist with W/C too), W/C control.

how much would you spend ? whatever I can hide from the wife!

how technical minded are you ? Reasonable - self taught mostly

can you solder ? enough to complete the circuit

can you program ? not really

would you prefer to just plug sensors in ? DIY is cool

Would you trust such a system to control your tank ? after testing yes

or would you use it only as a monitoring system that would email/sms/Beep ? thats good too

Would you want to use the one system to monitor more than one tank ? probably, but not essential to start with


By the way - really nice work Rob!

Lindsay

Bad Inferno
Sat May 05, 2007, 08:58 PM
DIY-J

Checkout owfs for NSLU2...NSLU2 aka "SLUG" only costs 140.00...Plus the cost of a usb hard disk. It will host a web server, owfs and rrdtool for trending. I have been working with the owfs group for some time now and there latest build is very stable...1wire is the way to go. As you know getting digital precision temperature for <5.00 each is better than anything else.

ryan
Sat May 05, 2007, 09:01 PM
i need to pull my finger out and do it - this setup now rob is very impressive!

DIY
Sun May 06, 2007, 01:11 AM
Thanks Rob, I'll do some reading.

How much linux / programming knowledge is needed? I assume your website needed some skills to create or was it fairly simple stuff?

Is there a forum for owfs/nslu2?

btw - my brother is still using that tank we got from you, it's being setup as a small planted tank now :lol:

ryan
Sun May 06, 2007, 01:23 AM
the One Wire Project site has a heap of info on it - related to hardware etc - check it out http://www.owfs.org/

Bad Inferno
Sun May 06, 2007, 11:17 AM
DIY-J

You don't need to know a lot about LINUX. A handful of commands.

I am not a programmer...I have got some simple script files that gets 1wire data and pushes it into a trend application.

I am not a web designer..this is my first web page, however when your looking at it all there really is is a couple of trends and some buttons. The NSLU2 is actually a web server so use frontpage, dreamweaver any type of web page creator. I'm happy to share my html code if you agree to develop further :) I just got a pretty cool picture album running on the server as well.

I have written a couple of DOS batch files before however you will need to generate a couple of simple "plain text" script files and schedule them to run.

The NSLU2 (which becomes your cheap web server, 1wire host, trend generator) is very easy to install. Each piece is documented its just up to us to put it together for aqua usage.

I am more than happy to share my simple scripts to get you running. If you have cable or ADSL (continuous web connection) it's easy to see your Aquarium data over the internet. That was my main driver.


Hardware / Applications
NSLU2 (Linksys NAS) with a USB hard disk.
1wire USB adapter

Install Unslung 6.8 on the NSLU2
Install owfs (i.e. just type #ipkg install owfs)
Install rrdtool
get simple home web site working
Ask me for a script file to push data into rrdtool

Only thing you really need to know is how to use "vi" which is a text editor. It's quite simple but thats the hardest thing in terms of Linux.


I am currently documenting the water change and 1wire digital I/O boards when this is done I will document how to setup the NSLU2...you wouldn't really need it documented by me though as its all there in pieces.

PM me if you get stuck more than happy to assist.
rob

Bad Inferno
Sun May 06, 2007, 11:28 AM
This is the water change solenoids built about 2 years ago, although under manual switch control at present. This is what the 1wire outputs will switch on / off automatically. Solenoids and pump are low power 24VDC

http://img.photobucket.com/albums/v319/rjconway/IMG_0025.jpg

http://img.photobucket.com/albums/v319/rjconway/IMG_0022.jpg

DIY
Sun May 06, 2007, 12:24 PM
OK, I'm in :lol:

I'll order the USB adapter, get myself an NSLU2 and start playing.

Actually I've done some scripting before (dos batch files & a couple of simple vbscripts) so I'm sure I'll cope. I've even used VI a few times for work about 5 years ago, from memory once you get a few basic commands memorised it's not that bad.

I can only find one place in OZ so far that sell the USB adapter (thermodata.com.au) is that where you got yours?

Bad Inferno
Sun May 06, 2007, 09:22 PM
I paid too much for my adapter did buy it in OZ however try hobbyboards.com

I got my 1wire counter from them and delivery was good. I think the usb adapter is only US$25.00. I paid AUD80 locally can't remember where I got my adapter from (not thermodata.)

CPL (Computer parts land) in ~clayton used to sell the NSLU2 for 135.00. I used an old 20gb laptop drive in a USB housing for my HD. I've got two NSLU2 one as a network storage device and the other as my Aquarium server.

Bad Inferno
Sun May 06, 2007, 09:24 PM
just checked themodata, at that price it seems OK

Bald_noggin
Sun May 06, 2007, 10:33 PM
I can only find one place in OZ so far that sell the USB adapter (thermodata.com.au) is that where you got yours?

I got my mine from them. They were also the cheapest I could find.

DIY
Tue May 08, 2007, 07:29 AM
I got my USB adapter today after ordering it yesterday. $45 including express delivery from thermodata if anyone is after one.

On the down side no-one locally has an NSLU2 in stock until the end of the week :roll: I might load linux & owfs on an old pc I have lying around so I can start playing.

Bad Inferno
Tue May 08, 2007, 08:23 AM
When you get NSLU2 unslung and owfs loaded the easiest way to test 1wire is just call up the web interface. you just type the NSLU2 IP followed by ":3002" this will provide access toe owfs dynamic web pages. All the 1wire devices it finds on the network will be displayed. You can see each device and clicking on the device shows all device parameters. It even shows data errors on the communication lines.

I will outline best method for data gathering latter...gotta fly

cheers rob

DIY
Fri May 11, 2007, 04:06 PM
When you get NSLU2 unslung and owfs loaded the easiest way to test 1wire is just call up the web interface. you just type the NSLU2 IP followed by ":3002" this will provide access toe owfs dynamic web pages. All the 1wire devices it finds on the network will be displayed. You can see each device and clicking on the device shows all device parameters. It even shows data errors on the communication lines.

I will outline best method for data gathering latter...gotta fly

cheers rob

Well, after much reading, frustration :banghead , more reading :ug , a couple of smacks in the forehead :stupid followed by more reading :coffee I've managed to get my brand new NSLU2 "unslung", owfs loaded and showing the temperature on my temporarily breadboarded temp sensor... :thumb

Before I go running a lan cable under the house to my tank I'd like to get it a bit further, I guess I need to get rrdtool on there, somehow setup a basic web page, and then try recording data.. care to give me some clues? (Thanks!)

Bad Inferno
Fri May 11, 2007, 09:53 PM
OK sounds like you progressed well....I'll PM you the details of how to collect data however their is a couple of things you will need to do

1. use ipkg install for a couple of other things
#ipkg install bash
Will let you run a bash shell script

#ipkg install gawk
Will let you do calculations on your 1wire data within a script

# ipkg install rrdtool
Will let you setup trend files. (I'll send you a setup file to get you started, once installed)

2. Setup a simple home network follow these instructions
http://www.nslu2-linux.org/wiki/HowTo/SimpleHomeWebsite

3. pm your email address to me and I'll send 3 files and some instructions..
1. rrdtool setup file to create a trend database
2. a simple script to populate the trend file say once every 2 minutes
3. a script to create a trend file from the rrd database.

Each of these files are just some simple english commands. However you will need bash installed and the simple web server so that you can view your trend.

rob

Bad Inferno
Fri May 11, 2007, 10:03 PM
OH you may need a couple of text edit commands for the vi editor

#vi scrap (opens a new file called scrap)
i (which is lower case "i" goes into insert mode to add text)
[esc] (enables you to type global type commands see below)
dd (deletes a line, "5dd" deletes 5 lines)
yy (yanks line, copies current line)
p (inserts yanked lines back, ie paste)
:wq (saves (ie writes) and quits)
:quit! (quits without saving)

once you save & quit, to view the file from the command line
#cat filename (cat shows contents of ascii files, you may need to add a "./" infront of your files for some commands ie #cat ./filename)

Bad Inferno
Fri May 11, 2007, 10:56 PM
This is temp sensor I used for monitoring my reservoir temperature. Just used a piece of 1/4" tube and a cable gland. Squirted silicone up the tube to seal the connections and had an old cable relief from a power plug to neaten the end. I drilled a hole in the bottom of my barrel. Why monitor this temp i hear you ask...well I am trying to get a relationship between qty water changed and the drop in Aquarium temperature. ie with water temp at 18" and changing 40 litres aquarium will drop x degrees. This temperature will be used in the water change algorithm to automatically change x litres at a time based upon current reservoir temp and not drop the aquarium too much. I do not heat reservoir and as such may elect to change 2 x 20 litres over the day instead of 40 litres straight up. Also would not change water if temp is greater than 29 degrees. etc Once you have a system setup each temp device is only ~5.00 each so you can go crazy in what temp you monitor. I was thinking of putting 5 sensors along a tube say 40 cm long and try and get a temperature profile both vertical and horizontal in various parts of the tank and test out different positions for heaters and canister returns etc to optimise temperature throughout the tank.


http://img.photobucket.com/albums/v319/rjconway/1wire_temp-1.jpg

Bad Inferno
Fri May 11, 2007, 11:56 PM
DIY-J Thought I would give a quick note on scripts as I wont be around until Sunday arvo..Make sure you did the other installs bash, gawk etc as shown above including the home website stuff before proceeding. I use "dyndns" to provide a simply and free web address mapped to my slug so I can see my Aquarium data over the internet , anyhow here are the scripts to get you going

Introduction
The intent of the following information is to setup continuous trending of one temperature point as an example of data logging using the Linksys NSLU2 and the Dallas 1wire interface. An image file is created every 15 minutes which will contain the last 2 days of data. This image can be integrated into a simply web page so that it can be viewed from a web browser.

http://img.photobucket.com/albums/v319/rjconway/nslu2.jpg

The NSLU2 device is small, cheap and takes a small amount of power to run and does not require your computer to be running to log the data.

Using these principles you can easily extend this to many more temperatures or really any 1wire device that provides information. e.g. a 1wire counter connected to a flow meter or an Analog input (A/D) which monitors pH or conductivity.

Prerequisites

Your NSLU2 must be using the linux unslung 6.8 firmware
http://www.nslu2-linux.org/wiki/ and be running the simple home website setup http://www.nslu2-linux.org/wiki/HowTo/SimpleHomeWebsite

Packages installed
owfs http://www.owfs.org/index.php?page=nslu2
rrdtool http://oss.oetiker.ch/rrdtool/
bash
gawk



Time & Date
Make sure your time is set correctly...from the command line just type #date -you can use the linksys interface to set the time / date. For date and time linux actually uses the number of seconds since midnight from 1970. Thats how RRD saves the time to its files. Not that hard and you will start to like it after you see the power when manipulating trends durations. If you want to see the linux time use #date +%s -it will print out the seconds. WARNING if your date is incorrect and you happen to write data to the RRD database say 10 hours in advance, you will not collect any more data for 10 hours... My SLUG is probably looses 5-10 seconds a day. I used to sync to a network time server however would not recommend this approach. Its in the to do basket in how best to sync time. You should get within 5-10 seconds a day as standard.

RRDTool database creation
The following needs to be just run from the slugs command line. create a directory rrd in public. Copy the lines from here and then you just need to right click in the telnet window to paste it. make sure the complete line contains all data before pressing return.. This will create a database called aqua_temp.rrd

rrdtool create /public/rrd/aqua_temp.rrd --start 1178926536 --step 300 DS:AT1:GAUGE:600:-10:100 DS:AT2:GAUGE:600:-10:100 RRA:AVERAGE:0.5:1:1440 RRA:AVERAGE:0.5:4:2160 RRA:AVERAGE:0.5:12:8760 RRA:MIN:0.5:288:1825 RRA:MAX:0.5:288:1825

The above actually creates two data points within the RoundRobinDatabase ( AT1 and AT2) The scripts below only use AT1 (to try and keep it simple) however when you hook up another temp sensor you can use the same database and write to AT2 for your second sensor.


Create a SCRIPT to push data into RRDTool (/public/read_script)

#!/bin/bash
OWSERVER="-s 3002"
### Force Simulataneous 1wire conversion ###
/opt/bin/owwrite $OWSERVER simultaneous/temperature 1
### Read 1wire data and convert into engineering units ##
TempAqua =$(/opt/bin/owread $OWSERVER 28.11BF97000000/temperature | /opt/bin/awk '{printf "%3.1f\n",($0)}')

### Push Data into Trend Files ###
rrdtool update /public/rrd/aqua_temp.rrd N:$TempAqua


make sure you #chmod 777 read_script -so you can run it. once created you should be able to run the script

#./read_script

Maybe you could add a line to the end of this script
echo $TempAqua
this will print the temperature out when you run the file…obviously change my 1wire ID 28.11BF97000000 to your 1wires ID number



Create a SCRIPT to make the trend file (/public/graph_script)
Just change the time scale by changing duration (= seconds) the etime and stime is so that the time is in increments of 300 seconds. This is supposed to provide for faster RRDTool database lookup.

#!/bin/bash
etime=$(/bin/date +%s)
step=300
duration=127800
etime=$((${etime}/${step}*${step} ))
stime=$((${etime}-${duration}))

## Aquarium Temperature GRAPH ##
rrdtool graph /website/degc1d.png --start $stime --end $etime \
--upper-limit 32 --lower-limit 27 \
--rigid \
--slope-mode \
--width 422 --height 150 --title "Temperature" \
--vertical-label "Degrees C" \
DEF:degc1=/public/rrd/aqua_temp.rrd:AT1:AVERAGE \
LINE1:degc1#FCB521:"Aquariumm=" \
VDEF:DEGClast=degc1,LAST GPRINT:DEGClast:"%3.1lf%s" \
VDEF:DEGCavg=degc1,AVERAGE GPRINT:DEGCavg:"avg=%3.1lf%s" \
--watermark "Aquarium Temperature Graph"

This will create your graph named degc1d.png….The first time you run this script it will create degc1d.png. go into /website and issue the following command which will make it readable.

#cd /website
# ls -all degc1d.png -This just shows the file privileges
#chmod 666 degc1d.png
# ls -all degc1d.png -This should now show rw-rw-rw-rw

You should be able to view this file from your PC, just navigate to the slugs website directory and open it. if your running the "home" webserver you should be able to go to internet explorer and type your "slugIP's/degc1d.png" and it will display the graph.


Get the scripts to run automatically
OK your done, at this point you should be able to generate your trend files manually by typing ./graph_script -only thing left is to schedule these scripts to be run so that when you call up the trend file it contains the latest data. Modify /etc/crontab to start the two scripts. We will read the data every 2 minutes and recreate your graph every 15 minutes.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""
HOME=/
# ---------- ---------- Default is Empty ---------- ---------- #
0 0-23/8 * * * root /usr/sbin/CheckDiskFull &>/dev/null
0 0 * * * root /usr/sbin/WatchDog &>/dev/null
*/2 * * * * root /public/read_script &>/dev/null
*/15 * * * * root /public/graph_script &>/dev/null

If you added "echo $TempAqua" to your read_script maybe comment it out (ie #echo $TempAqua) as you are now running the script automatically in the background.

Thats it you should now have a temperature graph being generated every 15 minutes. If you've setup your web server you will be able to see this from work ! You can easily add an email alert if temp is high or low however I'll cover that later. For now put on a couple more temperature devices and start measuring your house inside and outside temperatures as well.

Why use the awk command in the read script ?
awk is used for both formatting and providing calculations. All you need to do is pipe data into awk and manipulate the data. If the data is a file that contains two items the first item is identified with $0 and the next with $1. The following example brings my PH value which is a 1-5VDC coming from a 1wire A/D chip. Its a bit tricky however volt.A become $0 in the calculation. The pipe symbol "|" is used to transfer the value of Volt.A to the awk command

PH=$(/opt/bin/owread $OWSERVER 20.B71F05000000/volt.A | /opt/bin/awk '{printf "%4.2f\n",((($0-1)/1.6)+5.5)}')

OK we've got the pH now lets calculate the CO2 concentration...well for this calc you need two parameters pH and KH...$PH comes from the command above and kh comes from a text file. In this case the text file at the end of the awk command is where it will get its data from ie $0 = kh value. I check my kh value once per week and update the value in the text file if required. Here is the calculation, this time $0 represents the value in my kh_value text file. You need to declare PH=$PH so that awk is happy within its formula. The CO2 calc is (3 times kh) times (10 to-the-power-of (7 minus pH)

CO2=$(/opt/bin/awk -v PH="$PH" '{printf "%3.1f\n",((3*$0)*(10^(7-PH)))}' /public/kh_value.txt)

Another example..I monitor the amount of flow that is drained from my aquarium with a $60.00 flow meter. It gives out 4100 pulses per litre and I have a 1wire counter measuring the pulses. The counter never looses the count even when power is off. Thus Accum_Flow is now measuring directly in litres with the benifit of doing it all oon one line of code within the script file.

Accum_flow=$(/opt/bin/owread $OWSERVER 1D.EBEF0900000034/counters.A | /opt/bin/awk '{printf "%g\n",($0/4100)}')


Gee's hope I didn't miss anything out
:roll:

DIY
Sun May 13, 2007, 06:59 AM
Wow :shock: , thanks for all of that!

My weekend has been pretty busy also - I had to squeeze some margharita's in last night :lol: :lol: , I probably wont get much done until later in the week, but you've given me plenty of info to use when I do...

Bad Inferno
Sun May 13, 2007, 11:44 AM
The post above is becoming my how-to page so I have just kept updating the content tonight. May move it to my website or the owfs example site later.

Bald_noggin
Mon May 14, 2007, 06:03 AM
Hi Rob,

Here's where I'm up to.

Just need to mount the Box, LCD, install power points to the opto isolator board and wire in 1-10V dimming lines.

AC output 4 controls heater, output 3 controls substrate heating, output 2 controls 3rd lighting ballast and output 1 controls 1 and 2 lighting ballasts.

Bottom left hand corner is the temp sensor and two DS2890 digital pots for the T5 dimming. (all are white on top with dots so I can keep track of their serial numbers)

Bad Inferno
Mon May 14, 2007, 09:21 AM
Like how you used sockets for testing your 1wire devices, I must install one on my junction box so that I can easily test a device without soldering it. You gotta luv those futurlec isolated output boards, soo cheap for what you get and I think the AC one also provides zero crossing switch functions.

I assume your base plate in your enclosure is non conductive. Are you going to just install 240VAC receptacles on the lid of your enclosure. ?

I was only switching 24VDC with the futurlec relay board however I used the first relay contact to provide the positive 24VDC to the other relays contacts.. This was so that I had to turn on two outputs for the device to turn on. I was concerned if my 1wire had a communication glitch and for some reason one output turned on I did not want to open a valve and flood the place ! Thus two outputs have to be turned on for a valve to open. This will also ptect me if a relay contact fails closed.

Great work... How do you DI into the system. I assume you will need a couple of push buttons.

rob

Bald_noggin
Tue May 15, 2007, 03:46 AM
The AC Opto board are zero crossing which is a good little feature.

The base plate is a fibreglass board just like the ones used for PCB's but without the copper.

For the AC sockets, I'm installing these: http://www.jaycar.com.au/productView.asp?ID=PS4094&CATID=&keywords=ps4094&SPECIAL=&form=KEYWORD&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=

They will be installed on the bottom of the case. (below the AC opto board terminals)

I have also purchased 2x2pin plugs for the 1-10V dimming lines.

All my data (light times, temps etc.) is usually pre-programmed into the PIC. I will be adding a 4x4 keypad at a later date that will be used to reset time/date, temps, on-off times and also temp high/low alarms. I did also purchase a 16F877 (more I/O's too) controller board as the F628 only 2K of word space and I have already used just over 1700 program words.

I like your idea of the interlock. It's a wise decision. Do you ever do a CRC check on the 1-wire data? I wrote a routine to calculate its the CRC using a look-up table that is stored in a 256 byte I2C EEPROM. That's one way to confirm that the data has not been corrupted. I haven't used it in this little project (running out of code space!) but I'll include it in the F877 controller for sure.

DIY
Tue May 15, 2007, 05:14 AM
I did also purchase a 16F877 (more I/O's too) controller board as the F628 only 2K of word space and I have already used just over 1700 program words.

I never noticed those pic controller boards on futurlec before, I've been playing with straight pics which of course requires board making as well - a real pain. This is a much simpler way to go.

The 16F88 has 7kb memory in an 18 pin package, perhaps you can plug one into your board to save replacing the lot? if your in anywhere near me in Melb I can lend one to you to try if you like.

What software/compiler are you using to program with - PIC-C, PICBASIC etc?

Bad Inferno
Tue May 15, 2007, 05:33 AM
My relay board from futurlec used inverse logic eg 0 = on 1 = off So does that mean when you disconnect the PIC the outputs turn on ? It's not like the inputs are high impedance and float high when not connected. In my case I installed 1wire digital output chips thus never really tested the board AS STANDARD with TTL inputs. At this stage I do not know what I would switch with AC power, (maybe reservoir heater a couple of hours before water change) as my lights are on a standard timer. I will switch on a moon light however this will be a low voltage 12 or 24 VDC.

I think for inductive loads (ie ballasts) the current draw is approx 7x that of rated wattage. Heaters and the like are OK. So be careful not to exceed the rated current through the triacs.

FOR OTHERS READING THIS POST DO NOT ATTEMPT TO SWITCH MAINS AC POWER UNLESS YOU KNOW WHAT YOUR DOING. AS A DIY'er YOU MAY KNOW THE DANGER HOWEVER IS THE FINAL SOLUTION SAFE FOR THE FAMILY or OTHERS IF YOUR NOT THERE ?

Bald_noggin
Tue May 15, 2007, 08:27 AM
Yes the 16F88 does have 7K of code space (and is a drop in replacement) but is still limited on input and output pins. I could use a PCF8574 to increase I/O throught the I2C bus but that will start to slow things down a little. There are also a few limitations with the futurlec boards such as with the F628, you can't really use PORT B 4 as it is used as the PGM pin for low volatage programming. As it turns out, I don't use the LVP so I pull it out and use my XELTEK chip programmer. If you PM your email address, I'll send you a copy of both F628 and F877 manuals that come with them on CD.

The software I use is Oshonsoft PIC IDE. Check it out at www.oshonsoft.com It's a pretty good program and has virtual LCD, oscilliscope etc and is cheap as chips. I think the personal licence cost 19 euro's. You can download a demo and use it for 30 days. Other than I2C, 1 wire and some other devices, you can write your code and test it within the IDE. Even the simple 'Hello World!' can be written and tested within the IDE program and if it works on their, it should work on the real thing!

Hello World Sample:

DEFINE LCD_BITS = 8
DEFINE LCD_DREG = PORTB
DEFINE LCD_DBIT = 0
DEFINE LCD_RSREG = PORTA
DEFINE LCD_RSBIT = 0
DEFINE LCD_EREG = PORTA
DEFINE LCD_EBIT = 1
DEFINE LCD_RWREG = PORTA
DEFINE LCD_RWBIT = 2
LCDINIT LcdCurBlink
loop:
LCDOUT "Hello world!"
WAITMS 1000
LCDCMDOUT LcdClear
WAITMS 1000
GOTO loop

Simple hey?

It also supports Software UART, Hardware UART, SPI just name a few.

The T5 ballasts are fully electronic and the power consumption specs for the 2x54Watt are 121 Watts and they have a power factor of 0.99. It shouldn't be a problem but I will also double check.

I'd like to also reinforce Bad Inferno's message: FOR OTHERS READING THIS POST DO NOT ATTEMPT TO SWITCH MAINS AC POWER UNLESS YOU KNOW WHAT YOUR DOING.

If you have any questions, let us know and we can help to guide you.

Bad Inferno
Tue May 15, 2007, 11:47 AM
CRC error checking is done with 1wire and owfs suit. Its got a really cool page that shows various error counters, number of packets transfered etc etc. My use of two actions to turn a solenoid ON maybe misguided however when I first started to play with 1wire a year ago, one of my A/D chip parameters would "magically" turn off maybe every 2 weeks..It only happened a couple of times and never again however better to be safe.

For those knowing owfs I would not use the "fuse" file system. Just use the owread & owwrite commands directly in a script. very easy and less overhead required on the NSLU2.

ON another topic.......I was always wanting to earth my tank. I believe you can get a titanium (?) probe to place in your tank and run it to earth stake. Something about stray currents from your heater. I know from my ph knowledge the solution should be grounded however my pH reading is very stable, what do you think ?

rob

Bad Inferno
Tue May 15, 2007, 12:21 PM
BN Ever seen something like this. I would like to find a purpose biult 240VAC plugboard that was either ethernet or serial.

http://www.monitors-direct.co.uk/ProductDetails.asp?ProductID=1157

The site also has a list of controller functions for the unit. I was interested in the floro burn in..Didn't know you had to burn in lights Whats the go !

Bald_noggin
Wed May 16, 2007, 01:09 AM
OK. Been doing some research and double checks.

The IP Inrush Current of these ballasts is 45A and the normal current draw is 0.54A.

The Triac's are a BTA06-400 and can handle an Current Surge Peak of 64A and Irms of 6A for 360 degrees (one cycle). No problems here I think.

The ballast specs sheet recommend no more than 8 ballasts per 10A fuse.

It also appears from the schematics of the AC Opto out board that if the signal line was disconnect, it will go high and turn off the AC device.

As for the grounding, I'll have to some research into that one.

I haven't seen those plugboards you mention. Why not make one? :D Although having said that, it probably would be easier and cheaper to buy.

Again, refering to spec sheets for the T5, they recommend a "burn-in" period of 50 hours for the tubes before you start dimming them. I think this is to ensure their rated output for the life span of the tube.

DIYjunkie, I'll send you that other info when I get home tonight.

Bald_noggin
Mon May 21, 2007, 10:02 AM
Here's my tank controller. At the moment it is only controlling the lighting but all I have to do is run the wires for the T5 ballast dimming, locate the temp probe inside the tank and mount the box.

So far the program code simulates sunrise, sunset, switches in a third ballast for additional lighting during the day for a five hour period and controls the tanks temperature and display the times, date and temp nicely on an LCD.

And it's only running at 4Mhz.

DIY
Mon May 21, 2007, 02:00 PM
Here's my tank controller. At the moment it is only controlling the lighting but all I have to do is run the wires for the T5 ballast dimming, locate the temp probe inside the tank and mount the box.

So far the program code simulates sunrise, sunset, switches in a third ballast for additional lighting during the day for a five hour period and controls the tanks temperature and display the times, date and temp nicely on an LCD.

And it's only running at 4Mhz.


Nice work!

I like the danger high voltage signs. What are the 3 connectors for on the lhs of the picture?

Are you planning on adding some sort of menu/button system? I'm assuing at the moment if you want to change any parameters like light on & off times, or setting the date & time you re-program at the moment?

Bald_noggin
Mon May 21, 2007, 10:20 PM
The three connectors are for the one-wire devices. The DS2890's that control the dimming (1-10V control), are going to be located with in the enclosure. The third one is for the DS18B20 temp sensor.

At the moment, any changes to the system do require a re-program of the microcontroller. I'll be starting (actually porting over) the code for a F877 that will have a 4x4 keypad interface. I had already coded such a routine to accept input and reset all the necessary data ona F877 so it shouldn't take too long to get it going.

One good thing about the F877 controller board, it's the same size as the F628 so it's a striaght drop in. Only bugger is, it does not have an LCD connector. Sigh, a small sacrifice.

Bald_noggin
Fri May 25, 2007, 06:33 AM
BI and DIYJ,

How did you encapsulate your DS18B20 devices?

It's the last thing I need to do to my little project but it has kept me stumped at the moment.

Cheers,
Col.

DIY
Fri May 25, 2007, 07:59 AM
If you mean for water proofing - Jaycar sell a "dual wall" heatshrink tube that is basically heatshrink lined with heat sensitive glue (I think it's the same as hot glue used in glue guns).

Using a heat gun I shrunk one layer on focusing on the the solder joint(s) at the base of the sensor, then used a second layer covering past the sensor and a few cm back along the wire for safety. I also squeezed the open end past the sensor shut while it was still hot to seal it (*edit - don't use your bare fingers!) . Works like a charm and is really simple to do.

I've had it submersed in ice water, and boiling water when I was attempting to test it's accuracy and I haven't had an issue :wink:

Bad Inferno
Fri May 25, 2007, 08:47 AM
I just used a piece of 1/4" tube...see page 2. I managed to leave a little of the chip protruding out the end of the tube.

I've just received my ORP probe so thats my weekend project, fitting it inline with my filter and connecting it up to my spare A/D channel.

Bald_noggin
Fri May 25, 2007, 08:55 AM
Cheers for that guys. :wink:

I have reinstalled my controller with the dimming lines attached but not with the temp sensor yet.

The big test will now be at 9.30 tonight as that is the time the lights should start to dim! :D

I do have some of that glue impregnated heatshrink but it is actually for a 50 pair telephone cable so it's about 30mm across! A bit too big. I didn't think Jaycar would have it but that will teach me for not looking.

Thanks again.

I'll report back later on when (fingers crossed) my lights dim!

Col.

Bald_noggin
Fri May 25, 2007, 12:41 PM
Well, it worked!!!!! second time around :roll:

I forgot to link the RH pin of the DS2890 to the side panel connector so it really never was attached to the ballast. :evil: So I quickly grabbed the soldering iron and rectified my problem and then reprogrammed the microcontroller to switch off at a later time and it worked. :D

What I did notice though, it is not linear. It actually appears to be logrithmic. I'll have to double check the data sheets on it. For the first 8-10 minutes it appeared that nothing had happened but disconnecting the dimming cable proved that it was working as the light jumped back up to full brightness. The last 3-4 minutes the lights dimmed quickly!

I'll just have to implement a different aglorithm that's all. Should take about 30 minutes to 1 hour to implement.

Not tonight though. Too tired. Will have it done tomorrow.

When you get adventurous enough to do this BI, drop me a line. I'll share my code and tips with you. :wink:

Bad Inferno
Fri May 25, 2007, 01:34 PM
Great new's...you can sit an admire your work every night now as your lights dim....

It will be some time before I get T5 lights. I'm still hopeful for a new Juwel 450 curved tank however they do not have T5 lights and cannot retrofit. Juwel lights just span across the aquarium (sit on the two far edges) and there is plastic filler pieces in between the lights. There are three dual T8's across the top. Thus the lights are fully water proof and they could fall into the tank as you can easily lift them off the top of the tank. Spend 2,500 on a tank that doesn't have T5, I must be crazy !

I would like to be able to turn them on in the morning...my lights come on for 1 hour 7:30 - 8:30 so I can feed them before I go to work. being able to turn them on from 7:30 and bring the light up to 25% sound great, don't know if the fish will appreciate it though however it is a cool feature..

I know when I had a moon light (bright LED) on after the lights went out the tank looked great just lit up ever so slightly.

Had to search back to a post when I was using a PICAXE controller however this was my interface. Don't laugh it was a picture frame but worked OK. I was going to mount it in the door of my aquarium however ended up down the web path.

http://www.discusforums.com/forum/viewtopic.php?t=5135&postdays=0&postorder=asc&highlight=ikea&&start=20

My current thought is to get one of those 7" touchscreen LCD, place it on the tank and show pictures but also become the web interface for my NSLU2.

Bald_noggin
Sat May 26, 2007, 06:28 AM
Well NOW it works :D a little better and a little longer. It's now a 30 minute sunrise and sunset period.

I had to recalculate a liner value in to a logarithmic equivelant.

To do this, I had use decibels. Value = 256 - (10^(x/20)*(256-1)).

where x = value in negative dB. As we know -3 db, is the half power point of 0 and -6 is half of -3 and -9 is half power of -6 and so on. The value 256 is how many steps there are in the DS2890.

Once I obtained my values (I used every -1.5 dB's) I then stuck these values into a lookup table stored in the EEPROM. Saves the PIC performing these complex calculations over and over again and wasting clock cycles.

Using every -1.5dB's created 31 steps so this turns pretty much well into 30 mintues. The cutoff value is -45dB's. This is where the calculated value equals 255. Then, it's lights off.

I know, I know. I can hear it already, my mates say the same, you propellor head! :book

BI, check you PM. There's some info there which will enable you to find some dimming ballasts for T8 light systems. :wink:

Cheers,
Col.

Bad Inferno
Fri Jun 08, 2007, 01:38 PM
BN...what are you up too...can't believe your just sitting back and admiring your intelligent light switch :)

I will try and get some time to revamp my web page layout.....my layout is looking a bit old...havn't progressed any more measurements after my orp probe installation a couple of weeks ago. Spending most of my free time trying to plan the next aquarium....rob

Bald_noggin
Mon Jun 11, 2007, 12:10 PM
Hi BI,

I'm busted!! I have been enjoying my dimming lights! :roll:

I've been rather flat out with work lately (on higher duties at the moment) but I have also somehow managed to get time to get a modchip into my PS2 :D

I'll be working on a midday cloud simulation for my system soon hopefully. I plan to customize it for each day of the week.

What do you think of this idea, dim the lights very low (or even off) and then flash a strobe to simulate lighting? Could even use the surround sound subwoofer for thunder! Yes, I am joking!! :lol: :lol: But it would be a cool effect. :D

The pH controller is up and going and working like a dream.

Cheers,
Col.

Bad Inferno
Thu Jun 14, 2007, 08:27 AM
How cool is this ?...can now tell when my fish get fed and how much...all whilst away from home...Now when I travel I can see when and how much my fish are being fed ! Will be great on holidays and checking if my auto feeder is working OK

http://img.photobucket.com/albums/v319/rjconway/cond1d-1.png

DIY
Thu Jun 14, 2007, 08:53 AM
Very, Very Cool!

Whats happening though, is it the tetra bits affecting the ORP readings for a period?

And what caused the dip in the graph within an hour of the w/c - did you dose some ferts or something?

Once agin BI, impressive! 8-) 8-)

Bad Inferno
Sun Jun 17, 2007, 11:38 AM
I've had my first hardware failure which is very disappointing....the 1wire DS9490R seems to have packed it in. Even when nothing is plugged into the adapter the NSLU2 does not see the adapter ID.
I have noticed I get a glitch about once every 2 weeks when sometimes I energise a solenoid valve, although I have tried lots of things to stop it (bar running a shielded cable) it still occasionally happened. Tonight I've lost my 1wire comms after a water change, so I'll have to invest in another usb->1wire converter. Beats me how a 24VDC power cable running next to my 1wire cable seems to be causing this. All my 24VDC solenoids have diodes across them and my pump has two capacitors between +/- to a ground stake to alleviate any noise. I'll order another adapter from thermodata as I doubt very much it is software and I hope its not the USB port of the NSLU2 :(

Bad Inferno
Tue Jun 19, 2007, 10:30 AM
Got a new DS9490R from thermodata today plugged it in and its running again.

DIY-J my solenoid switching can causes one missed reading and a zero averaged with 3 other readings cause a spike down. Only needs to miss one reading and I get a spike. I will add some code such that if it does get an error (usually 0 value) I will hold the last value for 1 retry. Its something that happens maybe once every 2 weeks.

Bad Inferno
Thu Jul 05, 2007, 01:27 PM
Well this thread had been dead for a while so I thought I'd give it a bounce and show an improved look and feel to my web interface....I now filter out any occasional data spikes and log any of these errors in a system messages window. I have also found the ability to overlay data on the trends and can pop up target with range bands with alarm info on a transparent overlay. Next enhancements over the coming months is to link a help / info system to each parameter and get a user interface to easily insert log information into the event lists. The last will be providing logs/report of water changes..I do have a great trend showing water changed on what day and accumulated water changed for the week...need to consolidate data into monthly event reports. Can't think of any more enhancements for the short term, any future idea's to extend functionality ?

http://img.photobucket.com/albums/v319/rjconway/NewWeb.jpg

DIY
Sun Jul 15, 2007, 06:39 AM
I have finally been able to spend some time on my NSLU2 over the weekend, and for the benefit of anyone else wanting to follow Bad Inferno's instructions you will need to do the following things.

>if you have trouble running things like rrdtool to create the database, preface the program name with /opt/bin/ as that's where they are located (example /opt/bin/rrdtool create /public/rrd/aqua_temp.rrd --start 1178926536 --step 300 DS:AT1:GAUGE:600:-10:100 DS:AT2:GAUGE:600:-10:100 RRA:AVERAGE:0.5:1:1440 RRA:AVERAGE:0.5:4:2160 RRA:AVERAGE:0.5:12:8760 RRA:MIN:0.5:288:1825 RRA:MAX:0.5:288:1825). That one had me confused for some time :lol:

> To get the bash shell working for Root user, follow the instructions on the bash page http://www.nslu2-linux.org/wiki/Optware/Bash to create the global .bashrc file. I also had to create a /root directory (user home directory) and create the .bashrc for root also.

> Have a good read of the beginners page for rrdtool here http://oss.oetiker.ch/rrdtool/tut/rrd-beginners.en.html

> owwrite & owread are in an additional package you need to install by typing "ipkg install owshell". :oops:

Bad Inferno, I'm having trouble with your example script to push data into rrdtool. I'm getting an error "expected 2 data source readings (got 1) from N:" I can't echo $TempAqua at the end of the script as you suggested as it tells me command TempAqua: command not found?

Bad Inferno
Sun Jul 15, 2007, 07:52 AM
PM me your script...just highlight it the shell (hold left mouse button down and wipe over text (this copies it to the paste buffer) and then you can paste it into an email.....

Ooops forgot about owshell however cannot remember having to do anything to get bash working. Have you got gawk installed ?

Bad Inferno
Sun Jul 29, 2007, 10:59 AM
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

Bad Inferno
Sun Sep 09, 2007, 05:01 AM
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/11806_ASUS_PUNDIT_P2_AE2_BAREBONE__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/v319/rjconway/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

Bad Inferno
Tue Oct 09, 2007, 11:33 AM
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/v319/rjconway/visionrelay-1.jpg

http://img.photobucket.com/albums/v319/rjconway/IMG_0022.jpg


this is the two solenoids Drain / Fill with the small pump..all is 24VDC
http://img.photobucket.com/albums/v319/rjconway/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

Bad Inferno
Sat Dec 01, 2007, 08:36 AM
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

aquafrogstuff
Wed Jan 02, 2008, 07:01 AM
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?

Bad Inferno
Sun Jan 06, 2008, 09:15 AM
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

Bad Inferno
Sun Mar 16, 2008, 10:56 AM
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/v319/rjconway/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/v319/rjconway/newweb2.jpg

If you want a direct link to the site just pm me.

cheers

rob

Barry N
Mon Mar 17, 2008, 10:55 AM
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.

Gilles
Fri Mar 21, 2008, 01:25 PM
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)

Bad Inferno
Fri Mar 21, 2008, 09:43 PM
Hi Giles,

DIYJunkie had a separate post on how to build a ph amplifier. Have you seen this ?

Gilles
Sat Mar 22, 2008, 08:19 AM
Hi, well i've tried to search for it, and he mentioned the Vernier amp for it. I am also trying to figure out the conductivity and ORP electrodes, since they behave differently then PH. I also read the entire thread on reefcentral, but i didn't get any wiser there.

All i've learned is that you use sensors from sensorex, which you've bought from Ebay. Unfortunately, i can't find anything on Ebay right now. I get the point that you would like to have a 4-20mA range for PH 0-14. What i don't get is how you'd get e.g. 6.85 PH reading out of that.. So that is my first question; how you've sold that with which components and so on.

Secondly for both the conductivity and ORP; they give a 0-1000mv range. Which 1-wire component would i use for that?

Bad Inferno
Sat Mar 22, 2008, 11:35 AM
I'll have a look, however thought the reef forum had a ph amplifier for US$60.00 ?

Anyhow the ph meter I have is a foxboro 872ph...they are on ebay however need to find them being sold for ~40.00 each...I paid US25.00 each for both my PH and ORP meters.

4-20ma output is actually 1-5VDC if you place a 250 ohms resister in series with the output. Thus you usually power the device with 24VDC and place a 250 resister in series, then just tap off 1-5VDC into a1wire chip.

There are other 1wire voltage input devices that do go 0-10VDC.

http://owfs.org/index.php?page=voltage-measurement

pH amplifier http://www.vernier.com/probes/ea-bta.html shipping is US35.00 cheaper for two ! ie 1 for ph one for orp

Gilles
Sat Mar 22, 2008, 02:31 PM
4-20ma output is actually 1-5VDC if you place a 250 ohms resister in series with the output. Thus you usually power the device with 24VDC and place a 250 resister in series, then just tap off 1-5VDC into a1wire chip.
Meaning i have to power the Foxboro 872 chip with 24VDC, place a 250 resister in series and it outputs 1-5VDC? Sorry i am only good in software, i have someone else doing the electro ;)


pH amplifier http://www.vernier.com/probes/ea-bta.html shipping is US35.00 cheaper for two ! ie 1 for ph one for orp
Yeah, i allready asked for a quote. For 3 items i have to pay 180$ 3, meaning 40 euro's each.

Bad Inferno
Sat Mar 22, 2008, 09:16 PM
there could be cheaper chinese units...although I did not think US50.00 each equated to 40 euros. and its was US45 to ship two units to australia

The foxboro units actually run on 120 VAC and it powers its outputs so you just put the resister across its output terminals and that converst it to 1-5VDC. Its not worth spending 100's of dollars for 1 unit.

why not try DIYJunkie ph circuit. I am sure he will share his cct and give you some tips.

Gilles
Sun Mar 23, 2008, 04:45 PM
I've pm'd him, but he aint responding :) Think he is busy ;)

Gilles
Wed Apr 02, 2008, 08:44 AM
Conductivity... As far as i have understand and read, conductivity electrodes require a voltage to be sent through the electrode? What sollution did you end up with?

Bad Inferno
Wed Apr 02, 2008, 08:59 AM
Gilles,

It is very difficult to DIY conductivity measurement...The utilisation for conductivity once installed is marginal.

Its good to see how the any Med's and fert effcet the water however suggest pH and temperature to be the main things to monitor for.

My background is "instrumentation" and as such I went crazy with measurements and if dissolved O2 was not so expensive I'd install one of those just for the heck of it !

rob

Gilles
Sat Apr 12, 2008, 10:59 AM
Haha GOOD news! I finally got my aquaputer online and i did my first temperature readings.

However, i have some questions maybe BAD_INFERNO can answer;
a) I need a mounting script. Right now i have used the commando "/opt/owfs/bin/owfs /dev/ttyS0 /var/tmp/1-wire" to mount it, but i would like to do this on startup.
b) It seems that when i do a "cat /var/tmp/1-wire/..." the temperature is not updated realtime, does this change with owread?

Thanx

Gilles

Bald_noggin
Thu May 01, 2008, 05:35 AM
Hi BI,

Well, I bit the bullet today and bought a NSLU-2.

I have bought it because I am going to venture down the road of a setup like yours (with other features too!) but I'm also about to do a course in Linux so there going to go hand-in-hand together.

My first trick is going to be re-flashing the device with Linux. It seems pretty straight forward but wish me luck!

Oh and one small question, what size HDD are you using on yours?

Cheers,
Col.

Bad Inferno
Thu May 01, 2008, 07:01 AM
I had an old 10 gb 2.5" laptop drive...hanging of my SLUG. With a small drive you can power it from the NSLU2 USB port...larger 3.5" drives will need the external power adapter. Good luck if I can be of any help just PM me on the software side, its been a while however I may just be a ble to remember. If I had known you where in the market I would of given you one of my NSLU2 for a good price as I actually have two spares, now I've moved onto a small Ubuntu server.


keep us updated
rob

one last thing...there is a command that tells you what speed the SLUG is running at (I think the new one are already fatser 255mhz)... check it out and if required you can remove one resister and improve the slugs performance by quite a few %

Bald_noggin
Thu May 01, 2008, 10:21 AM
BI,

Help please!!

I'm trying to load the owfs-feed.conf into the /etc/ipkg directory but I can't access the admin section off the drive through network neighbourhood.

Any ideas?

I need this to use ipkg install owfs

C4Vette
Thu May 01, 2008, 04:35 PM
Hmm, TUX as an avatar but 'never' really seen Linux huh, :wink:

Don't know too much about the slug but I use WinSCP for copying files to my OpenWRT box. WinSCP is free to use and downloadable at http://winscp.net/. Much faster and easier to use than the MS-way. It looks like WinCommander from the past and has two panes which makes is easy to drag files from your pc to the slug. For a console I use PuTTY, also free. Isn't Linux great :lol:

Bald_noggin
Thu May 01, 2008, 11:58 PM
'never' really seen Linux
That sums it up!

I have used linux before but very limited CLI usage and more the GUI packages such as Ubuntu and Debian. As you would know, these packages set everything up for you. There is no requirement to use the CLI to set the ethernet up and to get other devices going by installing the packages.

What was casuing my problem was the fact I could see the directories through my network neighbourhood, but I did't have the permissions to write the files to the /etc/ipkg directory.

After a little headbanging, I remembered that you have to be logged in as ROOT to have the permissions to write there.

I also have PuTTY installed and it was through this that I managed to sort things out. Once I remembered the ls, cp and cd commands every thing worked. It's all sweet now.......for the time being at least. :lol:

C4Vette
Fri May 02, 2008, 08:12 PM
I do hope you understand I was just kidding around :oops: and wish things work out for you. I'm no guru myself and learning by doing and reading great topics like this one. Hopefully we hear more from your project and we can help each other.

greetz, Ed

Bald_noggin
Sat May 03, 2008, 12:25 AM
No harm done C4Vette :D

I pretty much well learn the same way. I've been pulling things apart since I was about 5 years old to also learn how things work!!

I have downloaded WinSCP and yes, it is a lot easier than the MS and CLI way. I will, without doubt, be using it if I get stuck again trying to use the CLI to move/copy files. Thanks for the tip!

Cheers,
Col.

Bad Inferno
Sat May 03, 2008, 09:41 AM
BN...How are you going ? Do you have OWFS installed yet. ? there was an update to the script I had put forward that had a couple of typo's.

Gilles
Thu Jun 19, 2008, 03:19 PM
Well, my system is up and running (as far as lights are concerned).

Preparation for light panel (before)

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2724.jpg


Electronic Ballasts removed

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2745.jpg



Preparing tools:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2747.jpg

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2723.jpg


New light panel with my own "light control unit"

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2748.jpg


All wires are nicely placed in a hidden compartment.

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2750.jpg

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2751.jpg


Wich looks like this (you see the bottom heater cable running here)

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2753.jpg


And this is how it looks when it is all closed.

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2754.jpg


The computer which only used 15 watts of power

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2756.jpg


Preparation for connecting the computer to the HUB which in its turn controls the 1-wire network:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2757.jpg


Re-attaching wires:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2760.jpg

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2761.jpg

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2762.jpg


****, wires to short....

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2763.jpg


Prevent wires from pulling to much on the ballast:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2764.jpg


The bottom part of my electronics is (visually) finished:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2765.jpg


Adding some juice to the network:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2766.jpg


HUB:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2767.jpg


Lights in action:

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2768.jpg


Maintenance by a student which i hired to do all the tiny stuff (like soldering 220 volts ikes!)

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2797.jpg

http://i168.photobucket.com/albums/u162/gilles_vvv/project2/IMG_2799.jpg


So i have been running my 6 lights now for about 1 month without any problems. Next up is construction in my own house (i get the key tomorrow). When the aquarium is moved, i'll start on the PH, temp and dosing pumps.

Bald_noggin
Thu Jun 19, 2008, 09:44 PM
:D Nice work Gilles! :D

One of the great things about electronics is that you are usually limited only by your imagination.

I take it by looking at the photo's, they are dimming ballasts?

What's the specs on the little computer?

For your dosing pump, have you made something DIY or are you using a commerical product?

Sorry for all the Q's...

Cheers,
Col.

Gilles
Fri Jun 20, 2008, 06:39 AM
:D Nice work Gilles! :D

One of the great things about electronics is that you are usually limited only by your imagination.

I take it by looking at the photo's, they are dimming ballasts?

What's the specs on the little computer?

For your dosing pump, have you made something DIY or are you using a commerical product?

Sorry for all the Q's...

Cheers,
Col.

Thanx for your reply; here are the answers:
Yes, dimming ballasts, 100% - 1%. The 1-wire chip sends 0-255 steps to the network. Then, there is some smart stuff integrated onto the PCB which i did not invent.. hehe It turns off the power to the ballast if the voltage comes below 1v. (e.g. less then the minimum dim power). This way, it does not cost me any relais.

The little computer is this one:
http://www.microclient.nl/images/stories/MicroclientTTZero.jpg

Specs:
CPU: VIA C3 533 MHz
Memory: 512 MB 133 MHz SD-RAM
Slot: 1x PCI with riser
IDE: 1x IDE with convertor for Compact Flash (unfortunately, no DMA)
LAN: 1x 100 Mbit LAN onboard (bootable)
Video: Onboard Trident VGA 8 MB, max 1600x1200
Sound: Onboard sound, speaker/mic
I/O: 2xPS/2 2xUSB1.0 (bootable) 2xCOM 1xLPT
Dimensions: 5x23x21 cm (hxwxd)
Weight: 1,7 kg
Power usage: 15 Watt

For storage i use a 1gig CF card. Which makes it 100% noiseless.

As for dosing; i was going for a DIY, but then i found 1.5l/hour pumps which only cost 40$. Complete with housing etc. This means ~0.5ml/sec.

Well you can compare them with Aquamedic SP3000, they almost look thesame:
http://www.erdingtonaquatics.com/aquamedic/SP3000.jpg

All that is left for me to do is:
- Make the PH and ORP/Conductivity unit.
- Connect the 8-port relais (4x = dosing, 3x heating (2 tubes, 1 bottom heater), 1x CO2 valve)
- Start monitoring temps

There will also be a new kinda "hub" which can connect "floaters" (you know, those things which monitor water level).
http://www.rainforest-frogs.nl/shop/images/vlotter-120x120.jpg

Using that, i can detect low water/high water and use the PC speaker to alert me (since the canopy is closed).

Bad Inferno
Fri Jun 20, 2008, 11:57 AM
Nice work, very impressive... How much are the dimable ballast's ?

When you get to monitor via rrdtools suggest you only update every so often as the CF card has limited writes.

rob

Gilles
Fri Jun 20, 2008, 06:11 PM
@Bad_Inferno: Good point. Do you allready have failing CF cards?
The ballasts where 15$ each (using connections @ Philips Lightning). New and unused hehe... I calculate the light sequence using MySQL every night at 24:00 once for all lights for the upcomming day.

Bad Inferno
Fri Jun 20, 2008, 09:24 PM
I know there was some talk about this on the NSLU2/SLUG forums. I am not at the tech level to understand how to limit linux disk access. I am sure there is help on the net on using CF and limiting disk access on the linux distro you are using. I just use a small laptop drive.

Great job, that many lights you could create a DISCO sequence :)

Bald_noggin
Sat Jun 21, 2008, 03:32 AM
I know for the NSLU-2/Linux, there are some answers on how to reduce the amount of read/writes to your storage medium. It does also mention that you are better off using a HDD as opposed to flash memory as flash does not last as long with many read-write cycles. I think it is in their wiki or FAQ.

:shock: $15 a piece for the ballasts !! :shock: I should be talking to you mate, buddy, pal, friend!!!! :lol:

I did the same with my PIC based dimming system. It uses DS2890 100K Ohm digital pots (1-WIRE!!!). Only problem was, ballast dimming is logrithmic, digi pots are linear so I had to work out the correct value with a formula. It's somewhere else in this post.

I will eventually port all of the PIC based system over to a linux based set-up.

That's a good price on the dosing pumps. I eventually want to add these to my system as well. The plan is to use them to dose ferts about an hour before lights on so it has a good chance to mix with all the tank water.

Again, great work mate!

Bad Inferno
Sun Jan 10, 2010, 12:17 AM
This thread has been too quiet, what are people up to with respect to tank monitoring ? A lightning strike in December took out my telstra modem/router/ethernet port of my server and my 1wire network. So its taken a little while to get it back online its 90% back up and runsing.

Last year I did an update to the web interface. The gauges, for those that are a little web savy should be able to duplicate them as my code is documented.

http://img.photobucket.com/albums/v319/rjconway/2009web.jpg

www.rjconway.homeip.net

rob

Bad Inferno
Tue Feb 09, 2010, 11:57 AM
Completed a new 8 channel relay mounted onto 4mm perspex plate. It looks alittle complicated however it really allows easy connection of the tank devices and also distributes the 12VDC power.

From Left to Right
1wire interface - Relay boards (double decker) ATO float relay and light actuator relay - terminals

http://img.photobucket.com/albums/v319/rjconway/1wirerelay-2.jpg

You can see I had to mount the two relay boards ontop of one another
http://img.photobucket.com/albums/v319/rjconway/1wirerelay-1.jpg


Under the 1wire controller I ahve mounted the refugium LED constant current power supply. This supply enables up to four 3W LED's to be driven.
http://img.photobucket.com/albums/v319/rjconway/1wirerelay-3.jpg

AC Power Control

I required only two 1wire controlled AC powered devices. One being the main light the other the heater. I debated for quite a while in how best to acheive this in the safest way however deviced to simply use two good quality 12V relays inside a small box. These relays are controlled via the 1wire relay isolators on the main interface. above And yes there are now two relays controlling these outlets however all AC wiring is contained within the small box.

The heater needed to be normally ON thus without power to the relay the outlet is ON. That way if the controller fails the heater will be on, as it has its own thermostat, it will function as normal. The reason I wanted to be able to power off the heater was so that I can better regulate temperature on hot days. I did not want the heater fighting against the cooling fan when the tank temp was low. That way on hot days, ambient >26 I can just use fan control to regulate the tank temperature and turn off the heater.

The other outlet is simply the main light. Powering on the relay will turn the lights on.

http://img.photobucket.com/albums/v319/rjconway/1wirepower-2.jpg

http://img.photobucket.com/albums/v319/rjconway/1wirepower-1.jpg

malcomm
Thu Jun 17, 2010, 08:16 PM
:D Nice work Gilles! :D

One of the great things about electronics is that you are usually limited only by your imagination.

I take it by looking at the photo's, they are dimming ballasts?

What's the specs on the little computer?

For your dosing pump, have you made something DIY or are you using a commerical product?

Sorry for all the Q's...

Cheers,
Col.

Thanx for your reply; here are the answers:
Yes, dimming ballasts, 100% - 1%. The 1-wire chip sends 0-255 steps to the network. Then, there is some smart stuff integrated onto the PCB which i did not invent.. hehe It turns off the power to the ballast if the voltage comes below 1v. (e.g. less then the minimum dim power). This way, it does not cost me any relais.

The little computer is this one:
http://www.microclient.nl/images/stories/MicroclientTTZero.jpg

Specs:
CPU: VIA C3 533 MHz
Memory: 512 MB 133 MHz SD-RAM
Slot: 1x PCI with riser
IDE: 1x IDE with convertor for Compact Flash (unfortunately, no DMA)
LAN: 1x 100 Mbit LAN onboard (bootable)
Video: Onboard Trident VGA 8 MB, max 1600x1200
Sound: Onboard sound, speaker/mic
I/O: 2xPS/2 2xUSB1.0 (bootable) 2xCOM 1xLPT
Dimensions: 5x23x21 cm (hxwxd)
Weight: 1,7 kg
Power usage: 15 Watt

For storage i use a 1gig CF card. Which makes it 100% noiseless.

As for dosing; i was going for a DIY, but then i found 1.5l/hour pumps which only cost 40$. Complete with housing etc. This means ~0.5ml/sec.

Well you can compare them with Aquamedic SP3000, they almost look thesame:
http://www.erdingtonaquatics.com/aquamedic/SP3000.jpg

All that is left for me to do is:
- Make the PH and ORP/Conductivity unit.
- Connect the 8-port relais (4x = dosing, 3x heating (2 tubes, 1 bottom heater), 1x CO2 valve)
- Start monitoring temps

There will also be a new kinda "hub" which can connect "floaters" (you know, those things which monitor water level).
http://www.rainforest-frogs.nl/shop/images/vlotter-120x120.jpg

Using that, i can detect low water/high water and use the PC speaker to alert me (since the canopy is closed).

Where did you find the dosing pumps?
How have they worked out for you?

ta