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

How much trouble do you think this would be to do with the Reef-pi.
Smart AWC - Auto Water Changer - AutoAqua
https://www.marinedepot.com/Smart_A...Top_Off_Units-AutoAqua-CV21177-FIDPAT-vi.html

I have previously made an AWC using an arduino, just a basic setup with ATO.
I had to put the salt in the container and manually fill it but after that it was a matter of pushing a button and the system would mix the salt water for a few hours to ensure it was mixed thoroughly and then proceed to take out (x)ml at a time every day and put back the same amount.

I’ve just been re writing the code in python for a raspberry pi 2 as have a spare kicking about (Not a master coder as very noob) without a physical setup the code looks to work.
Going to be ordering the bits for it later over the next couple weeks to build it as last one was a few years ago and parts have been lost, repurposed etc.
Looking to use flask to get a basic webserver to be able to see what it’s up to rather than run a display for now.

Rebuilding it to only have to put salt in the container and then it can do the rest, (Fill, Mix, timed changes. And the ability to prompt a container clean by part filling and running the mixing pump and drain the container)

Not going to hijack this thread any longer and may look to start my own thread and if anyone is interested in helping develop the code to something better maybe then all would be welcome.
 
I have previously made an AWC using an arduino, just a basic setup with ATO.
I had to put the salt in the container and manually fill it but after that it was a matter of pushing a button and the system would mix the salt water for a few hours to ensure it was mixed thoroughly and then proceed to take out (x)ml at a time every day and put back the same amount.

I’ve just been re writing the code in python for a raspberry pi 2 as have a spare kicking about (Not a master coder as very noob) without a physical setup the code looks to work.
Going to be ordering the bits for it later over the next couple weeks to build it as last one was a few years ago and parts have been lost, repurposed etc.
Looking to use flask to get a basic webserver to be able to see what it’s up to rather than run a display for now.

Rebuilding it to only have to put salt in the container and then it can do the rest, (Fill, Mix, timed changes. And the ability to prompt a container clean by part filling and running the mixing pump and drain the container)

Not going to hijack this thread any longer and may look to start my own thread and if anyone is interested in helping develop the code to something better maybe then all would be welcome.
Do it
 
It’s been a long electro magnetic night
8BF8FF73-5C99-4726-A97A-1A225C7BD0A3.jpeg
 
I am busy sourcing parts for my build as I go. The Atlas PH kits are pretty expensive here in SA. I found these available locally at a much better price. Could anyone comment whether they will work with the code that is being developed? Or must I wait to get an Atlas kit?

https://www.botshop.co.za/product/ph-probe-module/
https://www.botshop.co.za/product/ph-probe-electrode-bnc-connector/
Im afraid it wont. The circuit you linked requires and analog input pin, pi does not have any. You are right, the current reef-pi ph code is tied to AtlasScientific circuit (their i2c protocol to be specific), but we can revisit that, change it to support something else if theres a compelling reason. I did a fair amount of research before going with atlas scientific probes/circuit. My finding was getting a marine aquarium compatible probe that will be used for continuous monitoring is not cheap. Atlas was the only supplier with some reputation. I do agree its expensive :-( .

I am learning electronics, and once my chops are good enough, I'll certainly attempt to address this. From my discussion with @theatrus , it looks like we should be able to use a dedicated micro controller and to roll our own ph circuit (that does the analog voltage to ph conversion along with voltage isolation. But thats a distant future
 
I've casually seen this thread a few times over the past year, but have not looked into as much as I should have. I started really reading through it just today and I purchased a Raspberry Pi zero and the 16 channel 12 bit PWM board. I should have them tomorrow...can't wait!

The lighting is what has me the most excited, but I also have a few questions about it (sorry if some of these have already been answered - its a long thread):
  • Is the program capable of addressing all 16 channels?
  • I see that you set your lighting levels based upon 2 hour increments - does the lighting smoothly transition between each 2 hour increment?
  • Does it use all 4096 levels of dimming or is it limited to 100 (1% increments)?
  • I currently have 3 lights (left, center, right) with 5 channels of leds each, can I set the middle light to start each channel 15 minutes after the left? (Ex. the Blue channel of the left light starts ramping from 0 at 8:00AM, the center starts ramping at 8:15AM, the right starts ramping up at 8:30AM)
  • Is it possible to incorporate clouds/lightning?
  • Is it possible to do an acclimation period?
  • Is it possible to have the lighting change based upon the season?
 
Last edited:
I've casually seen this thread a few times over the past year, but have not looked into as much as I should have. I started really reading through it just today and I purchased a Raspberry Pi zero and the 16 channel 12 bit PWM board. I should have them tomorrow...can't wait!

The lighting is what has me the most excited, but I also have a few questions about it (sorry if some of these have already been answered - its a long thread):
  • Is the program capable of addressing all 16 channels?
  • I see that you set your lighting levels based upon 2 hour increments - does the lighting smoothly transition between each 2 hour increment?
  • Does it use all 4096 levels of dimming or is it limited to 100 (1% increments)?
  • I currently have 3 lights (left, center, right) with 5 channels of leds each, can I set the middle light to start each channel 15 minutes after the left? (Ex. the Blue channel of the left light starts ramping from 0 at 8:00AM, the center starts ramping at 8:15AM, the right starts ramping up at 8:30AM)
  • Is it possible to incorporate clouds/lightning?
  • Is it possible to do an acclimation period?
  • Is it possible to have the lighting change based upon the season?
Hi,
Thank your for your interest in reef-pi.
  1. You can control all 16 channels via reef-pi
  2. The two our increments are not enforced at once , but linearly in a minute by minute interval. I’ts smooth and does not cause any sudden change.
  3. The ui only allows 1-100% level, which the mapped to 0-4095 range. So , we do take advantage of the entire range, but in discrete 100 intervals. We can certainly revisit this if need be.
  4. We don’t have support for acclimation yet, it planned for 2.0 release , something I am working towards now
  5. The three lights 15 minute interval thing can be done either via setting a thresholds Or using a time to control the on /off of individual channels (assuming they can be wired up via a relay)
  6. No support for storm /cloud simulation yet. You can use the api to do pretty much anything custom you want, but you have to write some code. This won’t be supported via ui at least by 2.0 release
Let me know if you have any questions
 
Hi,
Thank your for your interest in reef-pi.
  1. You can control all 16 channels via reef-pi
  2. The two our increments are not enforced at once , but linearly in a minute by minute interval. I’ts smooth and does not cause any sudden change.
  3. The ui only allows 1-100% level, which the mapped to 0-4095 range. So , we do take advantage of the entire range, but in discrete 100 intervals. We can certainly revisit this if need be.
  4. We don’t have support for acclimation yet, it planned for 2.0 release , something I am working towards now
  5. The three lights 15 minute interval thing can be done either via setting a thresholds Or using a time to control the on /off of individual channels (assuming they can be wired up via a relay)
  6. No support for storm /cloud simulation yet. You can use the api to do pretty much anything custom you want, but you have to write some code. This won’t be supported via ui at least by 2.0 release
Let me know if you have any questions

Great to know I can do all 16 and that the update is minute by minute - can this be updated to be once per second? My thought there (and with #3 is that with only 100 levels of dimming, a noticeable change in dimming level will be seen if the dimming level is small). This would come in to effect when the dimming is just starting to come up from 0 at the beginning of the day, as well as at the end of the day. It also would come into effect in the future when clouds are added (although this would probably necessitate dimming updates of several times per second to have smooth clouds) and when using LEDs as moonlights, especially when trying to simulate moon cycles.

As far as the lights starting at different times, it looks like you are talking about having relays start at different times - I was wanting to have the PWM channels controlling this (an example of what I'm doing currently - and would like to replace with this- is left blue channel start ramping from 0 to 70% at 8:00AM taking 2 hours to get to 70%, the center blue channel would do the same but start at 8:15AM, and the right blue channel would start at 8:30AM. This also happens with my white, OCW, and violet channels for each light.

If I were to try to start coding some of this custom stuff myself, could you point me to the files/functions that would need to be changed?


THANKS!
 
I've casually seen this thread a few times over the past year, but have not looked into as much as I should have. I started really reading through it just today and I purchased a Raspberry Pi zero and the 16 channel 12 bit PWM board. I should have them tomorrow...can't wait!

The lighting is what has me the most excited, but I also have a few questions about it (sorry if some of these have already been answered - its a long thread):
  • Is the program capable of addressing all 16 channels?
  • I see that you set your lighting levels based upon 2 hour increments - does the lighting smoothly transition between each 2 hour increment?
  • Does it use all 4096 levels of dimming or is it limited to 100 (1% increments)?
  • I currently have 3 lights (left, center, right) with 5 channels of leds each, can I set the middle light to start each channel 15 minutes after the left? (Ex. the Blue channel of the left light starts ramping from 0 at 8:00AM, the center starts ramping at 8:15AM, the right starts ramping up at 8:30AM)
  • Is it possible to incorporate clouds/lightning?
  • Is it possible to do an acclimation period?
  • Is it possible to have the lighting change based upon the season?
Do you have any images of these 5 channel led lights.. I am going to build some in the near future and interested ..
 
Great to know I can do all 16 and that the update is minute by minute - can this be updated to be once per second? My thought there (and with #3 is that with only 100 levels of dimming, a noticeable change in dimming level will be seen if the dimming level is small). This would come in to effect when the dimming is just starting to come up from 0 at the beginning of the day, as well as at the end of the day. It also would come into effect in the future when clouds are added (although this would probably necessitate dimming updates of several times per second to have smooth clouds) and when using LEDs as moonlights, especially when trying to simulate moon cycles.

As far as the lights starting at different times, it looks like you are talking about having relays start at different times - I was wanting to have the PWM channels controlling this (an example of what I'm doing currently - and would like to replace with this- is left blue channel start ramping from 0 to 70% at 8:00AM taking 2 hours to get to 70%, the center blue channel would do the same but start at 8:15AM, and the right blue channel would start at 8:30AM. This also happens with my white, OCW, and violet channels for each light.

If I were to try to start coding some of this custom stuff myself, could you point me to the files/functions that would need to be changed?


THANKS!
We can change the update frequency (like per second) , but i doubt how meaningful this is. Given there is only 4096 level, for a 8 hour photo period, you are applying intensity values 8x3600 times. So, most of the time there is nothing really to change, may be a middle ground is better. There is also the risk of thrashing cpu . I think I can make it configurable, and ship with 1 minute interval, and users can change that to suit their needs.
When i say programming, i dont mean you have to change reef-pi code. reef-pi is API driven, and you can use a simpler language like python or javascript/node js to tell reef-pi anything custom you want, including most of the things you have mentioned here: https://reef-pi.github.io/additional-documentation/api/
 
We can change the update frequency (like per second) , but i doubt how meaningful this is. Given there is only 4096 level, for a 8 hour photo period, you are applying intensity values 8x3600 times. So, most of the time there is nothing really to change, may be a middle ground is better. There is also the risk of thrashing cpu . I think I can make it configurable, and ship with 1 minute interval, and users can change that to suit their needs.
When i say programming, i dont mean you have to change reef-pi code. reef-pi is API driven, and you can use a simpler language like python or javascript/node js to tell reef-pi anything custom you want, including most of the things you have mentioned here: https://reef-pi.github.io/additional-documentation/api/
Just to give an example of this, you can use the

POST /api/lights/ID

api endpoint to update a lights intensity directly. So, you can write a tiny bash script that loops over and update the light channel intensities, every second
 
Just thought I’d say: You are awesome, Ranjib!! Your work on this project and the amount of time and effort you spend helping everyone is simply amazing!
 
Just thought I’d say: You are awesome, Ranjib!! Your work on this project and the amount of time and effort you spend helping everyone is simply amazing!
:-) Thank you so much.
Its been a lot of fun and learning experience., and a great way to interact with the community and whole lotta people
thank you again.
 
Im afraid it wont. The circuit you linked requires and analog input pin, pi does not have any. You are right, the current reef-pi ph code is tied to AtlasScientific circuit (their i2c protocol to be specific), but we can revisit that, change it to support something else if theres a compelling reason. I did a fair amount of research before going with atlas scientific probes/circuit. My finding was getting a marine aquarium compatible probe that will be used for continuous monitoring is not cheap. Atlas was the only supplier with some reputation. I do agree its expensive :-( .

I am learning electronics, and once my chops are good enough, I'll certainly attempt to address this. From my discussion with @theatrus , it looks like we should be able to use a dedicated micro controller and to roll our own ph circuit (that does the analog voltage to ph conversion along with voltage isolation. But thats a distant future
Hi Ranjib,
While searching for a cheaper PH alternative I came to following websites some time ago:
https://www.dfrobot.com/product-1025.html#.VsmkkzNIq0c (note, this probe is NOT for continous monitoring!)
Following this site I came to:
https://www.dfrobot.com/wiki/index.php/Gravity:_12-Bit_I2C_DAC_Module_SKU:_DFR0552 (I2C ADC interface with connections and programming info)
https://github.com/Arduinolibrary/D...ty 12-Bit I2C DAC Module (V1.0) Schematic.pdf (I2C schematic)
https://www.dfrobot.com/product-1074.html (industrial PH Probe) or https://de.aliexpress.com/item/Taiw...strie-online-ph-elektrode-PH/32879301297.html

Waiting now for a CNC machine to make PCB's (so far PWM PCB with 16 outputs and MCP23017 I2C I/O interface designed, I know MCP23017 is not supported by Reef-Pi). Next step will then be the PH interface :)
 
Hi Ranjib,
While searching for a cheaper PH alternative I came to following websites some time ago:
https://www.dfrobot.com/product-1025.html#.VsmkkzNIq0c (note, this probe is NOT for continous monitoring!)
Following this site I came to:
https://www.dfrobot.com/wiki/index.php/Gravity:_12-Bit_I2C_DAC_Module_SKU:_DFR0552 (I2C ADC interface with connections and programming info)
https://github.com/Arduinolibrary/DFRobot_Gravity_I2C_12_Bit_DAC_Module/raw/master/DFR0552 Gravity 12-Bit I2C DAC Module (V1.0) Schematic.pdf (I2C schematic)
https://www.dfrobot.com/product-1074.html (industrial PH Probe) or https://de.aliexpress.com/item/Taiw...strie-online-ph-elektrode-PH/32879301297.html

Waiting now for a CNC machine to make PCB's (so far PWM PCB with 16 outputs and MCP23017 I2C I/O interface designed, I know MCP23017 is not supported by Reef-Pi). Next step will then be the PH interface :)
We went through these things before going with atlas scientific ezo. You have to do the calibration code, temperature compensation etc. And once added the ancillary circuit (ADC not DAC) its not clear if the price difference will be too much. Note, you need an analog to didgital conversion cheap (like mcp3008) not a dac (digital to analog conversion, the chip you linked). Another thing to note is, in this route you are using Pi's CPU for the actual computation (voltage value -> ph value, calibration etc). EZO circuit does all this for us,. since it has a full blow MCU(micro controller). The pH probe is pretty much same priced. And among all of these brands, I'll prefer atlas scientific. Although, i think we can use BRS double or single junction probe as well. Since this was the first ph build for me , i didnt risk anything and went with the atlas scientific probe., I'll certainly test out the same circuit with BRS probes as well (and I expect it to work).
 
Thanks Ranjib!

I'm not there yet, but is it possible to use this for temp sensor?

https://www.adafruit.com/product/3290
https://www.adafruit.com/product/3328
Nope. This is like the pH probe gives analog signal and you need the ancillary circuit for it to work with (the one you linked). This is high precision probe though. After using ds18b20, i really didnt feel that we need to check other things, its cheap, stable, and precise enough for most reef tanks (+/- 0.5). The fact that this probes voltage to temperature conversion logic is in linux kernel (one wire driver) make it wiring less hassle, without involving any extra circuit. I do have plans to incorporate temperature calibration logic for ds18b20 as well.
 
Nope. This is like the pH probe gives analog signal and you need the ancillary circuit for it to work with (the one you linked). This is high precision probe though. After using ds18b20, i really didnt feel that we need to check other things, its cheap, stable, and precise enough for most reef tanks (+/- 0.5). The fact that this probes voltage to temperature conversion logic is in linux kernel (one wire driver) make it wiring less hassle, without involving any extra circuit. I do have plans to incorporate temperature calibration logic for ds18b20 as well.
my 3 ds18b temp probes are all within half a deg
 

TOP 10 Trending Threads

Back
Top
Home
Post thread…
Market
What's new