Converting to reef-pi

wizzlebippi

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 8, 2022
Messages
10
Reaction score
15
Review score
+0 /0 /-0
Location
United States
I've been working on a home-brew aquarium automation system for my 120 gal freshwater planted tank for about 2 years now, which is based on a raspberry pi and uses a touchscreen for control. Last summer, while needing more switched outlets, I discovered the reef-pi power controller build instructions on adafruit. I recently built a dosing controller based on the adafruit guide, and so far that's working great. Since reef-pi seems to be a superset of the capability I already have, I'm considering going the rest of the way.

First, I'm not sure if my sump depth sensing system is compatible. I use a bubbler to keep electronics away from water, and that involves an mpl3115a2 ambient pressure sensor and mrpls total pressure sensor. This has proven itself to be very rugged and accurate, so I'd like to keep it.

Second, I'm wondering if data from multiple networked pi's can be combined onto a single dashboard? I see options for MQTT in the settings, but I don't have a spare pi to experiment with.

Thanks
 
AquaCave Logo Banner

attiland

2500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Jul 22, 2020
Messages
2,580
Reaction score
4,684
Review score
+0 /0 /-0
Location
United Kingdom
I think any sensor can be compatible via file input so you should be fine.
You can even keep your own screen just the data source has to be redone. There are some API included.
once you have more specific question @Ranjib will be able to help
 

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,555
Reaction score
2,862
Review score
+0 /0 /-0
Location
Sacramento, CA area
I've been working on a home-brew aquarium automation system for my 120 gal freshwater planted tank for about 2 years now, which is based on a raspberry pi and uses a touchscreen for control. Last summer, while needing more switched outlets, I discovered the reef-pi power controller build instructions on adafruit. I recently built a dosing controller based on the adafruit guide, and so far that's working great. Since reef-pi seems to be a superset of the capability I already have, I'm considering going the rest of the way.

First, I'm not sure if my sump depth sensing system is compatible. I use a bubbler to keep electronics away from water, and that involves an mpl3115a2 ambient pressure sensor and mrpls total pressure sensor. This has proven itself to be very rugged and accurate, so I'd like to keep it.

Second, I'm wondering if data from multiple networked pi's can be combined onto a single dashboard? I see options for MQTT in the settings, but I don't have a spare pi to experiment with.

Thanks

You can use your existing Pi software to expose certain sensors as files on disk, which allows Reef-Pi to just read the file and report on the value.

Would love to see more of your pressure sensor setup for level measurements. I have a few experiments using a singla MPXV7002, which for the most part works well with some small quirks on how much air leaks through the system or water.
 
OP
W

wizzlebippi

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 8, 2022
Messages
10
Reaction score
15
Review score
+0 /0 /-0
Location
United States
I'd like to see an example of exposing sensors as files on disk if you have or know of one. Right now, my sensors are connected to a pico, which collects and transmits data over uart. I'm not opposed to taking that apart, but if I don't that would be fantastic. Otherwise, writing values to a device file from a script that I control wouldn't be the worst thing ever.

For using air pressure to measure water depth, it's not that complicated, but I'm also cheating since I've calibrated air data systems on aircraft. Both total_p and static_p are 10 sec rolling averages, sampled at 1Hz. The water_level_cal parameter is the result of pulling the bubbler wand out of the water, giving the data time to stabilize, and recording the value. This represents the overpressure needed to force air out of the wand (just hard air tubing, air stones are too unpredictable) at depth. Go deep enough and this won't just be a constant offset, but for the small amount of water in a sump, it's constant enough. Here's how it works:

[HASH=54443]#standard[/HASH] day density of water at 80degF(kg/m^3) density=997.0474 [HASH=54444]#acceleration[/HASH] due to gravity (m/s^2) g=9.80665 [HASH=54445]#calculate[/HASH] fluid pressure (Pa) Pfluid = total_p - static_p - water_level_cal [HASH=54445]#calculate[/HASH] depth from fluid pressure (m) and convert to inches depth = (Pfluid/(density*g))*39.37008

I've tested this at up to 2 ft depth with error small enough that I don't care. The issue you might be running into is you're at the upper limit of what your sensor can handle, so it might not be responding linearly. The mprls can handle up to 25 psi, far more than I'm ever going to put on it.
 

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,425
Reaction score
16,275
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
others have already answered most of your queries, for consolidating all metric into a single dashboard you can either use mqtt or prometheus+grafana to collect all the metrics emitted by different reef-pi and generate centralized charts. this will require a separate computer where grafana/prometheus will run. An individual do not have capability to collect metric from others,

the file driver integration is as simple as it gets, you use your script to write the value (a single float value) from any sensor to a file , and in reef-pi you use the file driver to read that file and treat it as analog input.

if this sensor is useful and other are interested, we can always write a native i2c based driver directly in reef-pi, its not a lot of work, but I want to make sure it will be of use to the community, since every new code will add new maintenance burden.
 
BRS

attiland

2500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Jul 22, 2020
Messages
2,580
Reaction score
4,684
Review score
+0 /0 /-0
Location
United Kingdom
I'd like to see an example of exposing sensors as files on disk if you have or know of one. Right now, my sensors are connected to a pico, which collects and transmits data over uart. I'm not opposed to taking that apart, but if I don't that would be fantastic. Otherwise, writing values to a device file from a script that I control wouldn't be the worst thing ever.

For using air pressure to measure water depth, it's not that complicated, but I'm also cheating since I've calibrated air data systems on aircraft. Both total_p and static_p are 10 sec rolling averages, sampled at 1Hz. The water_level_cal parameter is the result of pulling the bubbler wand out of the water, giving the data time to stabilize, and recording the value. This represents the overpressure needed to force air out of the wand (just hard air tubing, air stones are too unpredictable) at depth. Go deep enough and this won't just be a constant offset, but for the small amount of water in a sump, it's constant enough. Here's how it works:

[HASH=54443]#standard[/HASH] day density of water at 80degF(kg/m^3) density=997.0474 [HASH=54444]#acceleration[/HASH] due to gravity (m/s^2) g=9.80665 [HASH=54445]#calculate[/HASH] fluid pressure (Pa) Pfluid = total_p - static_p - water_level_cal [HASH=54445]#calculate[/HASH] depth from fluid pressure (m) and convert to inches depth = (Pfluid/(density*g))*39.37008

I've tested this at up to 2 ft depth with error small enough that I don't care. The issue you might be running into is you're at the upper limit of what your sensor can handle, so it might not be responding linearly. The mprls can handle up to 25 psi, far more than I'm ever going to put on it.
Here is one of my write ups for using file driver for a sensor not nativity supported by reef-pi


Thread 'SHT20 Temperature Humidity With Reef-PI'
https://www.reef2reef.com/threads/sht20-temperature-humidity-with-reef-pi.817553/
 

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,555
Reaction score
2,862
Review score
+0 /0 /-0
Location
Sacramento, CA area
Your level sensor is a bit more involved than my setup, which is a purely passive rigid airline on a differential (or atmospheric referenced) sensor. It has the downside that the airline contains no leaks, or as I’ve been finding out, compensated for with larger volumes of air in the inverted pressure tubing. In a sump scenario where the airline may self-purge periodically it can self cancel, or do as you’ve did and provide a self purging air source.
My sensitivity is high, a few inches of water is the max range.
 
OP
W

wizzlebippi

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 8, 2022
Messages
10
Reaction score
15
Review score
+0 /0 /-0
Location
United States
@Ranjib Thanks for the tip on the file driver. Getting everything set up was easier than I expected. I tweaked my code to output to 3 files (temperature, pH, and sump depth), the incorporated them as analog inputs. Everything else was just assigning appropriate relays.

If other people are truly interested in my bubbler depth sensor, then I'll help with the code side of it.

Thanks for the help
 

AquaKey

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 3, 2022
Messages
12
Reaction score
7
Review score
+0 /0 /-0
Location
Portland
Your level sensor is a bit more involved than my setup, which is a purely passive rigid airline on a differential (or atmospheric referenced) sensor. It has the downside that the airline contains no leaks, or as I’ve been finding out, compensated for with larger volumes of air in the inverted pressure tubing. In a sump scenario where the airline may self-purge periodically it can self cancel, or do as you’ve did and provide a self purging air source.
My sensitivity is high, a few inches of water is the max range.
Could you share a link to the sensor you use?
 
Top Shelf Aquatics

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,555
Reaction score
2,862
Review score
+0 /0 /-0
Location
Sacramento, CA area
Could you share a link to the sensor you use?

I need to make a thread on it, but its this sensor:


It needs a certain amount of temperature compensation to get rid of offsets due to air trapped in the measuring port which I'm still working on. It also detected the Tonga eruption this morning as barometric pressure changed rapidly :)

Artboard 1.png
 

AquaKey

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 3, 2022
Messages
12
Reaction score
7
Review score
+0 /0 /-0
Location
Portland
I need to make a thread on it, but its this sensor:


It needs a certain amount of temperature compensation to get rid of offsets due to air trapped in the measuring port which I'm still working on. It also detected the Tonga eruption this morning as barometric pressure changed rapidly :)

Artboard 1.png
Thanks! Would definitely be interested in learning more on how you're using it and set it up.
 

AquaKey

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 3, 2022
Messages
12
Reaction score
7
Review score
+0 /0 /-0
Location
Portland
@theatrus I think I'm going to pick up a pressure sensor to play around with to measure water level. In your pic where you picked up the tonga eruption, would you also need a barometric sensor to cancel out variations in air pressure?
 

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,555
Reaction score
2,862
Review score
+0 /0 /-0
Location
Sacramento, CA area
I need to do more experiments, but I believe the effect was not absolute barmoetric pressure, but simply amplification as the surface area of the aquarium acts as a "drum" which will pick up pressure changes.

The sensor I'm using is differential, dual ported, which means it should be reading the different between port A (pressure from water displacement) and port B (atmospheric pressure). If you use an absolute gauge style sensor you'd want to also subtract barometric.
 

How often do you buy coral from other hobbyists?

  • Very Often

    Votes: 30 23.3%
  • Occasionally

    Votes: 37 28.7%
  • Very Rare

    Votes: 28 21.7%
  • Never

    Votes: 31 24.0%
  • Other (please explain)

    Votes: 3 2.3%
Torch SALE
Top