Page 1 of 1
Nilsen reactor
Posted: Thu May 02, 2013 1:21 pm
by johniii
This weekend I will be getting a mrc Nilsen reactor.
I need to set my ato so that if the reactor has run in the last thirty minutes it won't turn on the pump. How would one go about coding this?
Sent from my DROID RAZR using Tapatalk 2
Re: Nilsen reactor
Posted: Thu May 02, 2013 1:38 pm
by rimai
How do you turn your reactor on/off?
Re: Nilsen reactor
Posted: Thu May 02, 2013 1:44 pm
by johniii
Going to use port 1 on a schedule
Sent from my DROID RAZR using Tapatalk 2
Re: Nilsen reactor
Posted: Thu May 02, 2013 2:03 pm
by rimai
Can you post an example?
Re: Nilsen reactor
Posted: Thu May 02, 2013 2:22 pm
by johniii
Haven't wrote the code yet. But will be port 1 on every hour for 5 mins.
I guess I need a if else statement for the ato.
Just don't need the ato to come on if the reactor has just stirred the kalk.
Re: Nilsen reactor
Posted: Thu May 02, 2013 2:24 pm
by rimai
That would mean you only want the ATO to work the last 25min of every hour, right?
Re: Nilsen reactor
Posted: Thu May 02, 2013 2:59 pm
by johniii
Yes that should work
Nilsen reactor
Posted: Thu May 02, 2013 3:02 pm
by binder
if you are going to run port 1 for 5 minutes every hour on a schedule, then you could use the dosingpumprepeat functions.
Re: Nilsen reactor
Posted: Thu May 02, 2013 3:10 pm
by rimai
Try this and see if it works:
Code: Select all
if (now()%3600<2100)
{
ReefAngel.Relay.Off(Port2);
ReefAngel.LowATO.Timer=millis();
}
else
{
ReefAngel.SingleATO(true,Port2,60,0);
}
Re: Nilsen reactor
Posted: Thu May 02, 2013 3:16 pm
by johniii
rimai wrote:Try this and see if it works:
Code: Select all
if (now()%3600<2100)
{
ReefAngel.Relay.Off(Port2);
ReefAngel.LowATO.Timer=millis();
}
else
{
ReefAngel.SingleATO(true,Port2,60,0);
}
Will try it and see.
But for the sake of me learning and not having to bug you guys, what do the numbers on the first line mean
Re: Nilsen reactor
Posted: Thu May 02, 2013 3:35 pm
by rimai
It's seconds.
3600 = 1 hour
2100 = 35 minutes
% is a mathematical operation called modulo:
http://arduino.cc/en/Reference/Modulo
Re: Nilsen reactor
Posted: Thu May 02, 2013 3:37 pm
by johniii
Thanks Roberto that's what I needed to know
Helpful as always