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

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
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.
That is awesome - I'm going to test some more myself then - I have never tried with a Doser - Always used simple equipment.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
I got my issue above resolved. I needed to add pulldown resistors.

---------------------
-- New Issue --
---------------------

Okay, I am trying to automatically refill my ATO Reservoir using 2 float switches.
Lets call them "Float-Low" and "Float-High", for low level and high level sensors.

- In ATO Menu, Float-High is set to OneShot, controls a Solenoid Valve, and is disabled by default.
- Float-Low is set to Enable, and is set to trigger a macro called "Refill Reservoir".
- The Macro called "Refill Reservoir" has only 1 action in it, which is "ATO > Float-High > Turn On"

The idea is when "Float-Low" is triggered, it will turn on a Solenoid Valve to refill the Reservoir until it reaches the "Float-High" sensor.

However, when I try to do this, it does not work, and it causes the entire system to hang.

What am I doing wrong?

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

This is the question I probably get the most so I made this up, here's a copy and paste. You can ignore the controller and any sensor type will work if you have it confirmed working with ATO.

Here's an example of a low level sensor starting a pump and a high level sensor stopping the pump.

This is how the jumpers should be set, sensor 1 is the low level float. Notice I have one float on GND and other float on +5v and the P-U / P-D jumper is opposite. I did it that way so connectors in reef-pi don't need to be "reversed". If both were wired like sensor 2, sensor 1 connector would need to be "reversed". For float switches the P-U / P-D jumper should always be opposite of 2nd wire on float. If a wire from float goes to GND jumper must be set to P-U, if the float wire goes to +5v then jumper needs to be P-D.

[Image: controller.jpg]


Based on the floats connected like above this is how connectors should look. (RevB has a 6th sensor port).

[Image: sensor_connectors.jpg]



Now setup two macros like image below. The "Start Fill" is the low level float and "Stop Fill" is high level.

Once both are added you can press "Run" button for "Start Fill" and the pump should turn on. I have DC 1 set for equipment but anything on that tab will be available.

Then press run for "Stop Fill" and it should turn off.

When this is working you can move on.

[Image: reservior_fill_macros.jpg]


Now add the two sensors to ATO tab. I have them both disabled so I could get both on single image so do keep them both enabled (on).

Now the low float will start the pump and top float will turn it off. Note both floats always need to be in the position they would be otherwise it will flip flop. During testing this can throw you off. If you are testing out of water make sure you keep adjusting both floats in order they would be in reality.

[Image: reservior_fill_sensors.jpg]


Here's some images of the floats. the lower one is low level and other high level. Of course space between floats is unlimited, this is just what I was using.

This image represents a full tank of water, both floats would be up and pump (light in image) would be off. At this point if you went to equipment tab and turned on the pump manually it would flip flop once because the high level sensor is still running the macro which is turning off the pump.

[Image: sensors1.jpg]


This image would be a partially filled tank, bottom float is still high but top dropped. Pump remains off. Now at this point if you went to equipment tab and turned on that pump it would turn on and stay on until the high level float went back up. This can be useful to manually start a refill at any time.

[Image: sensors2.jpg]


This picture is when the tank gets empty, both floats are down and the pump will turn on. This time if you manually tried to turn off the pump at this point it would immediately come back on because low level float is forcing it on. If you manually moved the high level float up while low level is down it would flip flop as well but in reality this should never happen.

[Image: sensors3.jpg]


This image is during the fill but tank not full yet, low float is up and high float is still down. Once water raises high level the pump will stop and it can go back to the down position when water is used.

[Image: sensors4.jpg]



And this the end of the cycle and tank is full again. Pump is off and waiting for both floats to drop to start the pump.

[Image: sensors5.jpg]



+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.

Here's my 2 cents, on my old controller I created a function called smartStartup, it was one of the best features. When the controller started up it went through all the schedules and figured out based on the current day time what state each output should be in. After this is went through all the sensors and what they control and decided which should run or not. It wasn't easy to do but it was slick and worked well.


Hey everyone, looking for a little help with the ph setup. When I add it I get an error that an input is missing and the ability to calibrate it is grayed out.

here’s how I’ve been setting it up:
1. Add ezo ph driver with the default 68
2. Add analog ph connector with pin 0
3. Go to ph and add the ph connector

I added my circuit below if you feel that may be the source of the issue. After buying everything I realized I’m not following best practices for noise isolation but I’d still expect it to show up.

Thanks in advance!



A0479318-FF35-4FD0-8B91-61979C1724E7.jpeg

The default address is 99 in reef-pi, with i2cdetect you should see 63. Also don't forgot to go to "admin" tab and press "reboot" button after changing the address.

I think it's crazy Atlas doesn't have those circuits isolated, it should work but how well is the question. If I put an isolated probe in my tank it goes off the charts.
 
Last edited:

Sarlindescent

Active Member
View Badges
Joined
Dec 26, 2015
Messages
143
Reaction score
144
Rating - 0%
0   0   0
Some updates. Just completed case #3.... got a rpi ups with a 10k mah battery. Turned out the battery was bigger than I thought by 1/4" and case 2 was scraped. Case 3 has an easy open/close lid. Latch needed modified to work with bnc connectors. Also switched from 1/4 trs to mini xlr. Also did a mini cable sleeving job. Lastly, Saturday the atlas ezo toggler arrived and I was able to switch the ph chips from uart to i2c.

What's left:
1. Finish ups/power supply case.
2. Mount both the ups and rpi. They will be on opposite sides of the stand to prevent interference.
3. Calibrate ph probes.
20210118_233908.jpg
20210118_233710.jpg

Mini xlr connectors look oem on the ds18b20.
20210116_145610.jpg


Also lessons learned, crimp connectors do not work with the temp board screw terminals.
20210117_202815.jpg
 
Last edited:

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
So I've been monitoring my pH probe quite closely and fiddling with Calibration to try and get repeatable readings. And I've made good progress in that regard, but this morning the reef-pi has thrown me a serious curveball. Firstly at midnight exactly it lost all 3 x temp probes. Values just dropped to zero. Re-load and Re-boot from UI did nothing to fis that. Eventually unplugged at the wall and got the temps back.

While this was happening and I was going through sorting it out, I was curious why I was getting exactly the same pH value down to the 13th decimal place on the UI. A look in Adafruit and I could see the actual values coming in were changing, but not corresponding to the UI. After a short while I noticed the Graph in the UI developed a "bump" roughly 2 hours previous to current time and that the current time at the end of the graph was not up to date. AIO graph and feed were still showing as normal. pH graph looks like this now. The large swings are me testing in buffer solutions without running Calibration.

Closer inspection has shown similar is happening on the Temperature graphs.

I'm sure deleting and re-installing will fix this, but I really don't want to do that with teh pH if I can avoid it after getting the Calibration dialed in.
2021-01-19 (2).png
2021-01-19 (1).png
2021-01-19.png
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Some updates. Just completed case #3.... got a rpi ups with a 10k mah battery. Turned out the battery was bigger than I thought by 1/4" and case 2 was scraped. Case 3 has an easy open/close lid. Latch needed modified to work with bnc connectors. Also switched from 1/4 trs to mini xlr. Also did a mini cable sleeving job. Lastly, Saturday the atlas ezo toggler arrived and I was able to switch the ph chips from uart to i2c.

What's left:
1. Finish ups/power supply case.
2. Mount both the ups and rpi. They will be on opposite sides of the stand to prevent interference.
3. Calibrate ph probes.
20210118_233908.jpg
20210118_233710.jpg

Mini xlr connectors look oem on the ds18b20.
20210116_145610.jpg


Also lessons learned, crimp connectors do not work with the temp board screw terminals.
20210117_202815.jpg
Looking good :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So I've been monitoring my pH probe quite closely and fiddling with Calibration to try and get repeatable readings. And I've made good progress in that regard, but this morning the reef-pi has thrown me a serious curveball. Firstly at midnight exactly it lost all 3 x temp probes. Values just dropped to zero. Re-load and Re-boot from UI did nothing to fis that. Eventually unplugged at the wall and got the temps back.

While this was happening and I was going through sorting it out, I was curious why I was getting exactly the same pH value down to the 13th decimal place on the UI. A look in Adafruit and I could see the actual values coming in were changing, but not corresponding to the UI. After a short while I noticed the Graph in the UI developed a "bump" roughly 2 hours previous to current time and that the current time at the end of the graph was not up to date. AIO graph and feed were still showing as normal. pH graph looks like this now. The large swings are me testing in buffer solutions without running Calibration.

Closer inspection has shown similar is happening on the Temperature graphs.

I'm sure deleting and re-installing will fix this, but I really don't want to do that with teh pH if I can avoid it after getting the Calibration dialed in.
2021-01-19 (2).png
2021-01-19 (1).png
2021-01-19.png
I’m thinking what will be a good way to solve this. The sensor readings are beyond reef-pi, we can only apply some calibration, bound checks on them. We can definitely make it easy to copy over calibration to a new probe, or/and updating existing readings to a fixed value based on some criteria (min/max values )

There’s a separate issue of ph having more than two decimal precision, I’ll fix that .
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
That is awesome - I'm going to test some more myself then - I have never tried with a Doser - Always used simple equipment.
All right - been testing this and I now have a better understanding of how this is working.

As a test, I have set up the following :
  • a momentary switch to imitate a float switch - set up as an input.
  • a light set up on an outlet
  • Created a macro that has one step - turn on light
  • Create an ATO with one second check frequency
  • Set the ATO to control the Macro described above
Working findings
  • If I press and hold the button (simulating the float switch opening) the light comes on and stays on.
  • When I release the button (simulating the float switch closing), the light goes off
  • If I press the button for 1 second and release, the light comes on for one second and then goes off again.
  • If I enable One Shot and press and release the button, the light comes on and stays on, but then the ATO is disabled afterwards
Now, I altered the Macro to add the steps to turn on, wait 1sec, turn off, wait 1 sec and turn on. Then activate the ATO on and the light turns on and off repeatedly (1 sec frequency) regardless of the state of the button / switch until I de-activate the ATO. When de-activating the ATO, the light finishes the Macro cycle. If the ATO is left on longer, it takes longer to "normalise" ie reef-pi is counting the activation cycles of the ATO and is trying to run the Macro that number of times.

Next I tried to create a Macro that first de-activated ATO, then did the light steps and then re-activated the ATO. This just confused it completely and made the ATO uncontrollable. I had to delete the ATO because I couldn't change it's state to off despite a re-start on Reef-Pi.

But I can see how using the doser as described has worked.

I'm going to keep testing a few things, but as far as getting the status of an ATO to trigger a multi-step Macro - that's still a no.
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
I’m thinking what will be a good way to solve this. The sensor readings are beyond reef-pi, we can only apply some calibration, bound checks on them. We can definitely make it easy to copy over calibration to a new probe, or/and updating existing readings to a fixed value based on some criteria (min/max values )

There’s a separate issue of ph having more than two decimal precision, I’ll fix that .
I was thinking in the UI maybe you could have a "purge graph data" or "reset graph" - maybe in the Dashboard Configuration. I know sometimes when I'm testing ATO or similar I get one big spike in the histogram that visually gives me a twitch until it drops off the end after time.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
So I've been monitoring my pH probe quite closely and fiddling with Calibration to try and get repeatable readings. And I've made good progress in that regard, but this morning the reef-pi has thrown me a serious curveball. Firstly at midnight exactly it lost all 3 x temp probes. Values just dropped to zero. Re-load and Re-boot from UI did nothing to fis that. Eventually unplugged at the wall and got the temps back.

While this was happening and I was going through sorting it out, I was curious why I was getting exactly the same pH value down to the 13th decimal place on the UI. A look in Adafruit and I could see the actual values coming in were changing, but not corresponding to the UI. After a short while I noticed the Graph in the UI developed a "bump" roughly 2 hours previous to current time and that the current time at the end of the graph was not up to date. AIO graph and feed were still showing as normal. pH graph looks like this now. The large swings are me testing in buffer solutions without running Calibration.

Closer inspection has shown similar is happening on the Temperature graphs.

I'm sure deleting and re-installing will fix this, but I really don't want to do that with teh pH if I can avoid it after getting the Calibration dialed in.
2021-01-19 (2).png
2021-01-19 (1).png
2021-01-19.png
So far I have not gotten any PH probes to be consistent, about to send another one back, its like they all start to lose the calibrations settings and drift. I may try one more but starting to think about not having PH monitored which with dosing kalk I kind of wanted.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
I was thinking in the UI maybe you could have a "purge graph data" or "reset graph" - maybe in the Dashboard Configuration. I know sometimes when I'm testing ATO or similar I get one big spike in the histogram that visually gives me a twitch until it drops off the end after time.
+1 I would like to be able to reset graphs, I know I learned the hard way about re-arranging the dashboard, messed up several charts and not sure how to correct them.

charts.png


Note the dates on the bottom, I went from a single dashboard since I couldnt add more rows and when I moved things around the bottom scale is messed up.

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
Here is what I am doing regarding dosing and power outage reliability. For dosers that are timer controlled I am basically having timers to verify that outside of the dosing time the equipment stays off, its cumbersome but I like the additional reliability about knowing that if power goes out and comes back up that the likely hood of continuing to dose is lower.

Here are some examples:

This is one of the more complicated ones, dosing Kalk from 1800 to 0600, since I am wanting to dose overnight it requires 2 entries, one 1800 to 2300 and then another one from 0:00 to 0600. Unless someone knows better I do not think I can combine this into one entry but I could be wrong, not a cron xpert. :p

High level
Dosing-HI-level.png


Detail timer ON and OFF, should come on top of hour and turn off 2 minutes later, note that I also have the OFF timer to keep turning it off the rest of the time, so for the hours between 18-23 the timer will continue to ensure that the equipment is in the off state, if we loose power during a dosing time and it comes back online during this time it will be turned off, it could possible run a minute.

Dosing-kalk1.png

Power off safety settings, I want to further have additional safety measures for the other hours I do not want it to dose. Since I already have the dosing turned off for the corresponding on times 18-23 and 0-06 I only need to be concerned about the additional hours 07-17.

Dose-kalk2.png


Now the one additional thing that I would like is to chart the equipment coming on and off the various times during the day like the normal dosing chart. I do not see a way to do this with my current version on reefpi but hoping that with prometheus and grafana that I can chart the equipment coming on and off, is that correct @Ranjib ?

I know it seems more complicated than it needs to be but with Nano tanks I'm just trying to to be as careful as I can. @Ranjib I am thinking that if we could set some watchdog timers, basically a setting for equipment that I know I do not want on might be another path, basically it watches and ensures that the equipment is only on during the times that you specify, if its outside of that window then it's turned off. Maybe that doesnt make since but that is what I was thinking, the default setting may be an easier thing to annotate and do, just been thinking about alternatives.

Let me know if any of this makes sense, hoping that someone may find it useful. :)
 
Last edited:

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,520
Reaction score
1,511
Rating - 0%
0   0   0
Here is what I am doing regarding dosing and power outage reliability. For dosers that are timer controlled I am basically having timers to verify that outside of the dosing time the equipment stays off, its cumbersome but I like the additional reliability about knowing that if power goes out and comes back up that the likely hood of continuing to dose is lower.

Here are some examples:

This is one of the more complicated ones, dosing Kalk from 1800 to 0600, since I am wanting to dose overnight it requires 2 entries, one 1800 to 2300 and then another one from 0:00 to 0600. Unless someone knows better I do not think I can combine this into one entry but I could be wrong, not a cron xpert. :p

High level
Dosing-HI-level.png


Detail timer ON and OFF, should come on top of hour and turn off 2 minutes later, note that I also have the OFF timer to keep turning it off the rest of the time, so for the hours between 18-23 the timer will continue to ensure that the equipment is in the off state, if we loose power during a dosing time and it comes back online during this time it will be turned off, it could possible run a minute.

Dosing-kalk1.png

Power off safety settings, I want to further have additional safety measures for the other hours I do not want it to dose. Since I already have the dosing turned off for the corresponding on times 18-23 and 0-06 I only need to be concerned about the additional hours 07-17.



Now the one additional thing that I would like is to chart the equipment coming on and off the various times during the day like the normal dosing chart. I do not see a way to do this with my current version on reefpi but hoping that with prometheus and grafana that I can chart the equipment coming on and off, is that correct @Ranjib ?

I know it seems more complicated than it needs to be but with Nano tanks I'm just trying to to be as careful as I can. @Ranjib I am thinking that if we could set some watchdog timers, basically a setting for equipment that I know I do not want on might be another path, basically it watches and ensures that the equipment is only on during the times that you specify, if its outside of that window then it's turned off. Maybe that doesnt make since but that is what I was thinking, the default setting may be an easier thing to annotate and do, just been thinking about alternatives.

Let me know if any of this makes sense :)
One difficulty with this might be the difference between the doser being off, and ReefPi thinking it is off. Depends on which driver/electronic solution you use of course. An easy example are file drivers, reefpi only knows that it writes to the file that something should be off, it doesn't know whether the pipeline that actually uses that file is malfunctioning or running at all.

Different example that actually happened to me: the pi crashed on its own a while back but overall power was still there. Meaning the PCA9685 making the pwm signals for my dosers never got the i2c message to stop /change what it was doing. If I remember correctly the pi restarting wasn't enough, I had to delete and reconfigure the doser in the Ui before it would stop, thankfully I was there while it happened and could pull out the tubing.

I haven't really looked into it at all, but how hard would it be to diy current sensing for 12v/24v? Then that would be an easy alarm /macro trigger when a doser is running when it shouldn't.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
One difficulty with this might be the difference between the doser being off, and ReefPi thinking it is off. Depends on which driver/electronic solution you use of course. An easy example are file drivers, reefpi only knows that it writes to the file that something should be off, it doesn't know whether the pipeline that actually uses that file is malfunctioning or running at all.

Different example that actually happened to me: the pi crashed on its own a while back but overall power was still there. Meaning the PCA9685 making the pwm signals for my dosers never got the i2c message to stop /change what it was doing. If I remember correctly the pi restarting wasn't enough, I had to delete and reconfigure the doser in the Ui before it would stop, thankfully I was there while it happened and could pull out the tubing.

I haven't really looked into it at all, but how hard would it be to diy current sensing for 12v/24v? Then that would be an easy alarm /macro trigger when a doser is running when it shouldn't.
Correct that is the issue, you doser is going and you loose power, the doser is supposed to run for 1 minute etc. Your power comes back on some period of time after the time as expired and reefpi returns it to its working state, eg. doser continues to run. It may not happen but its a possibility and I would like to minimize that possibility as much as possible.

:)
 
Last edited:

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,520
Reaction score
1,511
Rating - 0%
0   0   0
A bit of googling turned up ina219 and ina3221, single and triple channel current/voltage sensing chips that have i2c capability and exist as breakout boards that aren't all too expensive.

Haven't looked at all the details yet though, maybe there's better ones for the price.

Those would provide a nice graph which equipment is running when though.
 

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
66
Location
Dover, NH
Rating - 0%
0   0   0
I was thinking in the UI maybe you could have a "purge graph data" or "reset graph" - maybe in the Dashboard Configuration. I know sometimes when I'm testing ATO or similar I get one big spike in the histogram that visually gives me a twitch until it drops off the end after time.
I'll vote for purging the graph data too... Also, I don't seem to be able to change the graph colors in the Dashboard. Maybe it's just me.
 

Algae invading algae: Have you had unwanted algae in your good macroalgae?

  • I regularly have unwanted algae in my macroalgae.

    Votes: 46 35.4%
  • I occasionally have unwanted algae in my macroalgae.

    Votes: 28 21.5%
  • I rarely have unwanted algae in my macroalgae.

    Votes: 10 7.7%
  • I never have unwanted algae in my macroalgae.

    Votes: 10 7.7%
  • I don’t have macroalgae.

    Votes: 32 24.6%
  • Other.

    Votes: 4 3.1%
Back
Top