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
Any possibility of expanding the I/O capacity by adding support for PCF8574 (I2C Digital I/O expander)?
Nothing planned. In 3.0 we introduced HAL (hardware abstraction layer), which makes this sort of things lot easier (can be shipped in a minor release without any major product changes).
On this specific functionality (i/o expansion), we had planned for mcp23017 support for 3.0, but later i de-prioritized it. This is bercause in 3.0, the pwm outputs can be used as standard digital i/o (relay control etc), which mean at least the output features can be offloaded to pca9685 (which are i2c and you can use multiple of them), thus leaving pi GPIO only for inlets/inputs. The newly added support for wifi/smart plugs also contributed to this.

Any specific reason for choosing pcf8574 over mcp23017 for i/o expansion?
 
Last edited:
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
Nothing planned. In 3.0 we introduced HAL (hardward abstraction layer), which makes this sort of things lot easier (can be shipped in a minor release without any major product changes).
On this specific functionality (i/o expansion), we had planned for mcp23017 support for 3.0, but later i de-prioritized it. This is bercause in 3.0, the pwm outputs can be used as standard digital i/o (relay control etc), which mean at least the output features can be offloaded to pca9685 (which are i2c and you can use multiple of them), thus leaving pi GPIO only for inlets/inputs. The newly added support for wifi/smart plugs also contributed to this.

Any specific reason for choosing pcf8574 over mcp23017 for i/o expansion?
i went through some spec, i think mcp23017 is a better choice. So, whenever we do add i/o expander support its likely going to be mcp23017 (also they are more ubiquitous i feel). Let us know if your thoughts,
 
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
Im playing with a lot of different battery-powered reef-pi options during the holidays (other than hacking on model railroad with reef-pi for my son). And wanted to share some insights,
The goal here is to come up with something that can allow reef-pi users to run minimal system (on demand or automatically) during power outage. As usual with reef-pi, the focus here to get something with frugal, affordable components.
My current thought process is to go with mobile power banks , they are cheap and can run multi-hour, easy to source and have different capacity options. Pair them with 5v airstone and submersible pumps (2W or 3Watts at max). Experiement and document the findings then proceed with 12V beefier/expensive power banks if need be.

With that I first used my wife's 4 year old 4600mAh power bank with a vanilla pi zero w. That ran around 13 hours. But i was not sure how the math works or if the powerbank if giving what its rated for after 4 years of use. So i then got a duracell 3300 mAh powerbank (as shown in the photo) and this one gives roughly 16 hours with wifi and reef-pi running . For some reason, i was expecting the pi will experience some kinda of undervoltage situation, and in anticipation i added undervoltage detector in reef-pi :) . Its a common problem we encounter in some builds. But surprisingly it didnt trip, i.e. the power went out without lowering voltage (or at least thats what im concluding/deciphering).

IMG_9734.jpg



None the less, i'll proceed testing with temp sensor, float switch, airstone , submersible pumps etc. And keep you all posted. I think this is pretty cool, it solves emergency backup situation as well as portable controller think (i need that for my saltwater mixing use case). If nothing, the airstone and pump can be directly hooked up to the powerbank for maximum run time.

Screen Shot 2019-12-30 at 10.43.04 AM.png


@Bigtrout @Michael Lane @theatrus and other with more electrical/electronics understanding, can you decipher anything from this data. Here are the key summary:
- 3300 mAh powebank with 5v output
- Pi zero w draws 100-140ma
- Runtime was16.3 hours
 

raketemensch

Ape That Likes Fish
View Badges
Joined
Oct 13, 2019
Messages
378
Reaction score
478
Location
Northwest CT
Rating - 0%
0   0   0
[EDIT] Yes, it is working, I see the values changing in daemon.log.

Will the ATO chart on the dashboard show activity for just an ATO trigger, or is pump triggering also required?

I've got a float switch hooked up to IO27 on the goby hat, but I'm not seeing any activity. It's just 2 wires, so I don't think it's possible to have them backwards...
 
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
[EDIT] Yes, it is working, I see the values changing in daemon.log.

Will the ATO chart on the dashboard show activity for just an ATO trigger, or is pump triggering also required?

I've got a float switch hooked up to IO27 on the goby hat, but I'm not seeing any activity. It's just 2 wires, so I don't think it's possible to have them backwards...
So this is sorted right? ML hats work with float switch?
 

raketemensch

Ape That Likes Fish
View Badges
Joined
Oct 13, 2019
Messages
378
Reaction score
478
Location
Northwest CT
Rating - 0%
0   0   0
So what do y'all use for wires for these XLR/JST connections? Got a good, cheap source?

So this is sorted right? ML hats work with float switch?

Well, I see it triggering in the log, but not showing up in the dash. I only have one relay right now, and it's running in my "production" tank, so I'm ordering a new one now. Not gonna mess with Prod :]

I also have a wifi power strip:

Amazon product

...but I don't think it's supported.
 
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
So what do y'all use for wires for these XLR/JST connections? Got a good, cheap source?



Well, I see it triggering in the log, but not showing up in the dash. I only have one relay right now, and it's running in my "production" tank, so I'm ordering a new one now. Not gonna mess with Prod :]

I also have a wifi power strip:

Amazon product

...but I don't think it's supported.

Nope. But it looks really cheap. If its good and theres documentation on how to control it, we can consider supporting this,
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Nothing planned. In 3.0 we introduced HAL (hardware abstraction layer), which makes this sort of things lot easier (can be shipped in a minor release without any major product changes).
On this specific functionality (i/o expansion), we had planned for mcp23017 support for 3.0, but later i de-prioritized it. This is bercause in 3.0, the pwm outputs can be used as standard digital i/o (relay control etc), which mean at least the output features can be offloaded to pca9685 (which are i2c and you can use multiple of them), thus leaving pi GPIO only for inlets/inputs. The newly added support for wifi/smart plugs also contributed to this.

Any specific reason for choosing pcf8574 over mcp23017 for i/o expansion?


Thanks for the info. There is no direct reason to support pcf8574. Basically looking for more I/O control lines. Not knowing what is in plan for future updates/releases I was thinking that this would be easy as there are many prototyping boards already available with pcf8574. In any event mcp23017 is definitely higher capacity and then some.

Few questions if I may:

Is there some sort of listing that would identify planned devices to be supported in future releases?

When do you think mcp23017 support would be available?
 
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
Thanks for the info. There is no direct reason to support pcf8574. Basically looking for more I/O control lines. Not knowing what is in plan for future updates/releases I was thinking that this would be easy as there are many prototyping boards already available with pcf8574. In any event mcp23017 is definitely higher capacity and then some.

Few questions if I may:

Is there some sort of listing that would identify planned devices to be supported in future releases?

When do you think mcp23017 support would be available?
We dont have any planned devices list other than whats already in github issue tracker (mcp23017). I have plans to add support for humidity sensor. @dmolavi is working on DLI pro smart powerstrip driver (no promise).
From reef-pi project execution perspective, my preference has been things that are pragmatic, affordable, reef/marine grade and have been tested thoroughly. What is your target usecase anything specific you are looking for?
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
We dont have any planned devices list other than whats already in github issue tracker (mcp23017). I have plans to add support for humidity sensor. @dmolavi is working on DLI pro smart powerstrip driver (no promise).
From reef-pi project execution perspective, my preference has been things that are pragmatic, affordable, reef/marine grade and have been tested thoroughly. What is your target usecase anything specific you are looking for?

I am very new to reef-pi so I am still exploring. Presently heavy vested in Arduino's and HomeSeer for my tank automation including sensory via Atlas Scientific stamps and bunch of custom built stuff.

I love on how reef-pi is open and assignable so I am definitely very interested in it.

Lets just say that I've only discovered it last week and already flipped my lights controllers from Storm-X to running all 3 fixtures with reef-pi. My custom build 6 channel dosser is next to convert to reef-pi control. Today I was playing with my EHIM feeder, striped the native controller, connected to the PWM and its working like a champ. So at this rate I think everything will be reef-pi controlled. The reef-pi really got me re-thinking everything related to my tank.

From my perspective doing the prototyping is okay but once I have a better picture as to what is supported I typically design custom PCB with all key functions that I will use. So this is why I am asking about the devices that are planned for the support.

As to my wish list, there are two things on top of my list from the hardware support perspective more I/O lines and second support for the Salinity and ORP for Atlas Scientific stamps. I read your response on the Salinity and ORP and agree that they should work just fine with current PH driver support but calibration will be definitely an issue. I am not sure what would be involved in adding the calibration options but if there was a way to pass commands for calibration from reef-pi from some sort of console then this in a way would solve the problem with all Atlas Scientific devices.

The next thing would be the MQTT support.

One observation as to the reef-pi options is that it would be nice if labels would be assignable and not hard coded.

I will give you example with my feeder testing. In order to make it work I had to use DOSER configuration option. This is fine from the function subset perspective but then the label on the Menu bar could not be changed to reflect say Feeder. So it would be nice if you could select the desired operational functions and assign devices Inlets, Outlets, Jacks, etc to a operational role. So just expand what you are already doing with Inlets, Outlets, Jacks but to the menu label.

Yes one could argue that there is nothing wrong with having Feeder function under Doser Menu but I am just one of these guys that like everything nice and tidy.

So perhaps some thought could be put in place as to ability to have this function

Other than that as I mentioned before Outstanding work on reef-pi !!!!!

Best Regards
Mark
 
Last edited:

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Not sure if you already have a device in mind for the humidity but here is what I've been using the BME280 for most of my HomeSeer stuff.

Its I2C very accurate and provides also temperature and barometric pressure in addition to humidity
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
Im playing with a lot of different battery-powered reef-pi options during the holidays (other than hacking on model railroad with reef-pi for my son). And wanted to share some insights,
The goal here is to come up with something that can allow reef-pi users to run minimal system (on demand or automatically) during power outage. As usual with reef-pi, the focus here to get something with frugal, affordable components.
My current thought process is to go with mobile power banks , they are cheap and can run multi-hour, easy to source and have different capacity options. Pair them with 5v airstone and submersible pumps (2W or 3Watts at max). Experiement and document the findings then proceed with 12V beefier/expensive power banks if need be.

With that I first used my wife's 4 year old 4600mAh power bank with a vanilla pi zero w. That ran around 13 hours. But i was not sure how the math works or if the powerbank if giving what its rated for after 4 years of use. So i then got a duracell 3300 mAh powerbank (as shown in the photo) and this one gives roughly 16 hours with wifi and reef-pi running . For some reason, i was expecting the pi will experience some kinda of undervoltage situation, and in anticipation i added undervoltage detector in reef-pi :) . Its a common problem we encounter in some builds. But surprisingly it didnt trip, i.e. the power went out without lowering voltage (or at least thats what im concluding/deciphering).

IMG_9734.jpg



None the less, i'll proceed testing with temp sensor, float switch, airstone , submersible pumps etc. And keep you all posted. I think this is pretty cool, it solves emergency backup situation as well as portable controller think (i need that for my saltwater mixing use case). If nothing, the airstone and pump can be directly hooked up to the powerbank for maximum run time.

Screen Shot 2019-12-30 at 10.43.04 AM.png


@Bigtrout @Michael Lane @theatrus and other with more electrical/electronics understanding, can you decipher anything from this data. Here are the key summary:
- 3300 mAh powebank with 5v output
- Pi zero w draws 100-140ma
- Runtime was16.3 hours
Ok to answer a few of these questions.

Simple calcs show that:
Pi drawing 140 milliamps for 16.3 hours
100x16.3=1630mAh
140×16.3= 2282mAh

You may have noticed that it didn't run for the full 3300mAh that the power bank was rated. The reasons why are: Manufacturer ratings are sometimes made in PERFECT conditions with a brand new battery and /or exaggerated...temp of the battery perfect for the battery chemistry and a small amount of load to use the whole battery over a longer time period. You were not in perfect conditions and probably drawing more load than the manufacturers test. Remember there are no official testing "standards" for this rating.

You noticed that you did not get an undervoltage situation. Im assuming that you are using a lithium power bank. As it gets used a lithium acts differently than the old nicad or nimh batteries. Those batteries would power strongly at first and as they were used up voltage would slowly lower until no longer usable. Lithium batteries tend to hold a good battery voltage longer and then just "die" off with no lowering of voltage.
As an example an older NIMH battery powered drill would run strongly at first and then slowly weaken. You could pull the trigger and the drill would run slower with less power on every use. Eventually the drill would turn very slowly with little power but still run.
The new lithium ion powered drills run just as strong on every use and then when the battery is done...the drill just plain dies until the battery is recharged.
 

Phildago

Well-Known Member
View Badges
Joined
Oct 11, 2019
Messages
854
Reaction score
933
Location
Broad Channel
Rating - 0%
0   0   0
I just got my reef pi running with my doser. It's not setup on the tank yet, I still need to built the enclosure and solder the wiring, but it works!

It got me thinking... My 3d printer is a bit outdated, and I don't have the space to print anymore. Has anyone out there ever repurposed stepper motors, drivers, power supplies or anything else from on of these?
 
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
Ok to answer a few of these questions.

Simple calcs show that:
Pi drawing 140 milliamps for 16.3 hours
100x16.3=1630mAh
140×16.3= 2282mAh

You may have noticed that it didn't run for the full 3300mAh that the power bank was rated. The reasons why are: Manufacturer ratings are sometimes made in PERFECT conditions with a brand new battery and /or exaggerated...temp of the battery perfect for the battery chemistry and a small amount of load to use the whole battery over a longer time period. You were not in perfect conditions and probably drawing more load than the manufacturers test. Remember there are no official testing "standards" for this rating.

You noticed that you did not get an undervoltage situation. Im assuming that you are using a lithium power bank. As it gets used a lithium acts differently than the old nicad or nimh batteries. Those batteries would power strongly at first and as they were used up voltage would slowly lower until no longer usable. Lithium batteries tend to hold a good battery voltage longer and then just "die" off with no lowering of voltage.
As an example an older NIMH battery powered drill would run strongly at first and then slowly weaken. You could pull the trigger and the drill would run slower with less power on every use. Eventually the drill would turn very slowly with little power but still run.
The new lithium ion powered drills run just as strong on every use and then when the battery is done...the drill just plain dies until the battery is recharged.
I am using this one: https://www.duracell.com/en-us/product/1-day-portable-charger-duracell-powerbank/
its based on a 3.2v internal Lithium battery. I am assuming its using an internal boost converter to generate 5v, and probably thats not 100% efficient, which will take away some energy. The sudden cut off instead of low votage may be contributed by that regulator as well.. but not sure. Let me run some more test, and after that i may open it up to check whats inside.
 
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
I just got my reef pi running with my doser. It's not setup on the tank yet, I still need to built the enclosure and solder the wiring, but it works!

It got me thinking... My 3d printer is a bit outdated, and I don't have the space to print anymore. Has anyone out there ever repurposed stepper motors, drivers, power supplies or anything else from on of these?
I am yet to add support for stepper drivers, so no luck on that front. You may be able to reuse the PSU with an lm2596 or appropriate regulator
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Steppers would be nice but not necessary. Invest in a good peralistic pump head. Here is what I am using with l298n
I did change the dc motors from the originals to slower speeds and so far with all my testing I should be able to dose in 0.2ml increments if desired. Timing pumps in 0.2sec for duration. Yes they are big but flawless. Got them on ebay 2 years ago. Had them running with Arduino now converting to Reef-Pi.

1577769393353.png
 
Last edited:

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
I am using this one: https://www.duracell.com/en-us/product/1-day-portable-charger-duracell-powerbank/
its based on a 3.2v internal Lithium battery. I am assuming its using an internal boost converter to generate 5v, and probably thats not 100% efficient, which will take away some energy. The sudden cut off instead of low votage may be contributed by that regulator as well.. but not sure. Let me run some more test, and after that i may open it up to check whats inside.
Yes there will be losses on a boost convertor,
But still neat to experiment. 16 hours of backup is good. Im my case of power goes out 16 hours I have to worry about heat as well as aeration. NW PA gets pretty cold. I just wheel out my 8000watt portable generator, plug it into my transfer switch so I can run everything.
 
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
Dang, I was thinking it was a pwm signal but I guess it's likely more complex than that.
yeah, im not sure if we can use pwm signals as it is. I am looking at common stepper driver codes right now, theres stuff like single phase, dual phase, micro-stepping etc with some precise time related code. there are options for passing pwm signal directly to stepper drivers, but it still involves some directional controls similar to l293d (h bridge). i'll keep you all posted, my goal is to do whatever required to get a nema 17 style peristaltic pump working with reef-pi.
 
Back
Top