ATO available at set times during day
-
Sebyte
ATO available at set times during day
I have just started to setup my new Reef Angel using RAGen. I have also read through loads of old postings to see if what I need has been already covered, and could not find anything that would help.
I use a Kalkwasser system that has a stirrer to mix up the slurry. At the moment I use two digital time switches, one to run the stirrer and the second to allow power to the ATO controller. They are timed so that they are never both on at the same time, and that there is a settling period for the Kalk between the two events.
At the moment I only have one port on the RA free for the ATO pump, and I will be asking Santa for an expansion box. But for the time being I want to use an external T/S for the stirrer and RA for the ATO. I hope I have not confused anyone so far.
So the question is how do I set up the ATO so that it is only available for one hour at a time, six time per day?
Many thanks
I use a Kalkwasser system that has a stirrer to mix up the slurry. At the moment I use two digital time switches, one to run the stirrer and the second to allow power to the ATO controller. They are timed so that they are never both on at the same time, and that there is a settling period for the Kalk between the two events.
At the moment I only have one port on the RA free for the ATO pump, and I will be asking Santa for an expansion box. But for the time being I want to use an external T/S for the stirrer and RA for the ATO. I hope I have not confused anyone so far.
So the question is how do I set up the ATO so that it is only available for one hour at a time, six time per day?
Many thanks
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: ATO available at set times during day
The math on this is:
Check if the remainder of the division of hour and 4 is equal to 0. If so, you turn the ATO function on.
This will cause the check to be true every four hours.
Try this:
Check if the remainder of the division of hour and 4 is equal to 0. If so, you turn the ATO function on.
This will cause the check to be true every four hours.
Try this:
Code: Select all
if (hour%4==0) SingleATO(Port1); else ReefAngel.Relay.Off(Port1);
Roberto.
-
Sebyte
Re: ATO available at set times during day
Thanks for that, but how will I know the real time for the start of the timed period? I need to know that so I can set the on periods for the external time switch for the stirrer.
Or is the number in the equation equal to the start time in hours (24)?
Or is the number in the equation equal to the start time in hours (24)?
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: ATO available at set times during day
Yes, every 4 hours.
0%4=0 ->ATO works
1%4=1 ->ATO does not work
2%4=2 ->ATO does not work
3%4=3 ->ATO does not work
4%4=0 ->ATO works
5%4=1 ->ATO does not work
6%4=2 ->ATO does not work
7%4=3 ->ATO does not work
8%4=0 ->ATO works
9%4=1 ->ATO does not work
10%4=2 ->ATO does not work
11%4=3 ->ATO does not work
12%4=0 ->ATO works
13%4=1 ->ATO does not work
14%4=2 ->ATO does not work
15%4=3 ->ATO does not work
16%4=0 ->ATO works
17%4=1 ->ATO does not work
18%4=2 ->ATO does not work
19%4=3 ->ATO does not work
20%4=0 ->ATO works
21%4=1 ->ATO does not work
22%4=2 ->ATO does not work
23%4=3 ->ATO does not work
The ATO will work for the whole hour.
Check modulo calculation here:
http://arduino.cc/en/Reference/Modulo
0%4=0 ->ATO works
1%4=1 ->ATO does not work
2%4=2 ->ATO does not work
3%4=3 ->ATO does not work
4%4=0 ->ATO works
5%4=1 ->ATO does not work
6%4=2 ->ATO does not work
7%4=3 ->ATO does not work
8%4=0 ->ATO works
9%4=1 ->ATO does not work
10%4=2 ->ATO does not work
11%4=3 ->ATO does not work
12%4=0 ->ATO works
13%4=1 ->ATO does not work
14%4=2 ->ATO does not work
15%4=3 ->ATO does not work
16%4=0 ->ATO works
17%4=1 ->ATO does not work
18%4=2 ->ATO does not work
19%4=3 ->ATO does not work
20%4=0 ->ATO works
21%4=1 ->ATO does not work
22%4=2 ->ATO does not work
23%4=3 ->ATO does not work
The ATO will work for the whole hour.
Check modulo calculation here:
http://arduino.cc/en/Reference/Modulo
Roberto.
-
Sebyte
Re: ATO available at set times during day
Thanks Roberto, that now makes sense. When I buy another relay box I will be able to put the Kalk stirrer on to a port and use the same code to control the second port.
I may have other questions later regarding the moon phase code.
Thanks again.
I may have other questions later regarding the moon phase code.
Thanks again.
-
binder
- Posts: 2865
- Joined: Fri Mar 18, 2011 6:20 pm
- Location: Illinois
- Contact:
Re: ATO available at set times during day
Yes you will. Instead of using Port1, you would use something like Box1_Port1 or Box1_Port2, etc. for the other ports on the additional relay box.Sebyte wrote:Thanks Roberto, that now makes sense. When I buy another relay box I will be able to put the Kalk stirrer on to a port and use the same code to control the second port.
Thanks again.
curt
-
Sebyte
Re: ATO available at set times during day
I have tried the code suggested above and I get
error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
I inserted the code like this in my PDE:-
void loop()
{
// Specific functions
ReefAngel.StandardATO(Port2);
ReefAngel.StandardHeater(Port3);
ReefAngel.StandardFan(Port4);
ReefAngel.Wavemaker1(Port5);
ReefAngel.StandardLights(Port7);
ReefAngel.MHLights(Port8);
// ATO available 6 times per day
if (hour%4==0) SingleATO(Port1); else ReefAngel.Relay.Off(Port1);
ReefAngel.ShowInterface();
}
Is hour an Arduino function, or does it have to be declared in some way? OR have I put the code snip it in the wrong place?
Also can you suggest an entry level primer for Arduino programming.
Thanks
error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
I inserted the code like this in my PDE:-
void loop()
{
// Specific functions
ReefAngel.StandardATO(Port2);
ReefAngel.StandardHeater(Port3);
ReefAngel.StandardFan(Port4);
ReefAngel.Wavemaker1(Port5);
ReefAngel.StandardLights(Port7);
ReefAngel.MHLights(Port8);
// ATO available 6 times per day
if (hour%4==0) SingleATO(Port1); else ReefAngel.Relay.Off(Port1);
ReefAngel.ShowInterface();
}
Is hour an Arduino function, or does it have to be declared in some way? OR have I put the code snip it in the wrong place?
Also can you suggest an entry level primer for Arduino programming.
Thanks
-
wolfador
- Posts: 241
- Joined: Sun Sep 04, 2011 9:59 am
- Location: Pittsburgh, PA
Re: ATO available at set times during day
I think it would be:
Hour is a function not a variable, the function returns an int with the value of the current hour. Which can then be used in the MOD equation with the int of 4 and compared to the int of 0.
Code: Select all
void loop()
{
// ATO available 6 times per day
if (hour() % 4 == 0) {
SingleATO(Port1);
}
else {
ReefAngel.Relay.Off(Port1);
}
}-
Sebyte
Re: ATO available at set times during day
John
Thank you for the advice. When I added the code I got errors, so I played around and found that the following compiled.
I now need to do some testing to make sure that I have the available times set correctly to work with my Kalk reactor.
I think my problem at the moment is that I don't understand the syntax and use of the Brace. Also the () following a function. Is there a reference guide to these basic concepts?
Also any idea when your iPad app will be available? I tried out the iPhone version over the weekend and it is great, but a dedicated iPad version will be welcome.
Many thanks.
Thank you for the advice. When I added the code I got errors, so I played around and found that the following compiled.
There were two things that I changed. First I have port 2 set for ATO, and secondly it was set as ReefAngel.StandardATO(Port2) and not SingelATO(Port1), which has not been declared.// ATO available 6 times per day
if (hour() % 4 == 0) {
ReefAngel.StandardATO(Port2);
}
else {
ReefAngel.Relay.Off(Port2);
}
I now need to do some testing to make sure that I have the available times set correctly to work with my Kalk reactor.
I think my problem at the moment is that I don't understand the syntax and use of the Brace. Also the () following a function. Is there a reference guide to these basic concepts?
Also any idea when your iPad app will be available? I tried out the iPhone version over the weekend and it is great, but a dedicated iPad version will be welcome.
Many thanks.
-
wolfador
- Posts: 241
- Joined: Sun Sep 04, 2011 9:59 am
- Location: Pittsburgh, PA
Re: ATO available at set times during day
The iPad app was approved earlier today and should now be available, ReefAngel-HD. Let me know if you don't see it.Sebyte wrote:
I think my problem at the moment is that I don't understand the syntax and use of the Brace. Also the () following a function. Is there a reference guide to these basic concepts?
Also any idea when your iPad app will be available? I tried out the iPhone version over the weekend and it is great, but a dedicated iPad version will be welcome.
Many thanks.
How I define it the Braces { } are to define a function or a series of commands. You could add other commands inside of the braces here:
if (hour() % 4 == 0) {
ReefAngel.StandardATO(Port2);
//Next command
}
and the braces tell the program to only run those commands when the statement is true.
The parenthesis () at the end of a function are there incase the function receives a variable, that is where you would put it. Like: ReefAngel.Relay.Off(Port2). The Relay.Off function is configured to receive a variable so it knows which relay you want to turn off. In this case the variable is Port 2.
I hope this makes a bit more sense but I could just be rambling because I no expert
-
Sebyte
Re: ATO available at set times during day
No problem, your comments are welcome and (I hope
) understood.
Just checked and the app is not there yet, I will try again later.
Just one more question, if you don't mind. How are the ATO switches wired. Independently or in series. Also if individually which one plugs into which port? I have not found any wiring diagrams on the board.
Again you have been very helpful, as have the others I have had contact with.
Just checked and the app is not there yet, I will try again later.
Just one more question, if you don't mind. How are the ATO switches wired. Independently or in series. Also if individually which one plugs into which port? I have not found any wiring diagrams on the board.
Again you have been very helpful, as have the others I have had contact with.
-
wolfador
- Posts: 241
- Joined: Sun Sep 04, 2011 9:59 am
- Location: Pittsburgh, PA
Re: ATO available at set times during day
Try: http://itunes.apple.com/ca/app/reefange ... ?mt=8&uo=4
This is for the Canada iTunes Store. It shows up in a search in the US store.
This is for the Canada iTunes Store. It shows up in a search in the US store.
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: ATO available at set times during day
This should help:
http://forum.reefangel.com/viewtopic.php?f=7&t=240
If you still have questions, let me know.
http://forum.reefangel.com/viewtopic.php?f=7&t=240
If you still have questions, let me know.
Roberto.
-
Sebyte
Re: ATO available at set times during day
Hi Roberto
I must be having a seniors moment, I had already read that post, but it did not say if the two switches were in series or wired separately, also if they are wired separately which one goes into which ATOport, or perhaps it does not matter.
Thanks
I must be having a seniors moment, I had already read that post, but it did not say if the two switches were in series or wired separately, also if they are wired separately which one goes into which ATOport, or perhaps it does not matter.
Thanks
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: ATO available at set times during day
Oh, if you are using the StandardATO() function, you use both and connect one in each port. The high float switch is the closest to the pH probe and the low is the furthest.
If you are using SingleATO, you only need one switch and you connect to whichever one you choose, high or low. If you would like to use the second one as a safety one, you would wire it in series and place the second one above the other. It would never be used, unless the lower one fails for some reason.
If you are using SingleATO, you only need one switch and you connect to whichever one you choose, high or low. If you would like to use the second one as a safety one, you would wire it in series and place the second one above the other. It would never be used, unless the lower one fails for some reason.
Roberto.
-
Sebyte
Re: ATO available at set times during day
Thanks for that, I think I will go with the two in series for redundancy.

