reef-pi :: An opensource reef tank controller based on Raspberry Pi.

OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
This is a great discussion. I take failsafes very seriously because of frequent power and or internet outtages. Some things that help right now in my case:

1. Adding a Real time clock...this allows the pi to keep time if it reboots when the internet is down.

2. Equipment outlets...i used a relay module so I have normally open and normally closed contacts on each relay. If I want something to fail in the ON position if reef pi is down, I wire the outlet to the normally closed contact. If I want it to fail in the OFF position, I wire the outlet to a normally open contact.

3. Redundancy. Dont rely on one system or sensor for very important systems. This also goes along with what i did for equipment outlets. A great example is heaters. Running a heater without a thermostat with reef pi as exclusive control is asking for trouble. I use heaters with thermostats set for 80. They plug into equipment outlets that are wired on normally closed relay contacts. If reef pi fails, heaters work as normal and keep tank at 80. If reef pi is up and running, it controls my heaters and tank runs at 79.

The problem is that some of the other systems that reef pi can control, need some type of failsafe, or ability to set a default state. Things that can be hardwired to achieve this are best served by doing it that way, thinga that can not need some type of setting for a default state.
+100, this is an awesome topic. I’m taking notes, whatever comes out of it, I’ll translate into software features. As of now , default equipment state on startup is something I’m thinking of.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
+100, this is an awesome topic. I’m taking notes, whatever comes out of it, I’ll translate into software features. As of now , default equipment state on startup is something I’m thinking of.
I like the idea of a default state, would be nice for that to work for dosers also. Basically equipment or dosers I would always want to default to off on a reboot etc...making me nervous now knowing how it works not sure what I can do to minimize the risk, UPS is only good for a period of time unless I tie it in somehow and do a shutdown of reefpi but then I would also have to have it cut the power to the outlet. I didnt want to go down the route with adding Kalk to my ATO and was using a dosing pump to control it, more defined but the power outage concerns me, it only runs for 14sec per hour but it would be my luck that it happens in that window, lol.

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Just tested the doser again by pulling the power, my doser power is also the same power that feeds my PI and is connected to an always on outlet on the DJ strip. I pulled the power while it was dosing, left it off for a couple of minutes and restored power. Doser module did not come back online and dose, lights came back online etc. I will also test this with my frag tank which is using timers and see it exhibits a different behavior. I can see where the timer would come back on a stay on though since the off timer has passed. My initial thought is to set an off timer that runs every minute and is essentially always turning the outlet off outside of the one window(s) that I want to run, ugly but I cannot think of another option right now.

:)
 

Boostable

Active Member
View Badges
Joined
May 17, 2011
Messages
227
Reaction score
154
Location
Lake Mary, FL
Rating - 0%
0   0   0
+100, this is an awesome topic. I’m taking notes, whatever comes out of it, I’ll translate into software features. As of now , default equipment state on startup is something I’m thinking of.
Default state would be ideal in a lot of these scenarios i would think. Fail/Open, Fail/Closed, etc. If I remember correctly that is how APEX did it in the old system, and I assume still do it in the current models.

Just tested the doser again by pulling the power, my doser power is also the same power that feeds my PI and is connected to an always on outlet on the DJ strip. I pulled the power while it was dosing, left it off for a couple of minutes and restored power. Doser module did not come back online and dose, lights came back online etc. I will also test this with my frag tank which is using timers and see it exhibits a different behavior. I can see where the timer would come back on a stay on though since the off timer has passed. My initial thought is to set an off timer that runs every minute and is essentially always turning the outlet off outside of the one window(s) that I want to run, ugly but I cannot think of another option right now.

:)

Tom, Im surprised given the way states are written that it didn't come on, I would of thought it would return to an on condition..hmm I am using the DJ strip as well, I assume you are using the #9 always on outlet? Makes me wonder when the DB learned of the state change of the doser power and when it changed. Question are you pulling the power for the doser from an "outlet" or are you pulling power from the Pi (12v) for the doser?
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Default state would be ideal in a lot of these scenarios i would think. Fail/Open, Fail/Closed, etc. If I remember correctly that is how APEX did it in the old system, and I assume still do it in the current models.



Tom, Im surprised given the way states are written that it didn't come on, I would of thought it would return to an on condition..hmm I am using the DJ strip as well, I assume you are using the #9 always on outlet? Makes me wonder when the DB learned of the state change of the doser power and when it changed. Question are you pulling the power for the doser from an "outlet" or are you pulling power from the Pi (12v) for the doser?
I feed my doser module from the same 12v supply that I feed my pi with, it actually is split and I feed multiple things requiring power, pi, doser and the outlet relays. I use a @Michael Lane hat so it requires power for the relays and the pi and then I have the dosing module, all power comes from the same source. I am using the always on outlet for the 12v source.

:)
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
922
Rating - 0%
0   0   0
I have not been able to get an ATO to trigger a Macro. I think this is what you are seeing and thinking the system is hanging
I was able to get an ato to trigger a macro today.

the ato is set to trigger the macro. Check frequency is 10 seconds. One shot is disabled.

the macro is set to reverse and written backwards. It is a single step stated to turn off dosing pump. This action actually turns on the dosing pump.

the dosing pump is set to run for 30seconds at 50% speed. I have all schedule parameters set to “*”.

The result is it functions in the manner I desire. When the float sensor is low the dosing pump turns on. It shuts off when the float sensor is high.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Is there any reason that I can't get creative with cron to always turn equipment off, something like this?

doser-Mg.png

Basically the idea would be to have the cron always turn off the outlet outside of the dosing window. I have this setup now but have not tested, I did not get an error when I saved it. Whats the best way to verify that the cron entries are executing, I am watching journalctl but do not see any entry for them.

Thanks :)
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
132
Location
Ballston Spa, New York
Rating - 0%
0   0   0
I was able to get an ato to trigger a macro today.

the ato is set to trigger the macro. Check frequency is 10 seconds. One shot is disabled.

the macro is set to reverse and written backwards. It is a single step stated to turn off dosing pump. This action actually turns on the dosing pump.

the dosing pump is set to run for 30seconds at 50% speed. I have all schedule parameters set to “*”.

The result is it functions in the manner I desire. When the float sensor is low the dosing pump turns on. It shuts off when the float sensor is high.

What if you try to use one ATO to turn on another ATO?

I'm trying to make it so my ATO Reservoir is automatically refilled.
The Reservoir has 2 float switch, a low and a high.

Once the water falls below the LOW sensor i want it to turn on a solenoid and turn it off once the water reaches the HIGH float switch.

How do I make this happen???
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
What if you try to use one ATO to turn on another ATO?

I'm trying to make it so my ATO Reservoir is automatically refilled.
The Reservoir has 2 float switch, a low and a high.

Once the water falls below the LOW sensor i want it to turn on a solenoid and turn it off once the water reaches the HIGH float switch.

How do I make this happen???
There may be some others that have a better answer but if the floats are in series then no way I know how to do it, typically the 2 float setup is for a backup cut off in case the first float gets stuck in the on position, basically either float will turn off the water.

I removed my suggestion I am not sure what the best method is, I would suggest getting a meter and playing with some floats until you get them working how you want them to, keep in mind about fail safes so you don't overflow.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
132
Location
Ballston Spa, New York
Rating - 0%
0   0   0
There may be some others that have a better answer but if the floats are in series then no way I know how to do it, typically the 2 float setup is for a backup cut off in case the first float gets stuck in the on position, basically either float will turn off the water. I think in your case you would need to wire the floats up in parallel mode which would require both of them to cut things off. That is my best guess and only a guess, I'm sure others will chime in but you might want to google float switches parallel vs serial.

No, I have both float switches wired separately to the reef-pi. They run individually.

I just can't figure out how to do this.
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
922
Rating - 0%
0   0   0
What if you try to use one ATO to turn on another ATO?

I'm trying to make it so my ATO Reservoir is automatically refilled.
The Reservoir has 2 float switch, a low and a high.

Once the water falls below the LOW sensor i want it to turn on a solenoid and turn it off once the water reaches the HIGH float switch.

How do I make this happen???
First I ask why not the simple solution. Remove the low sensor. Just use the high sensor as a normal ato. This will keep for reservoir always full.

if you need the reservoir to empty before refilling this is what I can think of. Set the low sensor to turn on when water is low. Set an ato to watch the low sensor and trigger a macro. Have the macro turn on a second ato then wait some time and shut the second ato off. The second ato is watching the high sensor and triggering the full pump. The wait time of the macro should be just a little longer than the time required to fill the reservoir.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
132
Location
Ballston Spa, New York
Rating - 0%
0   0   0
First I ask why not the simple solution. Remove the low sensor. Just use the high sensor as a normal ato. This will keep for reservoir always full.

if you need the reservoir to empty before refilling this is what I can think of. Set the low sensor to turn on when water is low. Set an ato to watch the low sensor and trigger a macro. Have the macro turn on a second ato then wait some time and shut the second ato off. The second ato is watching the high sensor and triggering the full pump. The wait time of the macro should be just a little longer than the time required to fill the reservoir.

I can't do that because it will short cycle the RO Filter, causing a lot of TDS Creep.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
132
Location
Ballston Spa, New York
Rating - 0%
0   0   0
Okay, so I did some further testing, and this is what I figured out.

When ATO Triggers a Macro, it will work if I use it to turn on/off equipment.
However, if I add to the macro, to turn on/off another ATO, it will not work.

@Ranjib
Any ideas why it's doing this?
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
922
Rating - 0%
0   0   0
Okay, so I did some further testing, and this is what I figured out.

When ATO Triggers a Macro, it will work if I use it to turn on/off equipment.
However, if I add to the macro, to turn on/off another ATO, it will not work.

@Ranjib
Any ideas why it's doing this?
A less sophisticated method would be to use timers to turn on and off an ato watching the high sensor. You could have it turn on every other day to fill the container or at whatever frequency makes sense.

I haven’t tried to have a macro triggered from an ato change a different ato. But it would be your solution if it did work. What about a macro triggering another macro that triggers to the ato? I don’t know. I’m spit balling ideas now.
 

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
66
Location
Dover, NH
Rating - 0%
0   0   0
A less sophisticated method would be to use timers to turn on and off an ato watching the high sensor. You could have it turn on every other day to fill the container or at whatever frequency makes sense.

I haven’t tried to have a macro triggered from an ato change a different ato. But it would be your solution if it did work. What about a macro triggering another macro that triggers to the ato? I don’t know. I’m spit balling ideas now.

I use a RO/DI Flood Guardian with an HS300 smart plug to fill my 30 Gallon ATO trash can in the basement. When the flood guardian powers up it starts filling from my RO/DI system until the water level reaches it's sensor and then it shuts off the water supply and goes into standby mode. Pretty cool gizmo although not inexpensive. I created a timer on mi RPI to switch it off and and back on after 4 seconds it then starts filling the can again. The timer is set for Friday's at 9am and it just fills the trash can. The Flood Guardian uses an electronic valve which is in a normally closed state so if the power goes out it will not flood the basement.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
132
Location
Ballston Spa, New York
Rating - 0%
0   0   0
I use a RO/DI Flood Guardian with an HS300 smart plug to fill my 30 Gallon ATO trash can in the basement. When the flood guardian powers up it starts filling from my RO/DI system until the water level reaches it's sensor and then it shuts off the water supply and goes into standby mode. Pretty cool gizmo although not inexpensive. I created a timer on mi RPI to switch it off and and back on after 4 seconds it then starts filling the can again. The timer is set for Friday's at 9am and it just fills the trash can. The Flood Guardian uses an electronic valve which is in a normally closed state so if the power goes out it will not flood the basement.

It doesn't look like it automatically turns on when the level is low?
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
922
Rating - 0%
0   0   0
I'll try that now and report back.

*EDIT*
Nope, doesn't work either.

@Mikeneedsahobby
I tried to use an ato to trigger a macro and that macro to trigger a different ato. I got a bad result. Reef pi seemed to go into a a bad loop and response time become very bad. I ended up having to pull power to reboot.
So I got the same result as you.
 

Boostable

Active Member
View Badges
Joined
May 17, 2011
Messages
227
Reaction score
154
Location
Lake Mary, FL
Rating - 0%
0   0   0
I'll try that now and report back.

*EDIT*
Nope, doesn't work either.

@Mikeneedsahobby
For ATO, I run a simple float valve, backed up up by an inline electric solenoid valve driven off a timer. Stays open long enough to top off the water, and fails closed during power outage. Two means of shutoff, but the float has always shut the water off before the valve ever had to kick in. Simple and effective... A little each day keeps the salt creep away...
 
Last edited:

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top