Water level expansion coding

Do you have a question on how to do something.
Ask in here.
Post Reply
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

ReefAngel.SingleATO(true,Port1,60,0);
if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1);
if (ReefAngel.LowATO.IsActive()) ReefAngel.Relay.Off(Port2,5);

Something like that for the float switches?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water level expansion coding

Post by rimai »

Can you explain better how your logic would work?
Roberto.
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

Well the code I just posted there was my best guess at how to code the float switches to simply turn certain components off if the water level was low in the reservoirs.

The water change would be a completely different code. I would like to use the water level expansion for the water change.

When I select water change mode from the reef angel menu:
1. The ATO pump in port 1 would be deactivated (I already used the wizard to do this)
2. A pump in the sump (port 5) would be energized and pump water out of the sump until probably about 25% reading on the water level.
3. Once the water has been pumped out port 5 would be de-energized and a reef angel ATO pump would be energized on port 2. This pump would pump new salt water back into the sump back to the original level (currently 43% on my system)

Did that make a bit more sense than my first rambling? lol
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water level expansion coding

Post by rimai »

I have not tested, but try this:

Code: Select all

  static byte WC_status=0;
  /*
  0- No WC mode
  1- WC started, so port5 is on
  2- WC started and water has reached 25%, so port 5 is off and port2 is on
  3- WC started and water has reached 43%, so port 2 is off
  */ 
  
  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE && WC_status==0)
  {
    ReefAngel.Relay.On(Port5);
    WC_status=1;
  }
  if (ReefAngel.WaterLevel.GetLevel()<=25 && WC_status==1)
  {
    ReefAngel.Relay.Off(Port5);
    ReefAngel.Relay.On(Port2);
    WC_status=2;
  }
  if (ReefAngel.WaterLevel.GetLevel()>=43 && WC_status==2)
  {
    ReefAngel.Relay.Off(Port2);
    WC_status=3;
  }
  if (ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
  {
    WC_status=0;
  }
Roberto.
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

I can be the guinea pig on that one. It makes sense from reading it.

Is my coding correct in my post above for using the float switches as low water level indicators for my reservoirs? I just want to make sure that having the float switches plugged in doesn't try and override the water level module for the ATO function.

Thanks for you help. I'm really enjoying what I can do with this controller!
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

Just to let you know. I finally had a chance to test the water change coding and it works like a charm for anyone else who might be interested in using it! My ATO pump has to run for almost 20 minutes to get the water level back up but it works great.

Now I need to research a command that will automatically exit water change mode after its complete and find a way to display the water level on the water change screen.
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

So I am a bit stumped on how to add a timeout on the water change mode. I would like for it to do something similar to what happens when I push the feeding mode button. It just stays in that mode for the duration of the timer then exits after the timer expires.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water level expansion coding

Post by rimai »

Do you do anything else after port 2 turns off?
Is it better to just terminated the wc mode at that time?
Roberto.
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

Nope, once port 2 turns off I'm done with my water change.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water level expansion coding

Post by rimai »

Yeah, so if you are done, isn't it better to just quit wc mode instead of using a timer?
Roberto.
Ciwyn
Posts: 24
Joined: Tue May 21, 2013 6:18 pm

Re: Water level expansion coding

Post by Ciwyn »

Yes that is actually what I wanted it to do. Currently I have to quit water change mode manually and usually I have to reset my ATO timeout as well. I would like to find a way for it to quit WC mode automatically after the water change.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water level expansion coding

Post by rimai »

Change the 3rd stage to quit the mode to this:

Code: Select all

  if (ReefAngel.WaterLevel.GetLevel()>=43 && WC_status==2)
  {
    ReefAngel.Relay.Off(Port2);
    ButtonPress++;
    WC_status=3;
  }
Roberto.
Post Reply