Howto: Use a Linksys Router as Wireless Reef Controller - WRRC

I've been working on it in my spare time, and have been doing some of the hardware design. My biggest accomplishment was getting pH measurement prototyped. I took vernier pH probe amplifier to amp up the pH probe output into the 0-5v range of the DS2450 quad A/D. Then it was a matter of getting the formula correct to convert from mV to pH.

What formula did you use? I did the same thing as a test with a Vernier amplifier, but found I was slightly off for some reason.

Thanks!

-Mike
 
I used a 4-20ma pH transmitter with my DS2450. It has a span adjustment, so I adjusted it so the voltage output would to be between 0 and 2.5 volts (the DS2450 is in 0 - 2.5 v mode) within the ph7 and ph10 range. Here is the formula I'm using.


ph7 = voltage with ph7 calibration fluid (currently 1.145)
ph10 = voltage with ph10 calibration fluid (currently 2.465)

slope = (ph10 - ph7) / 3
pH = 7 + ((voltage - ph7) / slope)


If you don't have temperature compensation, then the calibration fluid should be the same temperature as the tank.
 
I don't remember the where exactly I found the formula off the top of my head, but here's the perl script I use. I found it to be as accurate as my pH meter (actually more since I trusted it to 2 decimal places whereas my pH meter only does one decimal place - I found anything beyond 2 decimal places was just random noise and not reliable IMO due to DS2450 accuracy).

The real accuracy is based on the slope & offset of ph Probe (calibration constants) and finding the actual nominal offset of the vernier pH amplifer - they say it's 1.2v but I found mine to be more like 1.175v.
#####################
# The parameters of my particular pH probe. I used a calculation
# program called PHFIT.exe to get them using known pH solutions and
# mV of output of the probe
#####################
my $offset = 9.4408;
my $slope = -984.5802;

#####################
#Get temp in Kelvin for use in formula
#####################
# (Temp in C + 273.15 = Temp in Kelvin)
my $temprt = 20.944 + 273.15

#####################
# Vout = the actual pH probe output voltage.
# To get this we must revers the amp/offset done by the Vernier amp
# The nominal offset of the amp is 1.2v but I found mine to be slightly lower (1.175v)
# The gain of the amp is 2.2v so we also have to cancel out that.
#####################
my $Vout = ($owval-1.175)/2.2*1000;

#####################
# This is the 'Magic' formula it needs:
#
# Probe voltage [actual and not amplified/offset] ($Vout)
# Probe calibration offset ($offset)
# probe calibration slope ($slope)
# fluid temperature ($temprt)
#########################

my $pH = 7 + ($Vout - $offset) / (1.98416 * 0.0001 * $temprt * $slope);
 
<a href=showthread.php?s=&postid=9148317#post9148317 target=_blank>Originally posted</a> by pista01
I used a 4-20ma pH transmitter with my DS2450. It has a span adjustment, so I adjusted it so the voltage output would to be between 0 and 2.5 volts (the DS2450 is in 0 - 2.5 v mode) within the ph7 and ph10 range. Here is the formula I'm using.

Do you have a model # or more info on your amp? Span adjustment would be very nice.

This is the vernier one I used:
http://www.vernier.com/probes/ea-bta.html

I bought mine from
http://www.schoolmart.com/index.asp?PageAction=VIEWPROD&ProdID=226
for $40 + 5 s/h
 
<a href=showthread.php?s=&postid=9148066#post9148066 target=_blank>Originally posted</a> by bigreddastud
Yes/no.

I've moved from the Linksys platform to a full blown PC running Ubuntu, so the router-based setup is temporarily out, but the spirit of the device is still alive. I haven't heard from the guy that was really driving the OWFS on WTR54G cross-compiling, so with my limited linux knowledge I decided to switch to a PC based setup. I think this will be better and give me a more robust platform with a PHP front-end and a MYSQL back-end.

I've been working on it in my spare time, and have been doing some of the hardware design. My biggest accomplishment was getting pH measurement prototyped. I took vernier pH probe amplifier to amp up the pH probe output into the 0-5v range of the DS2450 quad A/D. Then it was a matter of getting the formula correct to convert from mV to pH.

I found an MSDOS based program that would calculate the slope & intercept needed for calibration, but I have been unable to find a decent calculation formula (that I understand) to make my linux box fully independent - ie add in a calibration routine. Anyone have experience with pH calculation formulas?

I've also been learning how to make my own PCB's with photo paper and a laser printer. I actually got my first RJ45 based temp probe board etched and soldered up last night. It's quite simple, but much better with a PCB then with my alligator clip connected workbench prototype.

I've written some basic test shell/perl scripts that I can run to collect data from the sensors, but I decided to concentrate on the hardware first *then* refine the software. The software will be nothing but a group of data collection scripts, some monitoring scripts, and a web front-end.

Bad Inferno - I think we emailed a while back off the OWFS developer's list. You have the discus down in Australia, correct?

I kinda figured the little linky would not have enough horsepower for most folks and development would dwindle.

The STAPLES PHOTO paper is the stuff to use. I do not have a part number off hand. I have also been using Muriatic + Peroxide instead of ferrich chloride. I like the results much better, but must do it outside due to the fumes.
 
bad inferno, does your screen shot there actually work? Like is that a screen shot of a live image or just the layout you plan to use when things work out.
I have wanted to get my PC doing that sort of stuff for a long time, but any time I get started I'm told I have to just pick any random ph probe, figure out how it works on my own, then type the code on my own. I don't have the time or background to do that.
 
Yes, I am watching. I just now got (and promptly took apart) a WTR54G router to use in making my setup. I just need to get a source for the parts needed for the 1 Wire. I see lots of spec sheets, but no where to get the parts. First on the list is the parts for the serial interface to the WRT.

bigreddastud: Do you have a file for the PC board? I have been downloading those I find built in Eagle (free addition) so I can start building them when I get parts.
 
Some one PLEASE tell me where to order a small quantity of 1 Wire parts from. I ran into the same thing, lots of info, but no ordering pages. You think they would make it easier for you to give them your money, lol. I suppose I was mostly on manufacture pages and they weren't worried about the couple of parts I would have bought.
 
Gordonious...Yes its live and has web server functions so I can get this web interface from anywhere.

It runs on a web server/1wire NSLU2 device. Only draws 5watts, has Hard disk attached....I use 1wire to monitor the following and also log this data so I can provide trends for the web site. It can also send out email/SMS alerts if any parameter is over a select value

Measurements
ph
Conductivity
Tank Temperature
Ambient Temperature
Outside temperature
Turbine flow meter monitors water pumped out of aquarium
Outside water reservoir level 0-110litres & temperature

I don't know what the total cost is however
NSLU2 US80.00
Hard disk =X.XX Find an old one !
1 wire/USB device US25.00
1 wire devices US5.00 per temperature US12.00 for 4 channel A/D
Water level based upon pressure sensor, ebay US5.00 for the sensor and some electronics to make it 4-20ma ~US20.00
PH transmitter Foxboro 873 US25.00 ebay pH electrode US20.00 ebay
Conductivity transmitter Foxboro 873 US150.00
pH & Conductivity by Foxboro is far superior than any Aquarium monitor you could buy plus it provides an output 4-20MA. They also have two alarm contacts biult in so you can dose, in my case, CO2, to control the Ph


This graph shows water changes. You can see the grey area show the accumulated water change for the week (resets on Sunday night), blue line show how much was pumped out, Green line shows level in litres in the water tank, and the temperature being red. I currently have two solenoids that allow me to drain water out of the tank and pump water back into the tank.

waterchange.jpg
 
Neat project. I'd rather see it on a Linksys, but that's just me. Stand alone, small footprint and what not. If I get some time, maybe I'll try to get on board! Good luck
 
bad inferno, I am going to order a lot of the things you mentioned there you think you can help me through getting some of it connected? Instead of using the NSLU2 do you think something like the WRT350N could work? Same company and same concept I think, just has different stuff attached to it. I didn't know if I needed to modify it in any way or if the hardware was too different to work with. I was already planning on purchasing one.
 
I know the linksys NSLU2, with unslung firmware mod, coupled with owfs works great....for 1 wire...and no reason to keep a power hungry PC running 24/7...NSLU2 is better than a wrt54G router as you can attached a hard disk to record all your readings/web pages and create a photo album on your site. Beware you will need to know a few linux commands......Make sure you have a plan and understand what you want out of the system before buying anything ! ie do you want X10 control's.....at this stage I am only monitoring, next phase is digital outputs for control however am thinking hard on how to make sure it is secure and very reliable.

I am in the process of writing an overview of my project...should be finished in a couple of weeks



http://www.nslu2-linux.org/
http://www.owfs.org/

cheers rob
 
I may not understand something here, and I haven't looked at the specs for what each pin does, but 1-Wire runs on Rj45, correct? Would there be any way to hack the drivers to use the RJ45 ports already built in to read 1-wire sensors?

Just seems like an awful lot of work to get back to the point we were already at.
 
<a href=showthread.php?s=&postid=9182629#post9182629 target=_blank>Originally posted</a> by RichConley
I may not understand something here, and I haven't looked at the specs for what each pin does, but 1-Wire runs on Rj45, correct? Would there be any way to hack the drivers to use the RJ45 ports already built in to read 1-wire sensors?

Just seems like an awful lot of work to get back to the point we were already at.

Not really since it's a completely different wiring standard and communication protocol. The 1-wire deviced use CAT5 network cable merely because it's cheap, readily available and fits the bill. Other than than the actual cable, the 1-wire and traditional network protocols have little in common. Unless you are a driver-writing guru, I personally don't think it's possible/feasible.

OWFS, wraps all that low-level communication junk up for us. So no need to do massive hardware hacking to do what you are suggesting.
 
I was thinking, that it would be possible if Linksys/etc was doing most of the processing in software. If theyre doing it in hardware, forget it.


Anyone happen to have a diagram on the voltages of an ethernet connector?
 
Back
Top