Logic based on pH

Do you have a question on how to do something.
Ask in here.
Post Reply
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Logic based on pH

Post by btorrenga »

I want to run a function only if pH is less than 8.0. Is the proper way to do so something like the following syntax? I guess my question really is "how do I query pH?"

Code: Select all

  if (ReefAngel.Params.PH() < 800)
    ReefAngel.Relay.On(Box1_Port6;
  else
    ReefAngel.Relay.Off(Box1_Port6);
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Logic based on pH

Post by lnevo »

Yes but there is a problem with that. The probes fluctuate a lot so it will flicker between 799-801 for instance changing every few ms. The logic you have will turn that port on and off a lot.

We have a function you can use similar to the heater function

ReefAngel.PHControl(relay, lowph, highph);

This will allow you to set a range for when it turns on to when it turns off.

This function turns the device on when ph <= lowph and off when ph >= highph

There is another function CO2Control that takes the same args but does the opposite.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: Logic based on pH

Post by btorrenga »

Hmm, ok, I have some things to work through then.

When inputting values into the portal for pH on and off, would I enter 8, or 800? (or 8.3 and 830?)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Logic based on pH

Post by lnevo »

If you use the portal to set the values you need to call the function with just the relay argument.

I'm not sure the syntax in the portal
Post Reply