2024 Ohio Reef Frag Swap

2024 flyer

Author Topic: Temp and pH Controller  (Read 10028 times)

0 Members and 1 Guest are viewing this topic.

Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Temp and pH Controller
« on: November 26, 2009, 01:34:49 »
Hey guys, this project works together with Wes' controller but I thought I'd start a new thread to keep hardware and software separate.

This project is for a cheap temperature and pH controller and monitor. Shooting for under $25, but that won't get you the big screen I have ;)

The Idea:

To build a simple but fail-safe controller to monitor pH and trigger an output once to meets a limit. This could be a solenoid for your reactor or an outside air pump.

To build a redundant temperature controller using two separate probes whose values are compared to one another(with an alarm that warns if they are too far apart) and averaged together many times a second to give an accurate temperature reading.

How it is done:

The setpoints will be set(heh) by simple potentiometers. Simply press and hold one button to enter the "SET" mode. One pot for pH, one for low temperature limit and one for high temperature limit.

You will select if you'd like your pH relay to trigger above or below your setpoint ( but I haven't found a reason to trigger above it yet )

At your low temp setting a transistor will bias allowing you to supply your own voltage to power your relay for your heater, likewise for the high limit to turn on chiller or fans.

Any temperatures 2 degrees above or below your set points will sound an alarm (or bias a transistor)

The beauty of this system is, even if power is removed, once it is restored the controller already knows your set points and will take the correct measures to adjust the temp or pH.

If there is significant interest I may include logging capabilities, this will add a few dollars to the cost.

Without further adieu!

(yes, it is cold in my house)



Have a great Holiday everyone, I'm looking forward to your feedback!
Call me Mr. Rev. Dr.

Offline Rayman

  • Adult
  • ****
  • Posts: 304
Re: Temp and pH Controller
« Reply #1 on: November 26, 2009, 07:22:17 »
very cool, iiiiiiiiiiiiiiiiiiiiiiii like it!

Offline rayviv

  • Posts: 1,128
  • Here fishy, fishy.
Re: Temp and pH Controller
« Reply #2 on: November 26, 2009, 08:14:17 »
JD, I don't understand it but I like it. Great idea coming together, impressive! I'll take ten!! Or maybe just one to start ;D

The mind is a wonderful servant but a dangerous master!

slandis3

  • Guest
Re: Temp and pH Controller
« Reply #3 on: November 26, 2009, 08:26:29 »
Its comeing along very nice. how much would it cost to add the screen

Offline cyberwollf

  • 2010 FragSwap Chairman
  • Posts: 3,268
Re: Temp and pH Controller
« Reply #4 on: November 26, 2009, 10:31:07 »
Nice. I'm starting to get excited about the upcomming ozone gen diy!

You'll have to bring me up to speed on the arduino on sat
75G Mixed Reef w/ 30G sump/refuge

Electrical Engineers do it on impulse, with faster rise times, with more power, and less resistance at higher frequencies, without shorts, until it Hertz


Offline CoralBeauties

  • Lifetime Premium Member
  • Adult
  • *****
  • Posts: 1,804
Re: Temp and pH Controller
« Reply #5 on: November 26, 2009, 11:01:40 »
I would be interested in the temp controller.  I want to run a larger heater with my controller (aquajr) but want to have a failsafe incase the heater would become stuck on for some reason.
Jeff

Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #6 on: November 26, 2009, 11:17:23 »
very cool, iiiiiiiiiiiiiiiiiiiiiiii like it!

Thanks :)

JD, I don't understand it but I like it. Great idea coming together, impressive! I'll take ten!! Or maybe just one to start ;D

Its pretty simple Ray, you hook up your heaters and your fans to it and it keeps your tank temperature within a set range, and warns you if something goes haywire. The pH side can he as simple as simply giving you a realtime reading.

Its comeing along very nice. how much would it cost to add the screen

My goal was to us a 8x2 screen, that is 8 characters across on two rows. That way I could format the screen like

pH 8.20
79.2 OKY

But with this larger screen you could display multiple temps, like the temp in your hood or ambient temp. I got the bigger screen because I'm going to use it for other things also. Bottonm line is the larger screen will cost you about $5 more depending on the color and backlight.

Nice. I'm starting to get excited about the upcomming ozone gen diy!

You'll have to bring me up to speed on the arduino on sat

Me too, O3 is supposed to make your water crystal clear.

This language is super easy, here is a (non-working) program

Quote
/*
pH and temp controller
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int sensorPin = 0;
int temp;
int count = 5;
int average = 0;
int var;

void setup() {
  Serial.begin(9600);
  // set up the LCD's number of rows and columns:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("  Hello, Ohio Reef!");
}

void loop() {

while (count > 0){
    int reading = analogRead(sensorPin);
     float voltage = reading * 5.0 / 1024;
     float var = (((voltage - 0.5) * 100) * 9 / 5) + 32;
     
      average = var + average;
        count --;
    Serial.println(count);
    Serial.println(average);
    Serial.println(reading);
    
  delay(5000);}

 temp = (average / 5);
 count = 5;
 average = 0;
  
  // set the cursor to column 0, line 1
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(temp);
}


Writing serial data is as easy as Serial.print("message");

The LCD is much the same also:

lcd.print("  Hello, Ohio Reef!");

I would be interested in the temp controller.  I want to run a larger heater with my controller (aquajr) but want to have a failsafe incase the heater would become stuck on for some reason.
Jeff

Great! I am all about redundancy also. This code will be tested an absurd amount to make sure everything checks out :)
Call me Mr. Rev. Dr.

RTN_H8ter

  • Guest
Re: Temp and pH Controller
« Reply #7 on: November 26, 2009, 12:00:19 »
Nice. I'm starting to get excited about the upcomming ozone gen diy!

You'll have to bring me up to speed on the arduino on sat

I have everything to build my ozone generator. I'm just too lazy to put it together. Plus lighting fluorescent bulbs 5 feet away kinda freaks me out.

Offline lazylivin

  • Administrator
  • Adult
  • *****
  • Posts: 11,471
Re: Temp and pH Controller
« Reply #8 on: November 26, 2009, 12:04:12 »
Great job guys, it is coming together very nicely

Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #9 on: November 26, 2009, 12:16:35 »
Great job guys, it is coming together very nicely

Thanks Brian. Not to shabby considering I only for the uC yesterday night at about 7 :)
Call me Mr. Rev. Dr.

Blown76mav

  • Guest
Re: Temp and pH Controller
« Reply #10 on: November 26, 2009, 13:33:33 »
Looks good, to bad it probably won't work with a MAC :(

Offline cyberwollf

  • 2010 FragSwap Chairman
  • Posts: 3,268
Re: Temp and pH Controller
« Reply #11 on: November 26, 2009, 14:40:57 »
Looks good, to bad it probably won't work with a MAC :(


not trying to speak for Josh, ;) but I think we are leaning more towards running it like a normal controller with the CPU only as an added logging/display device. So you're in luck
75G Mixed Reef w/ 30G sump/refuge

Electrical Engineers do it on impulse, with faster rise times, with more power, and less resistance at higher frequencies, without shorts, until it Hertz


Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #12 on: November 26, 2009, 21:30:25 »
Looks good, to bad it probably won't work with a MAC :(


Actually Lonnie, this is completely hardware based so no computer is required. If I implement logging, you're still in luck! the IDE (development software) runs in *nix, MAC and PC so it will work fine. Logging will be pretty rudimentary at best, plug in the controller, run the IDE software, tell the controller to transfer the data and then it just spits out the readings with some time/date info along side it.

not trying to speak for Josh, ;)

Isn't that like speaking for yourself also?  :laugh:
Call me Mr. Rev. Dr.

Offline hamiltro

  • Juvenile
  • ***
  • Posts: 248
Re: Temp and pH Controller
« Reply #13 on: November 26, 2009, 23:54:02 »
sign me up for one, cant wait to see the finished project
55 gal working on upgrading to 120 with a 55 Sump(unless I find a deal on a bigger tank)

Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #14 on: November 27, 2009, 01:39:41 »
I don't know how happy I am with these temperature sensors..

Moment to moment they vary by about +/-1.5* F. However since most errors on things like this go positive as equally as they go negativity I have been averaging 60 reading together to get a temp. I don't have anything really accurate to compare too. I will do the ice-water test once I have one water proofed :). Digital sensors exist but are a pain to use. It takes about 5 lines of code to read this sensor, digital ones take about 50.  ::)

Once I have some sensors water-proofed I'll get more accurate results to refute or confirm my suspicion. In any case these are working for now so work has begun on the set-points and alarms. Will post details when they exist.

Anyone want to confirm they'll buy one?  :laugh:

Call me Mr. Rev. Dr.

Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #15 on: November 27, 2009, 02:13:51 »
Set-points... uhh... set.

How come I always work when everyone else is asleep? That make me like Santa?
Call me Mr. Rev. Dr.

Offline HUNGER

  • Posts: 4,551
Re: Temp and pH Controller
« Reply #16 on: November 27, 2009, 08:24:01 »
no ur the elf  ;D ;D ;D
SIZE DOES MATTER

Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #17 on: November 27, 2009, 10:32:51 »
no ur the elf  ;D ;D ;D

I see how it is.... ;)


HI and Lo set-points are done, as well as status messages. Status messages are OKAY for temp in range. WARN for temp above or below the set-points, when the heater/chiller outputs turn on. and ALRM when the temp is 2 degrees over or under the setpoints. All of these measurements are taken and compared to the status multiple times to prevent frequent cycling of your equipment. The heater/chiller output stay on until the temp reaches the middle of your setpoints

Now that I got 4 hours of sleep, I'm off to work...
Call me Mr. Rev. Dr.

Offline cyberwollf

  • 2010 FragSwap Chairman
  • Posts: 3,268
Re: Temp and pH Controller
« Reply #18 on: November 30, 2009, 20:34:01 »
OK, heres a pic of my test.  Not getting the exact results i want:

1. No flow, so water temp is not uniform.
2. I covered the sensor in epoxy, heatshrink tubing, and more epoxy (overkill maybe, but its watertight  ;D) But i think it is insulted too much, rising temperature readings lag behind my meat thermometer.

Very simple drive circuit (about 99% of the crap on the breadboard is just there becuase im too lazy to disassemble other projects.

Reading a Temp probe, is exactly like reading a pH and other probes, so the project is actually making much bigger jumps than just temp.

I'll post a graph when i get the kinks worked out.

75G Mixed Reef w/ 30G sump/refuge

Electrical Engineers do it on impulse, with faster rise times, with more power, and less resistance at higher frequencies, without shorts, until it Hertz


slandis3

  • Guest
Re: Temp and pH Controller
« Reply #19 on: November 30, 2009, 20:51:55 »
I have titanium tubing and 2part epoxy to seal the probe in. I have 1 pc sitting here now and Ill get anothe couple pieces tomorrow at work.

Offline Wall_Tank

  • Administrator
  • Adult
  • *****
  • Posts: 3,754
Re: Temp and pH Controller
« Reply #20 on: November 30, 2009, 20:59:04 »
OK, heres a pic of my test.  Not getting the exact results i want:

1. No flow, so water temp is not uniform.
2. I covered the sensor in epoxy, heatshrink tubing, and more epoxy (overkill maybe, but its watertight  ;D) But i think it is insulted too much, rising temperature readings lag behind my meat thermometer.

You should insulate the probe, as to slow the response to temperature changes.   Also, remember you have a huge heater for your water volume, and no flow.   So I would very much expect you to have control problems that you'll never see in a tank.    I would worry about things like......calibration....and does it go off and on when you want.

Offline cyberwollf

  • 2010 FragSwap Chairman
  • Posts: 3,268
Re: Temp and pH Controller
« Reply #21 on: November 30, 2009, 21:57:35 »
You should insulate the probe, as to slow the response to temperature changes.   Also, remember you have a huge heater for your water volume, and no flow.   So I would very much expect you to have control problems that you'll never see in a tank.    I would worry about things like......calibration....and does it go off and on when you want.

Of course this would be worse case.. I in the tank +100 gallons of water make a pretty nice thermal body.  ;D

Ok i moved it to a bucket with a pump and a little water, but i think the pump was putting out enough heat to keep the water at temp (only a few degrees above room temp)

I'll try it again tomorrow with a full bucket of water and let it run longer. Heres the graph from today: "On or Off" just shows when the heater was on or off, The numbers are arbitrary, just wanted to log its state. 

all the logic works great  ;D Also I am only sampleing one every 5 seconds. I could get better readings by taking many every second and averaging them.

75G Mixed Reef w/ 30G sump/refuge

Electrical Engineers do it on impulse, with faster rise times, with more power, and less resistance at higher frequencies, without shorts, until it Hertz


Offline jd

  • Dr. Skimmer
  • Posts: 1,935
Re: Temp and pH Controller
« Reply #22 on: December 02, 2009, 22:58:27 »
Got some more work done on my controller (which has 100% more LCD screens than Wes' does  ;D )

It works in the following manner, I'd like to hear your comments on it.

You set your low temp point to 74* and your high temp point to 84*

If your tank falls below 74* your heater turns on.

Your heater remains on until the temperature reaches 79* (this is the point halfway between your two set points)

This of course all works in the opposite manner as well.

Anyone have any features they would like to suggest?

Will had a good suggestion of a "cold house" setting. If our home is cold due to you being away and one heater isn't enough, the controller would see how long it has been since it turned it on, and turn on another one to speed the heating of your tank.

What temperatures are you running your tanks at? How much of a 'swing' would you like?
Call me Mr. Rev. Dr.

Offline lazylivin

  • Administrator
  • Adult
  • *****
  • Posts: 11,471
Re: Temp and pH Controller
« Reply #23 on: December 02, 2009, 23:29:28 »
I have my controller set to turn the heater on at 78.5 and below so there is no high point to avoid swings. Tanks is always 78.5
If temperature reaches 80 fans kick on until temperature drops to 79.5 so have high and low point
If temperature reaches 82 lights shut off and wont turn back on unless I reset to signal tank temperature was breached

With temperature consistency is key. So if tank wants to naturally peak at 80 I would recommend setting heater to 80. A fluctuation of 4 degrees in 24 hour period is to much. Some may get it away with that however the fish and corals would do better with more stability.

Offline cyberwollf

  • 2010 FragSwap Chairman
  • Posts: 3,268
Re: Temp and pH Controller
« Reply #24 on: December 03, 2009, 00:11:37 »
On the idea of controlling multiple heater independently it would be fairly simple to implement some fuzzy logic: Depending on how far you are from optimal temp determines how many heaters turn on. I.e. It may only take one heater to maintain temp, but if you add cold top off water or for some other reason temp drops lower than normal multiple heaters kick in to keep it at setpoint.


I don't really understand the your idea on the setpoints.... If it turns back off at 79 why isn't that the setpoint? What are you trying to do that 2 setpoints a few degrees apart can't?
75G Mixed Reef w/ 30G sump/refuge

Electrical Engineers do it on impulse, with faster rise times, with more power, and less resistance at higher frequencies, without shorts, until it Hertz


 

Powered by EzPortal