Apex Programming - Optical Sensor Verification
I'm adding a mini-tutorial here for a new situation I ran into with my ATK last night. At 3am I received a Fusion alarm notification on my phone stating that my salinity had dropped below 32 ppt. I quickly got up to check the tank, and found that the water level in my sump was so low that the salinity probe was no longer in the water and exposed to the air. There were no leaks, so I checked my ATK logs and found that the PMUP had not run in the past 14 hours, so the missing water was just due to evaporation:
I wiped my ATK_Lo sensor and suddenly the PMUP turned on, so I was pretty sure the sensor was just dirty. However, this made me realize I didn't have any automation set up to account for this condition. I do have a virtual output that monitors if the ATK_Lo sensor is Open but the PMUP doesn't run within 90 minutes as a failsafe if I ever accidently leave the PMUP slider set to OFF:
[AlertATO_Off]
Set OFF
If ATK_LO OPEN Then ON
Defer 090:00 Then ON
But this situation was different. The ATK_Lo sensor was dry, but because it was dirty it still reported Closed. I could have created a similar timer to report if it's Closed for too long, but there are many times where I might have extra water in the sump (sometimes I add a gallon or two of extra salt water to increase the salinity to account for lost skimmate), so I don't want false alarms to nag me in that situation where ATK_Lo is Closed correctly.
Then I came up with this idea:
I have a 4-float switch bracket in my sump to monitor for various water level conditions:
Sump_6 = The sump is about to overflow
Sump_5 = The water is above the skimmer chamber
Sump_4 = Normal water level
Sump_3 = The water is too low for my return pump
(I wrote about this
float switch bracket in my build thread)
I decided to create a new virtual output that will compare my ATK_Lo sensor reading with the Sump_4 float switch reading. Since they are both a the same "normal" water level, they should both report Closed under normal circumstances:
When water evaporates, both Sump_4 and ATK_Lo should report Open, and ATK_Lo triggers the PMUP to turn On:
However, last night's situation was due to the ATK_Lo sensor reporting Closed even though the water was low, so it did not turn on the PMUP. At the same time, the Sump_4 float switch reported Open, which was the correct reading:
So I created a new virtual output that compares ATK_Lo to Sump_4, and if they don't match after a period of time, it sends me an alarm notification:
[ATK_Lo_Fail]
Set OFF
If ATK_LO CLOSED Then ON
If Sump_4 CLOSED Then OFF
Defer 030:00 Then ON
I then added it to my EmailAlm program:
If Output ATK_Lo_Fail = ON Then ON
For now I'm just going to have it alert me. I may consider adding this code to my PMUP output to actually turn on in this condition, but uncertain if I want to go that far:
[ATK_PMUP]
Fallback OFF
Set OFF
If ATK_LO OPEN Then ON
If Output ATK_Lo_Fail = ON Then ON
If ATK_HI CLOSED Then OFF
If Output Maintenance = ON Then OFF
When On > 003:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 030:00 Then OFF
I think I'd rather just be alerted so I can manually investigate.
I hope idea this helps others with ideas on how to double-check your optical sensors.
Happy reefing!