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

Corals.com
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
8,667
Reaction score
15,176
Location
Palo Alto, Bay Area
Is there somewhere detials one how the OneShot works or what it does?
its somewhere in r2r threads, and not in official documentation (any help welcome).
A onshot controller run once and strops, after the triggering condition. It is useful in macros, auto water changer etc, for steps like.. run this pump till the water hits float switch level and then stops.
 
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
8,667
Reaction score
15,176
Location
Palo Alto, Bay Area
In reef-pi code, the reef-pi central controller aka daemon runs individual subsystems (also called as modules). Each subsystem hold similar types of entities, also called as controller. Each controller implements an execute look which can be Run (perpetually, based on a sensor value and control equipment etc), or oneshot, i.e. the controller will execute only once.
reef-pi (daemon)
- Subsystem[ATO]
- Subsystem[DisplayTank ATO]
- Subsystem[FragTank ATO]
- Subsystem[WC Fill ATO]
- Execute
- Check for triggering condition after every check interval
- Control equipment or other reef-pi features while honoring hysteresis or any alerting rules
- Module[Temperature]
- Module[pH]

The macro subsystem, allows sequntial execution of individual controllers (run on one-shot) and subsystems. The sensor check part is delegated at controller level. reef-pi allows reusing sensors and equipment across controllers. Collectively this model should allow us doing complex workflows, without scripting requirements, but we have to test these things and think through the consequences. Like power tools, there is always a chance of mishaps.
 

dmolavi

Active Member
View Badges
Joined
Jan 3, 2015
Messages
496
Reaction score
635
Location
United States
I think I found the problem. A quick exchange with @theatrus had me thinking...If one of the probes shorted out, the way I have them connected, it would cause both to have bad readings. I unplugged my probe that is in my tank and the reading for the ambient air probe returned to normal. My guess is the probe finally gave up the ghost, and since I don't have any kind of protection for shorts on my daughtercard I use to connect them to the 1-wire interface, it is causing bad readings on the other probe. I'll be replacing the probe, and plopping a diode or two on the daughtercard, shortly.
Went home last night and checked the probe. Instead of ~0.5/0.6V across the leads to ground, one is open, and the other is 0.5V. I'm going to open up the jacketing tonight where I soldered it to my connector and make sure nothing has broken, but I have new probes coming just in case.
 

dmolavi

Active Member
View Badges
Joined
Jan 3, 2015
Messages
496
Reaction score
635
Location
United States
Found the problem with the probe haha. Where can I get heat shrink tubing that is thermally conductive? (For my new probes)
 

Attachments

  • 20210408_103213.jpg
    20210408_103213.jpg
    127.8 KB · Views: 22
Top Shelf Aquatics

elysics

Well-Known Member
View Badges
Joined
Jan 15, 2020
Messages
502
Reaction score
422
Found the problem with the probe haha. Where can I get heat shrink tubing that is thermally conductive? (For my new probes)
Don't worry too much about thermal conductivity, it doesn't really matter if you see a 0.1 degree change now or in 3 minutes. I use aquarium silicone, which is rather isolating thermally, and it's fine, if i put it from 19° air into a 25° bucket of saltwater, it takes maybe a minute, 2 at most, until the sensor shows 25. And if i open a window for fresh air for 5 minutes, it picks up the change in air temperature no problem.

I'd definitely value reef safe materials vs unknown plastics and plasticizers higher than having the sensor be faster by a few seconds
 
Last edited:

trackerit

Community Member
View Badges
Joined
Apr 11, 2019
Messages
71
Reaction score
137
I've been away for a few years but I'm back, I have a version of blueacro that I just saw is no longer available, does the latest version of reef-pi still support the ph module of this board? Is the calibration visual or is it still with the json file?
 

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,431
Reaction score
1,695
Location
RVA
I've been away for a few years but I'm back, I have a version of blueacro that I just saw is no longer available, does the latest version of reef-pi still support the ph module of this board? Is the calibration visual or is it still with the json file?
If it worked with the old reefpi it should work with the current version as I don't believe they removed any previously supported PH boards. Ph calibration has a GUI.
 
Top Shelf Aquatics

Lady of Babylon

Community Member
View Badges
Joined
Jan 27, 2021
Messages
49
Reaction score
85
Location
dublin/ east bay
Omg, you just made my life! *swoon!* so doing this ASAP

Welcome to the development thread of reef-pi, an open-source, affordable, modular DIY reef-tank controller based on Raspberry Pi.

aio.jpg

If you are trying to build a reef-pi controller, please check out the build guides linked below. You can use this thread to seek help and to stay updated with the latest development.

Screen Shot 2018-11-04 at 8.38.50 PM.png



reef-pi provides following functionalities:
  • Equipment control or automated power strip (including digital timers to switch on/off equipment at periodic intervals)
  • LED light control (24 hour cycle), diurnal cycle, fixed dimmig
  • Auto Top Off (based on photoelectric water level sensor or float switch)
  • Temperature monitoring and control (switch on/off heater & chiller)
  • pH monitoring
  • Dosing automation
  • Macro (feed mode etc)
  • And several other features like camera controls (periodic image capture and upload on google drive), telemetry (dashboard and alerting based on sensor values using adafruit.io), mobile friendly UI etc.
A beginner friendly list of reef-pi build guides are available on adafruit.io, if you are planning to build a reef-pi controller start with them.
  1. Setup and installation
  2. Power controller
  3. Temperature controller
  4. Auto Top Off
  5. Light controller
  6. pH monitor
Since reef-pi is modular and customizable, the cost of individual builds varies. In our experience reef-pi controller are almost always cheaper than the commercial alternatives and costs anywhere between 100 to 550 USD. An example bill of materials can be found here as amazon list. If you are building a reef-pi controller, I highly encorage you start a build thread and tag it with #reefpi to seek help with your build


--------------------------- Original thread start ---------------------
Hello friends,
I am starting a master thread for a DIY reef tank controller that is based on all opensource software and hardware. I had started with this project with following goals:
- Build an opensource software and hardware based reeftank controller that anyone can use and hack
- Keep the controller well tested against a set of standard equipment I use, while make it possible for other equipment to be used
- Maintain my own tank build threads and their evolution, backed by this controller.
- Learn electronics and reef keeping along the way (I am biologist by education & software engineer by occupation)

Following are the details of what I have developed & tested till now:
Controller software:
- The main controller software is called reef-pi. It is written in go, its fast and performant. It used embd for hardware communication. It also runs a little web server which provides the UI for the controller. UI is written in React , and can be accessed from anything that has web browser. As of now, the reef-pi supports following things:
- AC 110/220 V socket on/off (uses optocoupled relays underneath). This is used to remotely switch on/off return pump, LED bulb, heater etc.
- 0-20 Volt DC PWM. This is used to control things like dimmable LEDs, DC pumps. I use it to control my Kessil A80, A360. As well as a 5V DC pump (i use it as wave maker in one of my pico with SPS). PWM is done using PCA9685 breakout board from adafruit. This board supports 16 channels. I am using only 5 at max, as of now.
- Analog sensor support using MCP3008 analog to digital converter. This supports 8 channels. i.e. I can use up to 8 sensors/probes. As of now, I have only tested temperature sensor with it.
Other than the following basic hardware/equipment support, the controller software provides following additional features:
- Setting up daily/weekly/monthly scheduled jobs. Like turning on/off certain equipment. I use this feature to run my AC20 HOB filter nightly.
- Setting up dusk-to-dawn like lighting using PWM. The UI gives 12 vertical slider based 0-24 hours (each slider representing 2 hours gaps). I combine two of these two control the kessil LEDs.
- Authentication using Google OAuth. Since the whole controller runs on raspberry pi and provides an web frontend, security of one of my concern. To mitigate this, I have added google authentication support, which when configured will allow only certain users to log in (email specified in the configuration value).

This is the summary of the core controller software and what features it has as of now. I am constantly writing/improving things around it. As of now, I have two reef tank powered by this. I 'll have seperate threads on the individual builds that will include the housing and ancillary hardware in nano-reef.com, as my tank build threads are there, but I'll share all the controller specific common bits here, including UI screen shots, and tank pics :)

20161115_081550.jpg
 

elysics

Well-Known Member
View Badges
Joined
Jan 15, 2020
Messages
502
Reaction score
422
Is there a way to change the date formats for graphs? For me, the x axis labels are almost unreadable because they contain 2 or 3 points covering the whole axis with the full timestamp, day, 3 letter month, year, and time. On the 24 hour graphs, hours alone would suffice, and be much more readable, the pop-ups for individual data points have the full timestamp anyway. For the historical graphs maybe only month and day as axis labels, or only month even

Maybe a dynamic switch between different label ranges depending on the time span of the graph for a really fancy solution
 
Last edited:

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
53
Reaction score
55
@Ranjib
Error in a ph calibration?
maybe i have a problem in my ph probe, but, when i calibrate it, the program says "mid value" and "second value". There is any difference if "mid value" is > "second value" or "mid value" < "second value" because it seems that if the "second value" is less than the "mid value" the real value is not correct.
i made ax example, yesterday i calibrate my ph probe in my tank,
"mid value" = 7
"second value" = 4
now in my tank, the ph is 6.4! if i put the probe in the 7 calibration liquid and i read 7 (+- 0.1 decimals) the same in the 4 calibration liquid.
fortunately, with the liquid test, the ph is 8. (or everything in my tank are dead).
today i'll try with
"mid value" = 4
" second value" = 7

(i tried to read the program on github, but is very difficult without comment :( )
 

robsworld78

Active Member
View Badges
Joined
Feb 14, 2020
Messages
406
Reaction score
635
Location
Edmonton, Canada
@Ranjib
Error in a ph calibration?
maybe i have a problem in my ph probe, but, when i calibrate it, the program says "mid value" and "second value". There is any difference if "mid value" is > "second value" or "mid value" < "second value" because it seems that if the "second value" is less than the "mid value" the real value is not correct.
i made ax example, yesterday i calibrate my ph probe in my tank,
"mid value" = 7
"second value" = 4
now in my tank, the ph is 6.4! if i put the probe in the 7 calibration liquid and i read 7 (+- 0.1 decimals) the same in the 4 calibration liquid.
fortunately, with the liquid test, the ph is 8. (or everything in my tank are dead).
today i'll try with
"mid value" = 4
" second value" = 7

(i tried to read the program on github, but is very difficult without comment :( )
What circuit are you using?

As I understand calibrating Mid value should be 7.0 and second either 4.0 or 10.0. I think going other way around would mess things up. The value you expect to measure should fall between the two calibration values, as you expect 8 you should be using 7.0 and 10.0 for best results. Not sure if that could cause what you are experiencing though. Do you get close to 8 with no calibration? When viewing the calibration window you see the non-calibrated pH so you should be seeing something different when calibration is open vs closed.

EDIT: @Ranjib, not sure if you ever looked at presenting the slope of a pH probe so users can tell when a probe is bad or getting old.

 
Last edited:

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
53
Reaction score
55
What circuit are you using?

As I understand calibrating Mid value should be 7.0 and second either 4.0 or 10.0. I think going other way around would mess things up. The value you expect to measure should fall between the two calibration values, as you expect 8 you should be using 7.0 and 10.0 for best results. Not sure if that could cause what you are experiencing though. Do you get close to 8 with no calibration? When viewing the calibration window you see the non-calibrated pH so you should be seeing something different when calibration is open vs closed.

EDIT: @Ranjib, not sure if you ever looked at presenting the slope of a pH probe so users can tell when a probe is bad or getting old.

I don't have at home the ph10 solution now, but my previous ph value was nearly correct from 7,9 to 8.2, I've deleted the ph probe to reset some strange value (for cable management I disconnect the probe but it was always in the water ), after re-adding it I've found this strange values.
I check the cable, i check the solutions (i have another probe in my calcium reactor), i'm using a self-made ph-board from Roberto Buti, so i read the raw value (like 13600 now. )

in the afternoon (im living in italy) i'll try to recablibrate the probe, middle value 4 and second value 7. i'm read both raw value and calculate the slope and the hypothetically correct value, then i will compare with the ph value of reefpi
 
Lazys Coral House

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
53
Reaction score
55
Recalibration done!
Mid value, ph 4 raw 32350
Second value, ph 7 raw 11600

Tank value, ph 7,83 raw 6106, ph test kit 7,8

Conclusion:
my ph probe has a lot of offset value, it's time to replace it
There is a difference between the two calibration
 

robsworld78

Active Member
View Badges
Joined
Feb 14, 2020
Messages
406
Reaction score
635
Location
Edmonton, Canada
Recalibration done!
Mid value, ph 4 raw 32350
Second value, ph 7 raw 11600

Tank value, ph 7,83 raw 6106, ph test kit 7,8

Conclusion:
my ph probe has a lot of offset value, it's time to replace it
There is a difference between the two calibration
I think it's ok to use 7 and 4 to calibrate, just better to use 10, either way it should be close. Hopefully a new probe gets it sorted.
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
53
Reaction score
55
I think it's ok to use 7 and 4 to calibrate, just better to use 10, either way it should be close. Hopefully a new probe gets it sorted.
ph8 is near ph7, the point of calibration, so theoretically the value is correct

I also have a redox probe the ph increase but the redox goes down... problably I need another calibration. Probably the biggest raw value is the "mid value" the second one is the "second value"
 

robsworld78

Active Member
View Badges
Joined
Feb 14, 2020
Messages
406
Reaction score
635
Location
Edmonton, Canada
ph8 is near ph7, the point of calibration, so theoretically the value is correct

I also have a redox probe the ph increase but the redox goes down... problably I need another calibration. Probably the biggest raw value is the "mid value" the second one is the "second value"
I found it, was looking for this yesterday. This explains nicely how pH is calculated and shows the formulas. It's all based on mV so I'm not sure how those analog values reef-pi gets from the circuit are translated. This is what my circuit is based on.

 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
53
Reaction score
55
I found it, was looking for this yesterday. This explains nicely how pH is calculated and shows the formulas. It's all based on mV so I'm not sure how those analog values reef-pi gets from the circuit are translated. This is what my circuit is based on.

the ph probe has a linear trend, so i can use the equation of a line passing through two-point to calibrate my probe and convert my mV to my ph. But, first of all, the signal (mV) needs to be amplified and elaborated by an ADC. So my raw signal is between +32767 -32768.
If i had a little slope but the signal in mV has always a linear trend and i can calibrate between my two point (4ph and 7 ph or 7 ph and 10 ph) the slope is irrilevant!
 
Aquarium Specialty - dry goods & marine livestock

BIG TANKS VERSUS SMALLER TANKS...WHICH DO YOU PREFER?

  • BIGGER

    Votes: 633 75.9%
  • smaller

    Votes: 157 18.8%
  • Other (please explain)

    Votes: 44 5.3%

Online statistics

Members online
853
Guests online
3,288
Total visitors
4,141
RC
Top