Dosing pump code problem

Basic / Standard Reef Angel hardware
Post Reply
meadowsad
Posts: 53
Joined: Sat Jun 15, 2013 9:56 am

Dosing pump code problem

Post by meadowsad »

So I came home today and my dosing pump was stuck on... It should run for 20seconds every 30minutes. This is the code I am using

Code: Select all

  if (ReefAngel.Params.PH < 830)
  {
  ReefAngel.DosingPumpRepeat( DosePump,0,30,20 );
  }
Is there something wrong with this code? Currently When I set the relay to auto it just turns on right away. My PH reads 8.59... I have been using this code for a while and hadn't had an issue until today.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dosing pump code problem

Post by rimai »

Yes, you need to make sure to turn the relay off if you use a condition like that.
Your code should be like this:

Code: Select all

  if (ReefAngel.Params.PH < 830)
  {
    ReefAngel.DosingPumpRepeat( DosePump,0,30,20 );
  }
  else
  {
    ReefAngel.Relay.Off(DosePump);
  }
Roberto.
meadowsad
Posts: 53
Joined: Sat Jun 15, 2013 9:56 am

Re: Dosing pump code problem

Post by meadowsad »

Thanks for the quick response Roberto, I thought I may need to do that. Since this has been working for months without issue it led me to believe it wasn't needed.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dosing pump code problem

Post by rimai »

Yeah, you will only have an issue in the event that this order of events happen:
ph=8.29
Dosing pumps kicks in
If in less than 20 seconds ph goes up to 8.3, it will leave the relay on forever, because it never goes back to check the DosingPumpRepeat function again.
Roberto.
Post Reply