My Neptune Apex web interface compatible DIY reef controller

currently checkATO function is called once per second. Looking at my outlet logs, my ato pump usually comes on 20 seconds or more, though I don't have much turbulence in my sump return section.

you can modify the code to check it at a different interval. That will give you the same effect. The interval will then be the minimum amount of time the ato pump comes on when triggered. One way to do this is to add a static int counter and call checkATO only once counter reach the interval you want.

Code:
static int counter=0;
if (counter++>=60) {
checkATO();
counter=0;
}
the above will call checkATO once every minute instead of once every second.

That should work....but can you give me a little more help where that code would be placed.....? Having a little trouble identifying location.
 
d0ughb0y,

I didn't get a chance to change the code yesterday for the ATO, but I woke up this morning to check my frag tank (where I have my controller doing test runs) but the LCD was not changing the display. Looks like it froze around 2am. Anyway what it must have done is freeze while heater and ato was on because my ato container was empty and when I reset the unit my temp is sitting at 82. In the outlet logs last entry was ATO. Do you think the rapid on/off of the ATO because of the float could overwhelm the processor? Only thing I can find in the controller log is an entry for CRC mismatch at about 1am. What would that be?

I loaded the changes for the ATO will monitor the logs to see if it helps.

Your thoughts?
 
Last edited:
Do you have MOV installed across your outlet hot and neutral?

I use these
http://www.digikey.com/<wbr>product-detail/en/MOV-<wbr>07D201KTR/MOV-07D201KTRCT-ND/<wbr>2408228

I personally have not seen this problem, but I have the MOV installed on all 8 outlets. I also do not see the turbulence issue, perhaps because my float switch has the slosh guard, but I think even if it does not, my return area water looks pretty stable. In your setup, is the water bobbing up and down constantly where the float switch is installed?

I'll update the schematic notes to say the MOVs are not optional and must be installed.
 
Last edited:
I am using an un-modified Chauvet with 2803. The logs showed my ato turning on/off every few seconds. This tank does not have a sump so the float is in the main tank. I do have a skimmer in it so that is the main source of the surface turb.

I changed the code is am.... so far so good. I will do more testing with it later to verify how the code is working.
 
perhaps the switching of ATO pump is causing transient spikes on the AC line affecting the power to the arduino. Sorscode had exact same problem and was solved by adding the MOV. I think with the 1 minute interval change, it should fix the problem. If you still see the problem, then get the MOV, they cost about $3.50 shipped for 10 pcs.
 
I just did some testing. I am not seeing the delay as expected. As soon as I lift the float and it closes the pump comes on. Shouldn't I see the 1 min delay?
 
I just got the LED power supply I ordered. It took only 3 days from China. If this becomes more common, US sellers will have less business. If the delivery is via ePacket, it is really fast. I ordered a heatsink from Tigerdirect, and it took 10 days to get here. They use UPS. I know 20 years ago, 10 business days delivery from coast to coast for UPS is pretty fast. By today's standard, it is slow. USPS takes 3 days coast to coast.

I also found out Mouser still has LDD in stock. The reason I did not find any was they mis-cataloged the part as SMD. I emailed them and they fixed it. I'm ordering the LDDs from Mouser.
 
I just did some testing. I am not seeing the delay as expected. As soon as I lift the float and it closes the pump comes on. Shouldn't I see the 1 min delay?


the way the new code works, as soon as the float goes down, it starts the pump, and the pump stays on for 1 minute.
moving the float up is not supposed to turn on the pump, unless you modified the checkATO function in Interrupts.ino.

ok, I see what you mean by lifting the float, you pull the float out of the water. yes, in that case, it will immediately turn on the ato pump, but it will remain on for 1 minute even if you put the float back into the water.
 
the way the new code works, as soon as the float goes down, it starts the pump, and the pump stays on for 1 minute.
moving the float up is not supposed to turn on the pump, unless you modified the checkATO function in Interrupts.ino.

ok, I see what you mean by lifting the float, you pull the float out of the water. yes, in that case, it will immediately turn on the ato pump, but it will remain on for 1 minute even if you put the float back into the water.

I did load without errors, but I will do again to make sure and then test.
 
Reloaded...also tried on my test unit. Same ...timer not working.

what do you mean by not working. are you expecting this to work exactly as apex? it will not, as this code works differently but achieves the same objective.

does it stop the ato pump as soon as you move the float up?
 
what do you mean by not working. are you expecting this to work exactly as apex? it will not, as this code works differently but achieves the same objective.

does it stop the ato pump as soon as you move the float up?

No delays. If I close switch - LCD shows Closed and Outlet comes on immediately. If I open switch - LCD shows Open and Outlet goes off.

No delays.
 
I'm not sure why it does not work.

Try this, in outlets.ino, search for line

inline void outletHandlerB() { //once per second handler

and change it to

void outletHandlerB() { //once per second handler

this is in addition to the change you already made.

if it still does not work, please email me your outlets.ino file.
 
your changes are fine. I'll test this when I get home today.
The only thing I can think of is maybe some arduino idiosyncrasy on using static in ino file causing this to not work.
 
I tested it and it works exactly as I described.
The ATO switch status under Inputs will show the actual state of the ATO switch, but the control of the ATO pump is exactly as I described. You just assumed that the pump will go on and off by simply looking at the state of the switch. You should look at the actual state of the ATO pump under outlets.

A simpler change is to replace checkATO() in outletHandlerB to

Code:
if (secnow==0) {
checkATO();
}
This will do the ATO routine only on the minute (when seconds is at 0).

What you want is for the ATO pump to turn on a full minute before turning off and that is exactly what the code change does.
 
I tested it and it works exactly as I described.
The ATO switch status under Inputs will show the actual state of the ATO switch, but the control of the ATO pump is exactly as I described. You just assumed that the pump will go on and off by simply looking at the state of the switch. You should look at the actual state of the ATO pump under outlets.

A simpler change is to replace checkATO() in outletHandlerB to

Code:
if (secnow==0) {
checkATO();
}
This will do the ATO routine only on the minute (when seconds is at 0).

What you want is for the ATO pump to turn on a full minute before turning off and that is exactly what the code change does.

d0ughb0y,

Thanks for testing but I must have something else wrong. Both on my test unit and the one I have running with pump in my hand does this:

You close ato switch and status of ato changes, and state of outlet changes without any delays. You open switch and state of ato changes and outlet changes without delays. My frag unit, I verified the pump state is as described.

And if you reset the unit the ATO runs for 1 min before it turns off after it boots.
 
d0ughboy,

If possible what I would like it to do is this.

The ato has to be in a closed state for an entire minute before if changes the outlet on. Then when it does go on I want it to run for a min $value lets say 1 min.

CheckATO would still run every sec. but

CheckATO if switched closed start the timer.
CheckATO if switch open resets the timer
CheckATO when timer reaches $Value turn outlet on and start timer and after timer reaches $Value2 turns outlet off.

I think this will also fix the ato on for a min when it is reset.
 
Back
Top