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

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.
 
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?
 
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.
 
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
 
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:
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.
 
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.
 
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
agree they are pretty good and affordable alternative. but i doubt they can be as precise as stepper motors, which is what we need for very precise volume dosing to experiment with things involving titration, other than general dosing.
In fact after running ATO via DC motor based peristaltic pumps and using tropical marine all in one, i think i will not need stepper based dosing pumps purely for dosing regimen. The ATO based dosing is pretty effective when I know whats my ATO consumption at weekly cadence
 
agree they are pretty good and affordable alternative. but i doubt they can be as precise as stepper motors, which is what we need for very precise volume dosing to experiment with things involving titration, other than general dosing.
In fact after running ATO via DC motor based peristaltic pumps and using tropical marine all in one, i think i will not need stepper based dosing pumps purely for dosing regimen. The ATO based dosing is pretty effective when I know whats my ATO consumption at weekly cadence

The L293D can drive stepper motors:
 
Heya,

Quick question regarding Water Level Controller Guide on adafruit. The DFRobot Water sensor data output is connected directly to Rpi's GPIO pin. As this sensor is powered by 5V, high level output will be somewhere around 4.5-4.7V. As far as I know such a high voltage is not really safe for raspberry. Shoundn't it be used with some sort of 5V-3.3V level shifter instead?

Analog input in Reef-Pi is just for 3rd party (non Atlas Scientific) PH meter - am I right?

Happy New Year everyone!
 
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.
@Ranjib
Look into the a4988 stepper driver. It allows precise control of a nema17 stepper with just 2 pins of an arduino. It offers alot including ovetcurrent protection and precise signal decay rates and may be the ticket. Its affordable and comes on a breakout board.
It allows more precise control than a l298 driver. The l293 or l298 drivers are meant for a regular DC motor. Although they work they are inefficient and do not allow proper precise control of a stepper motor.
The A4988 is a priper stepper control. The current limiting key. With a resistor you set the current limit of the driver. The driver sends current up to that limit to the stepper as quick as possible this allows fast precise movement of the motor. The a4988 also allows incremental step control.

If the goal for reef-pi is to control a nema17 stepper head for a precise doser then this is the chip to do it precisely and safely.

Heres some info on using an arduino to do it
 
Last edited:
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

Im just trying to scrounge and recycle anything I can to save some money while making this as consistent as possible.

So far my doser is reliable, so switching it over to reef pi will likely make no difference in the reliability, just add convenience.

That pump head looks awesome, do you remember what it was called or listed under? Just for future reference if any of my pump heads fail
 
Im just trying to scrounge and recycle anything I can to save some money while making this as consistent as possible.

So far my doser is reliable, so switching it over to reef pi will likely make no difference in the reliability, just add convenience.

That pump head looks awesome, do you remember what it was called or listed under? Just for future reference if any of my pump heads fail

You can find them on EBAY, under … "12V 400ml/min Peristaltic Pump Dosing Pump Vacuum Aquarium Lab Analytical Water" just remember they are high flow so you will need to slow them down by changing the DC motor to say 10 rev/min if you want 0.2 ml per dose, then the rest of magic will happen with reef-pi. If you want to dose minimum 1ml per dose then no need to make changes. Reef-Pi can control it at 80% 0.3 sec for 0.5 ml per dose. At least this is what my testing concluded so far.

Nice thing about this head is that its using slotted shaft on the motor so there is way for the slippage and center hub is fitted in the bearing. Its very, very accurate.
 
Last edited:
You can find them on EBAY, under … "12V 400ml/min Peristaltic Pump Dosing Pump Vacuum Aquarium Lab Analytical Water" just remember they are high flow so you will need to slow them down by changing the DC motor to say 10 rev/min if you want 0.2 ml per dose, then the rest of magic will happen with reef-pi. If you want to dose minimum 1ml per dose then no need to make changes. Reef-Pi can control it at 80% 0.3 sec for 0.5 ml per dose. At least this is what my testing concluded so far.

Nice thing about this head is that its using slotted shaft on the motor so there is way for the slippage and center hub is fitted in the bearing. Its very, very accurate.
Excellent. I'd be dosing 1 ml at a time so it's good to go out of the box for me. Thanks
 
it will do both DC and steppers. 2 DC motors per board or 1 stepper
Heya,

Quick question regarding Water Level Controller Guide on adafruit. The DFRobot Water sensor data output is connected directly to Rpi's GPIO pin. As this sensor is powered by 5V, high level output will be somewhere around 4.5-4.7V. As far as I know such a high voltage is not really safe for raspberry. Shoundn't it be used with some sort of 5V-3.3V level shifter instead?

Analog input in Reef-Pi is just for 3rd party (non Atlas Scientific) PH meter - am I right?

Happy New Year everyone!

the voltage will not be 5V as there will be a drop on the junction but still might be little too high for my liking so I would use level shifter or Michael has rather elegant solution that you can adopt, Zener will do the trick to keep the voltage at 3.3V max .... ( your connection point input would be where the switch is.)

1577808090104.png
 
Heya,

Quick question regarding Water Level Controller Guide on adafruit. The DFRobot Water sensor data output is connected directly to Rpi's GPIO pin. As this sensor is powered by 5V, high level output will be somewhere around 4.5-4.7V. As far as I know such a high voltage is not really safe for raspberry. Shoundn't it be used with some sort of 5V-3.3V level shifter instead?

Analog input in Reef-Pi is just for 3rd party (non Atlas Scientific) PH meter - am I right?

Happy New Year everyone!
There’s a dfrobot board in between that interfaces pi gpio /5v with the sensor
 
@Ranjib
Look into the a4988 stepper driver. It allows precise control of a nema17 stepper with just 2 pins of an arduino. It offers alot including ovetcurrent protection and precise signal decay rates and may be the ticket. Its affordable and comes on a breakout board.
It allows more precise control than a l298 driver. The l293 or l298 drivers are meant for a regular DC motor. Although they work they are inefficient and do not allow proper precise control of a stepper motor.
The A4988 is a priper stepper control. The current limiting key. With a resistor you set the current limit of the driver. The driver sends current up to that limit to the stepper as quick as possible this allows fast precise movement of the motor. The a4988 also allows incremental step control.

If the goal for reef-pi is to control a nema17 stepper head for a precise doser then this is the chip to do it precisely and safely.

Heres some info on using an arduino to do it
I’ll check it out ,
 

TOP 10 Trending Threads

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 25 64.1%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 14 35.9%
Back
Top
Home
Post thread…
Market
What's new