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,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Understood, I wasn't sure if the MCP3008 support was still in here or not and no sense in reinventing the wheel if already have a good one. I can answer some of the questions:

Price:
MCP3008 ADC chip - $4
eBay PH interface board - $8
PH Probe - BRS Single Junction PH probe $35 ( you could even go for a better one, just don't get a cheap one)
Analog Isolation Board - $20 (you can skip this, but you can expect unreliable results)
Atlas Scientific PH calibration Solution (4.0, 7.0, 10.0) - $15

So you are looking at about $82 plus cost of solder, wire, connecters, etc...

Construction:
This is no more difficult than anything else we have wired up. I have a schematic drawn up already.

Performance:
negligible, one call to the MCP3008 to get the digital value
one more line of code to convert that to a PH number; everything else is done in hardware, the Pi won't even know its there when its not asking for data.

Coding Effort:
I have a sample Python script I've written that handles getting the data and doing the necessary calibration for an accurate PH. I use a 3-point calibration at 4.0, 7.0, and 10.0 PH. Honestly, we could probably get away with 2-points and just use the high end, but this is how it is now. We would need to port this to GO of course. To ensure the best quality data I included some statistical analysis in my script so we can record n number of points, calculate the standard deviation and throw out any outliers more than 1-sigma away from standard deviation, this will eliminate any random noise that might pop up (This is configurable, you can set it however you like). It also plots a histogram so you can get a visual of the data dispersion.
I don't know anything about GO, so I don't know how much effort this will be to port it over.

Scalability
The MCP3008 has 8 channels, I am only using 2 (tank ph and a second ph for future calcium reactor). I image l can integrate Salinity and ORP in much the same way, and that still leaves 4 more channels open for suggestions.

If it sounds like something you are interested in let me know and I can send you some files. After that if you think it looks good you then already have most of what you need to test it out, you probably just need the $8 eBay PH board to see it work.
Right. So this is one set of plan, with mcp3008, a ph breakout board. Can you share a link for the ph breakout board. Few other questions:
- What about other ADCs, I was looking at ads1115 as well, its little bit costly, but 16 bits?
- We'll need voltage isolators as well if we are considering multiple probes. With atlasscientific, this is very straight forward, but something we have to remember (and ancillary circuits) when rolling our own

Calibration code (1 point, 2 point or 3 points) will be added as a generic library in reef-pi (post 2.0,) and available for all sensors , I am not too worried about that.
If you are serious about this (natively support an ADC in reef-pi and use it atleast in a ph probe), lets settle on these details, and get started. I am more than happy to chip in for coding parts, but I want to ensure that we have a reliable design (since we are going our own) and reliable supply chain. i.e. if we are relying on any ancillary boards it has to be a reputed openhardware vendor (adafruit, sparkfun, dfrobot all are kosher... random dudes in ebay is not kosher :-) ).
This is exciting, thanks for starting this discussion
 

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
So the HAT is ready to order PCB's for testing :)

upload_2018-7-31_11-34-31.png


It requires 12V input (and 5V to the PI) and offers an interface to max 16 external relais, 2 dosing pumps, I2C interface, 2 ATO's and interface to DS18B20 temperature sensors and fits directly on the PI ;Happy. So the whole device is the size of the PI, only slighty higher.

Due to its compactness I'm thinking of making a different PWM board which could fit on top as well. Have to think how to add more (I2C) boards on top such as the BNC interfaces.

Actual size:

upload_2018-7-31_11-42-42.png
 

ReefSpy

New Member
View Badges
Joined
Nov 21, 2017
Messages
13
Reaction score
40
Location
Planet Earth
Rating - 0%
0   0   0
Can you share a link for the ph breakout board.
It seems to be a generic board found under different labels (I have two identical boards just different branding). Searching on eBay for "Arduino PH" you should find one that looks like this (note the pins are opposite the BNC and the 2 blue pots on the side. There are other similar ones out there, but this is the one I tested):

s-l225.jpg

I got mine on eBay, but here is a link direct from manufacturer:
https://www.diymore.cc/products/diy...ensor-module-monitoring-control-for-arduino-m

- What about other ADCs, I was looking at ads1115 as well, its little bit costly, but 16 bits?
I have found at 10-bits I get a resolution of .02 pH. I think this is more than enough for our needs.

We'll need voltage isolators as well if we are considering multiple probes. With atlasscientific, this is very straight forward, but something we have to remember (and ancillary circuits) when rolling our own
I use the Analog Isolation Module from DFRobot and it does the trick. It should work with any 5v probe, its just plug and play, nothing to do except modify the included wire to connect to the device of your choice.

https://www.dfrobot.com/product-1621.html
 

sjeff35

Active Member
View Badges
Joined
Jun 14, 2018
Messages
172
Reaction score
356
Location
Corrales, NM
Rating - 0%
0   0   0
So the HAT is ready to order PCB's for testing :)

upload_2018-7-31_11-34-31.png


It requires 12V input (and 5V to the PI) and offers an interface to max 16 external relais, 2 dosing pumps, I2C interface, 2 ATO's and interface to DS18B20 temperature sensors and fits directly on the PI ;Happy. So the whole device is the size of the PI, only slighty higher.

Due to its compactness I'm thinking of making a different PWM board which could fit on top as well. Have to think how to add more (I2C) boards on top such as the BNC interfaces.

Actual size:

upload_2018-7-31_11-42-42.png



shut up take money.png
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,288
Location
lost
Rating - 0%
0   0   0
So the HAT is ready to order PCB's for testing :)

upload_2018-7-31_11-34-31.png


It requires 12V input (and 5V to the PI) and offers an interface to max 16 external relais, 2 dosing pumps, I2C interface, 2 ATO's and interface to DS18B20 temperature sensors and fits directly on the PI ;Happy. So the whole device is the size of the PI, only slighty higher.

Due to its compactness I'm thinking of making a different PWM board which could fit on top as well. Have to think how to add more (I2C) boards on top such as the BNC interfaces.

Actual size:

upload_2018-7-31_11-42-42.png
This is very similar in function to my hat proto board
 

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
You can order PCB's yourself ;), will give all details after I tested the first boards.

Already know there is 1 wire missing which was easy to resolve (GND to I2C). Also wires to the dosing pumps are already increased. Let me just test the first boards, I've ordered the HAT and PWM PCB's to verify the schematics. PCB lay-out will then be OK.

Present idea is to use stackable connectors for the I2C interface, will require some design change to the present PCB lay-out (change to 2*3 through hole), but then we could just increase the height of he RP footprint for the housing :).

For connectors (reminding Ranjib's comment to have all connectors at 1 side), we could have an additional housing with a 'U-shape' connection, to avoid fluid going up.
 
Last edited:

Rob Wheatley

New Member
View Badges
Joined
Jul 29, 2018
Messages
6
Reaction score
10
Rating - 0%
0   0   0
I can say yes writing a GUI is more code to maintain. When I started my project I wanted code that would work ok the pi plus any device (phone/tablet/pc) so I went web base. After starting over I decided to focus on the touch screen gui and the code is much more intail then the web one. Now I am sure a lot of it have to do with not knowing the code lang so its baby steps but still a lot going on there. Once I get my touch screen gui where I want it I am going to add a web/app connection as well
Have to say i like the look of the interface, looks like I'm going to have to learn python etc.

Have also seen the ReefberryPi one and that gui looks good to.

Will have to try and work out if there is a way of reading gpio pins and sensor inputs at the same time that Reef-pi is using them just to display the data first.

@Ranjib got the display working ok now on the touch screen and so far it seems very stable, had it running for the last 48 hours with no problems.

I plan to use a box to house the sensor pcb's and use an Ethernet cable to connect that to the Pi so there are less wires around the main unit, will be 4 optical level sensors and 2 ds18b20 probes, don't think it will pull too much power from one 5v supply.

That way it's easy to swap a sensor in the event of failure.

What is the best editor for GO code?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Have to say i like the look of the interface, looks like I'm going to have to learn python etc.

Have also seen the ReefberryPi one and that gui looks good to.

Will have to try and work out if there is a way of reading gpio pins and sensor inputs at the same time that Reef-pi is using them just to display the data first.

@Ranjib got the display working ok now on the touch screen and so far it seems very stable, had it running for the last 48 hours with no problems.

I plan to use a box to house the sensor pcb's and use an Ethernet cable to connect that to the Pi so there are less wires around the main unit, will be 4 optical level sensors and 2 ds18b20 probes, don't think it will pull too much power from one 5v supply.

That way it's easy to swap a sensor in the event of failure.

What is the best editor for GO code?
I am missing something, why you have to learn python?
Reading GPIO pins is easy, just read the corresponding sysfs file, for example following will read the value of gpio27
Code:
 cat /sys/class/gpio/gpio27/value
It is safe to read gpio from another program, while reef-pi is running/using it. Dont do writes against them, that may hamper with reef-pi's functionality

I use vi for everything (go, ruby, python, javascript etc), the only time i use and IDE or something else if I am using java (i prefer IntelliJ). I have seen folks using sublime or goland with success as well
 

Fish Fan

Master of Disaster
View Badges
Joined
Dec 8, 2017
Messages
12,922
Reaction score
33,645
Location
461 Ocean Boulevard
Rating - 100%
6   0   0
Hi guys! Quick question, please. I am still considering trying to DIY a light system, and I want to make sure it works well with the Reef-Pi controller project. Does anyone here use the NanoBox V3.1 DIY arrays? I *believe* reef-pi could be made to control these LED's, and I believe them to be a solid choice for the money, but I wanted to ask here for sure. Any thoughts would be greatly appreciated!

Thank you!

-Fish Fan
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
It seems to be a generic board found under different labels (I have two identical boards just different branding). Searching on eBay for "Arduino PH" you should find one that looks like this (note the pins are opposite the BNC and the 2 blue pots on the side. There are other similar ones out there, but this is the one I tested):

s-l225.jpg

I got mine on eBay, but here is a link direct from manufacturer:
https://www.diymore.cc/products/diy...ensor-module-monitoring-control-for-arduino-m


I have found at 10-bits I get a resolution of .02 pH. I think this is more than enough for our needs.


I use the Analog Isolation Module from DFRobot and it does the trick. It should work with any 5v probe, its just plug and play, nothing to do except modify the included wire to connect to the device of your choice.

https://www.dfrobot.com/product-1621.html
Sounds good.
Lets find a reputable alternative source for the BNC breakout board. If not, lets roll that in our design. AtalasScientific voltage isolators are 26$, while dfrobots are 20$.
 

njtiger aquariums

Well-Known Member
View Badges
Joined
Oct 9, 2015
Messages
513
Reaction score
520
Location
NV
Rating - 0%
0   0   0
Have to say i like the look of the interface, looks like I'm going to have to learn python etc.

Have also seen the ReefberryPi one and that gui looks good to.

Will have to try and work out if there is a way of reading gpio pins and sensor inputs at the same time that Reef-pi is using them just to display the data first.

@Ranjib got the display working ok now on the touch screen and so far it seems very stable, had it running for the last 48 hours with no problems.

I plan to use a box to house the sensor pcb's and use an Ethernet cable to connect that to the Pi so there are less wires around the main unit, will be 4 optical level sensors and 2 ds18b20 probes, don't think it will pull too much power from one 5v supply.

That way it's easy to swap a sensor in the event of failure.

What is the best editor for GO code?

Thanks. No I have not heard of Reefberry Pi. I will have to look it up when I get a second

I am missing something, why you have to learn python?

I use vi for everything (go, ruby, python, javascript etc), the only time i use and IDE or something else if I am using java (i prefer IntelliJ). I have seen folks using sublime or goland with success as well

I think he was talking about python and my project not Reef-Pi.

I use Sublime and it seems to work well for me
 

sjeff35

Active Member
View Badges
Joined
Jun 14, 2018
Messages
172
Reaction score
356
Location
Corrales, NM
Rating - 0%
0   0   0
You can order PCB's yourself ;), will give all details after I tested the first boards.

Already know there is 1 wire missing which was easy to resolve (GND to I2C). Also wires to the dosing pumps are already increased. Let me just test the first boards, I've ordered the HAT and PWM PCB's to verify the schematics. PCB lay-out will then be OK.

Present idea is to use stackable connectors for the I2C interface, will require some design change to the present PCB lay-out (change to 2*3 through hole), but then we could just increase the height of he RP footprint for the housing :).

For connectors (reminding Ranjib's comment to have all connectors at 1 side), we could have an additional housing with a 'U-shape' connection, to avoid fluid going up.


I'm wondering if it makes sense to do a group buy rather that a one off deal? I'm more than happy to contribute.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So the HAT is ready to order PCB's for testing :)

upload_2018-7-31_11-34-31.png


It requires 12V input (and 5V to the PI) and offers an interface to max 16 external relais, 2 dosing pumps, I2C interface, 2 ATO's and interface to DS18B20 temperature sensors and fits directly on the PI ;Happy. So the whole device is the size of the PI, only slighty higher.

Due to its compactness I'm thinking of making a different PWM board which could fit on top as well. Have to think how to add more (I2C) boards on top such as the BNC interfaces.

Actual size:

upload_2018-7-31_11-42-42.png
I am assuming you have rolled in the ato circuits inside the hat, thats very nice :-) , gonna save folks little bit of money.
How the relays are connected to the board ? i.e. whats the connector type? It might be worth mounting the connector directly or think of how it upfront. I would love to see us settling on ADJ SR 2 power bars, which uses 12v , db9 connectors.

I think most of us will be just fine to have the controller little bit bigger (like 4"x7"), so throwing some extra space is fine. That will also openup more space for connectors. l293d uses the GND pins as heat sink as well, so the a bigger board will automatically act as beefier heat sink. I am wondering if its better to not design this as hat (due to space constrain, and stacking things together leads to strange pillar like form factor) and instead think of the board as a bigger, flatter pcb and users can solder through hole components in it, and attach the pi header socket and directly mount the pi there. Put otherway, is there any obvious gains by sticking to Pi hat form factor?


This is super duper awesome :0-) . Thank you so much.
If your design works out, then I am game for buying a bantamtools (personal pcb milling machine) and try things myself. :-)
 

sjeff35

Active Member
View Badges
Joined
Jun 14, 2018
Messages
172
Reaction score
356
Location
Corrales, NM
Rating - 0%
0   0   0
I am assuming you have rolled in the ato circuits inside the hat, thats very nice :) , gonna save folks little bit of money.
How the relays are connected to the board ? i.e. whats the connector type? It might be worth mounting the connector directly or think of how it upfront. I would love to see us settling on ADJ SR 2 power bars, which uses 12v , db9 connectors.

^^^This!!! I have one of those ADJ bars. It would be awesome if the board had a DB9 jack or 2 on it.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hi guys! Quick question, please. I am still considering trying to DIY a light system, and I want to make sure it works well with the Reef-Pi controller project. Does anyone here use the NanoBox V3.1 DIY arrays? I *believe* reef-pi could be made to control these LED's, and I believe them to be a solid choice for the money, but I wanted to ask here for sure. Any thoughts would be greatly appreciated!

Thank you!

-Fish Fan
Yes, it should be, the recommended driver board uses meanwell ldd-h drivers, and those are pwm controllable. So ideally, you'll just connect the pca9685 pwm channel to the pwm pins of the driver board and it should work as it is. What I am not sure if they work with straight 5v pwm or needs something different. But I wont be too worried about it since that can be addressed by any common npn transistor
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I am assuming you have rolled in the ato circuits inside the hat, thats very nice :) , gonna save folks little bit of money.
How the relays are connected to the board ? i.e. whats the connector type? It might be worth mounting the connector directly or think of how it upfront. I would love to see us settling on ADJ SR 2 power bars, which uses 12v , db9 connectors.

I think most of us will be just fine to have the controller little bit bigger (like 4"x7"), so throwing some extra space is fine. That will also openup more space for connectors. l293d uses the GND pins as heat sink as well, so the a bigger board will automatically act as beefier heat sink. I am wondering if its better to not design this as hat (due to space constrain, and stacking things together leads to strange pillar like form factor) and instead think of the board as a bigger, flatter pcb and users can solder through hole components in it, and attach the pi header socket and directly mount the pi there. Put otherway, is there any obvious gains by sticking to Pi hat form factor?


This is super duper awesome :0-) . Thank you so much.
If your design works out, then I am game for buying a bantamtools (personal pcb milling machine) and try things myself. :)
Also I could not spot how you are generating the 5v for Pi from 12v input. Is it assumed there will be an lm2596 ?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Meanwhile...the macro module is functionally ready. Working on adding tests now, after that it will be merged and we are ready for our final beta release. After bneta release, we wont have any new major features for 2.0, and there will be only bug fixes (alpha), once all known blocking bugs (things that impact reef-pi fatally and has no workaround) are sorted, we'll hit final RCs (release candidates) which are recommended for anyone who want to try out a stable 2.0 build, the RC that will have no issues will become final 2.0 release.

Coming back to the macro features, a macro is a set of steps executed sequentially. A step has a type (and some rudimentary configuration) and action. Type can be equipment or timer or ato or temperature controller etc and action can be on or off. Theres a special type called wait, which just induce pause or delays inbetween steps. Here are some screen shots
Screen Shot 2018-07-31 at 8.16.22 AM.png

Details of a macro
Screen Shot 2018-07-31 at 8.16.32 AM.png

As of now, not everything is supported yet , but most useful things are already there (ato, ph, temperature, equipment etc). This is a risky module, as user can inadvertently botch their setup, if programmed wrongly. So we have to document it with ample warnings for possible mishaps.
What do you all think? Those of you who wanted this feature, do you think this solves your intended use case?
 

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
It might be worth mounting the connector directly or think of how it upfront. I would love to see us settling on ADJ SR 2 power bars, which uses 12v , db9 connectors.

If your design works out, then I am game for buying a bantamtools (personal pcb milling machine) and try things myself. :)

DB9 on this size will be impossible :oops: That's why I proposed to use a U-turn cable housing.

Don't buy a milling macichne (I did), just order the PCB's after I tested them ;)
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 38 26.8%
  • 100% dry rock + 100% live sand

    Votes: 48 33.8%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 32 22.5%
  • 75% live rock, 25% live sand

    Votes: 14 9.9%
  • 25% live rock, 75% live sand

    Votes: 10 7.0%
Back
Top