Reef Central Online Community

Home Forum Here you can view your subscribed threads, work with private messages and edit your profile and preferences View New Posts View Today's Posts

Find other members Frequently Asked Questions Search Reefkeeping ...an online magazine for marine aquarists Support our sponsors and mention Reef Central

Go Back   Reef Central Online Community Archives > General Interest Forums > Do It Yourself > The R3CA Project
FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11/20/2007, 09:11 PM
ufans ufans is offline
Premium Member
 
Join Date: Mar 2004
Location: Fairfax Station, VA
Posts: 645
pH & Temp Logging on PC

What is cheapest way to log pH and Temp in an ODBC database on a PC?

Anyone using X10? (0-100% dimming = Temp or pH ranges) ?
  #2  
Old 11/21/2007, 12:31 PM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
IMHO, Dallas 1-wire devices would the the cheapest and easiest. Sounds like you have a PC already and your favorite database.

First, you'd need a USB 1-wire adapter.

A 1-wire temp sensor encased in something waterproof, like epoxy. Sensors are cheap, so add as many as you want. I even have sensors in my MH ballasts, in case they overheat.

You would of course need a pH probe. A pH transmitter would be needed to read the probe and convert it to a voltage that can be read by a 1-wire A/D converter. The pH transmitter would need to output a 4-20ma loop. Google will yield lots of information on 4-20ma loops. It's a standard for industrial controls. You can find pH transmitters on eBay pretty cheap. I got one for $25. Even brand new one can be had for around $80.

Some CAT-5 cable can be used to connect the sensors to the USB adapter.

You will then need to choose which 1-wire API to use to get the data. If you are just reading the sensors, then the java API and some batch files would work. You can use a java program if you want to get slick. The pH would need a bit more calculation. A point-slope formula would need to be used to derive the pH, based on the voltage of the probe on a pH 7 and voltage at pH 10 calibration fluid, and of course the current voltage.

There may be cheaper ways, but they would probably take much longer to do.

As far as X10, I have it but would never use it for my reef. I don't think it's reliable enough, but some people do swear by it.
  #3  
Old 11/22/2007, 03:58 PM
ufans ufans is offline
Premium Member
 
Join Date: Mar 2004
Location: Fairfax Station, VA
Posts: 645
Questions:
- Does anyone have wiring diagrams to show how to construct everything?

- How do you connect the temp and (pH->A/D Converter) to RJ-45?

- How far can you run the RJ-45 (signal loss)?

- Do I need a seperate USB 1-wire adapter for each sensor (ph & Temp)?

- Does anyone have a program already that runs on Windows and logs data into a SQL Server (ODBC) database?



I am pretty handy with soldering, data networking, and general automation, but my programming skills are a bit lacking these days. Any help would be GREATLY appreciated.
  #4  
Old 11/22/2007, 05:16 PM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
HobbyBoards has a good How To section on their site. It should answer all your questions on topology and connections and such.

The 1-wire Java API provides lots of samples. I'm sure the other other APIs has samples too. The other option is to use the OWFS, which will let you access the data as if it was text files in the file system. It only runs on Linux however. Getting the data into a database would depend on the database. I'm not a SQL expert, but I suspect most would allow adding rows from a command line. You should be able to modify the samples to output the data into a format that can be imported into the database. I've never tried it this way myself, as I do everything within Java and use JDBC to access the database.

I would offer up my code, but what I have is a bit complicated right now and not quite ready for public consumption.

There are a lot of ways to do this in software. Research the options and pick the path of least resistance for you. All will require some programming, whether it's Java, .NET, C, batch files, or shell scripts. Sounds like a good opportunity to brush up on those programming skills
  #5  
Old 11/24/2007, 09:49 AM
ufans ufans is offline
Premium Member
 
Join Date: Mar 2004
Location: Fairfax Station, VA
Posts: 645
Pista01

I have been reading your posts on the Linksys Router Hack forum and have a question about the Hobby Board HVAC Monitor modification to read the 0-5VDC input from a pH Probe. Did Hobby Board make the necessary changes to the board's sensitivity or did you have to do something after you got the board?

I am planning on ordering:
1- Temperature Kit (Hobby Board: TS-R1-K)
1- Power Injector Kit (Hobby Board: PI1-R1-K)
1- HVAC Monitor (Hobby Board: HVAC2-R1-A)
1- 1-Wire USB Adapter (Hobby Board: DS9490R-A)
1- pH Probe (Ebay ??)

I am going to build the Temperature Kit with the temp sensor on a long lead and coated in epoxy so I can put it into the aquarium.
  #6  
Old 11/24/2007, 11:21 AM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
HobbyBoards did make the change for me. All they did was remove the resistors and bridge the gaps with a piece of wire. The board won't read the pH probe directly. You will need a pH transmitter with 4-20 ma output. This will convert the high impedance signal from the pH probe into a voltage range that can be read by a A/D converter like the DS2450. The DS2450 will read the 4-20ma loop voltage. I found this with a quick Google search on 4-20ma loop circuit. The trick is to use the right size resistor in the loop based on the voltage supplied to the circuit that will yield a voltage between 0 and 2.5 for the DS2450 to read. The DS2450 can read 0 - 5 volts, but at a much less resolution. The swing of the pH transmitter (at least my cheap one) is less than 2.5 volts, so it's better to use the higher resolution mode. The pH transmitter I got included a span adjustment, so I didn't have to mess with the different resistors to adjust the range to be within 0-2.5 volts. Also, the DS2450 has 4 channels, so you can have multiple pH/ORP probes. I got my pH probe from one of the online reef stores. I think it's a Neptune probe. You'll also need the pH7 and pH10 calibration fluids.

Here is the slope formula I used to get the pH, based on the voltages at ph7 and ph10.

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


I just found a pH/ORP transmitter on ebay for $45.50 (I'm adding a ORP probe to my system). Unlike the first one I got, this one has an LCD screen.
  #7  
Old 11/24/2007, 11:28 AM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
You don't need to buy the Temperature Kit. Just get the sensor and solder it to the end of a CAT5 cable. Get a few, they are cheap.
  #8  
Old 11/26/2007, 10:34 PM
ufans ufans is offline
Premium Member
 
Join Date: Mar 2004
Location: Fairfax Station, VA
Posts: 645
What is a good epoxy to use to encase the temp sensor?
  #9  
Old 11/27/2007, 07:26 PM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
I used a 2 part epoxy from Home Depot, the kind in the double syringe. After I soldered the sensor to the cable and used small heat shrink tubes to seal and insulate them. Then I sealed the gap between the leads with silicone. Then I slid a heat shrink tube over the cable and just barely over the bottom of the sensor. For a mold, I drilled a hole between 2 pieces of 2x4. Then I made a big mistake and just filled the hole with the 2 part and shoved the sensor on in, so the epoxy covers the sensor and some of the cable. Had a heck of a time separating the 2x4s though. Eventually I did and scraped the wood off the hardened epoxy Next time I'll use some kind of release agent, or spend some more time removing the stuck on wood. I did this almost 2 years ago. It's still in my tank.
  #10  
Old 12/01/2007, 01:46 PM
ufans ufans is offline
Premium Member
 
Join Date: Mar 2004
Location: Fairfax Station, VA
Posts: 645
WOW that was easy. I wired up an 18S20 Temp sensor to some CAT6 and the USB Adapter. I am running Wserver that I got from http://www.henriksens.net/1-wire. Very Very easy.

Now I just need to get the ph transmitter/controller and wire up the A-D converter and 1-wire interface.
  #11  
Old 12/01/2007, 07:35 PM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
Cool! Glad you got it working.

I find the Java based OneWireViewer a very good way to test the network of devices. It can display almost all the properties of the devices and it's easy to use. No need for a web server. Until I add the routines to the controller, I use the viewer to read the voltages of the pH7 and pH10 calibration points, then I save them as constants to the database.
  #12  
Old 01/10/2008, 11:30 PM
gguertin gguertin is offline
Premium Member
 
Join Date: Mar 2004
Posts: 275
when doing this can you use any router or hub if I have an extra laying around.... Or is there something special about the one they offer that I would need to get that?

If you do this correctly couldnt you intern write a software program and use this as a tank monitor instead of buying a 400 dollar tank controller?
  #13  
Old 01/11/2008, 07:12 AM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
[QUOTE]Originally posted by gguertin
when doing this can you use any router or hub if I have an extra laying around.... Or is there something special about the one they offer that I would need to get that?/QUOTE]

You can't use an Ethernet hub for the 1-wire network. Very different protocols. For just a few 1-wire devices, a hub isn't really necessary.

Quote:
If you do this correctly couldnt you intern write a software program and use this as a tank monitor instead of buying a 400 dollar tank controller?
Yes, one could, and many have. For monitoring, there is no risk really. If you want it to control various functions, then you have to be much more careful in how you design it. Lots can go wrong if you aren't careful.
  #14  
Old 01/11/2008, 09:39 AM
gguertin gguertin is offline
Premium Member
 
Join Date: Mar 2004
Posts: 275
can you explain some of these risks or point me to a thread that has done this?

I am torn on buying one or making one... If one can be made affordably since I have a few computers lying around doing nothing that would be nice.. if it ends up the same it wouldnt be worth it..
  #15  
Old 01/11/2008, 07:19 PM
pista01 pista01 is offline
Registered Member
 
Join Date: Sep 2003
Location: Mi
Posts: 144
I don't have any of the threads bookmarked. A Google search should net some results to start with.

Like I said, monitoring is no risk at all. When you start controlling things like heaters and sump top-off is where the risk comes in. You have to decide how much risk you can live with. PCs are less reliable than something like a PLC. There is a lot more going on within the PC OS and hardware. Sure, a PC can run for months without a crash or reboot, especially if it's not doing anything. What happens if the OS crashes while the heater is on, or the sump is being topped off? Or the controller process itself dies? The more you control, the more things can go wrong. Basically it's all about risk management.
You can alleviate some risk by having fail safes outside the controller, like a heater set to 2 degrees higher than your set point plugged into the controller and a second heater not controlled by the controller set a couple degrees lower than your set point. A high level float switch could shut off your auto top-off in case the controller doesn't shut it down. Lights aren't so much of a big deal if they are left on or off for a day or so, but if you are on vacation for a week or so it could be. If the controller does die, how would you know?

Whatever you do, you'd have to think about failures and what effect they would have. Even if you don't have a controller and add water to the sump manually, one failure could be one's memory.

Building a controller is more of a hobby project than a way to save a few bucks. Of course in the end you'd have a controller that does exactly what you want, assuming it works the way you intended.
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -5. The time now is 06:27 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Use of this web site is subject to the terms and conditions described in the user agreement.
Reef Central™ Reef Central, LLC. Copyright ©1999-2009