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

njtiger aquariums

Well-Known Member
View Badges
Joined
Oct 9, 2015
Messages
513
Reaction score
520
Location
NV
Rating - 0%
0   0   0
Yes I have encountered this (and report somewhere in this thread), I think we should recommend a different 3pin connector for temperature sensor (like xlr/dmx ) .
After my initial experience with this issue I have started powering down pi before attaching new temperature sensor

I do not know what these connectors are called. I got them from my brother who got them for his chrismtas lights. I have discconected the sensor a couple of times with no issues. I even programed my system that if it doesn't see the temp sesnor to disable the code that checks for the temp.

IMG_0156.JPG
IMG_0157.JPG
 

Rob Wheatley

New Member
View Badges
Joined
Jul 29, 2018
Messages
6
Reaction score
10
Rating - 0%
0   0   0
Hi rob
Thank you for considering reef-pi.
All gpio port can be used either as input or output , but you are right some have special use , for example gpio 4 is used for temperature sensor , while 18 & 19 is used for pwm ...and there are few others . I would say you are safe to use up to 16 -18 gpio pin safely
This is for 1.0, but still relevant
https://reef-pi.github.io/general-guides/electronics/
Hi Ranjib
No thank you for the chance to try it, so far it does nearly all the things I was looking for.

I did see in the thread a suggestion for a feed button that would be very handy, not sure how easy it would be to code in ( I'm very new to code, can do a little bit for the arduino but not really got the hang of python etc yet)

Also the ability to use the touch display as the controller, that would be icing on the cake, the web based one works fine on a laptop but on the 7" display the graphs overlap each other, would make checking the parameters easier too as the Pi would be right next to the tank anyway.

Once I have tested it for a while it will be put to use on my hospital tank first, I made an ATO for that with an arduino, float switches and a timer relay to prevent the pump running to long, that does work but every now and again it takes to long to top up and the safety cuts it off. The return to the sump is a worry to, I had to put a valve on it to keep it quiet but if it blocks there is no overflow so needed something to cut the return pump off if the tank level got to high, Reefpi will do that nicely.

I have just ordered 4 of the optical level sensors from DFRobot with the interface boards, the ones I'm using are the same sensor (banggood) but I have to add the resistors and extend the wires so in effect they are more expensive than DFRobot (and a pain to do)

Lighting is not to much of a problem as the hospital tank only has basic non dimmable blue and whites so a timer and relay will do them but the main tank has dsuny full spectrum ones so not sure if they are hackable as the controller plugs into one of the lights.

I did make a unit to power all the pumps, wavemakers, doser, ATO etc on the main tank from one 24v 25 amp power supply with a home brew battery backup, mainly to get rid of all the individual power bricks and the free up sockets (in the UK they are a pain that the take up so much room) so adding Reefpi to that will be quite easy.

Thanks again, I'm sure I will be asking loads more questions [emoji846]
 

njtiger aquariums

Well-Known Member
View Badges
Joined
Oct 9, 2015
Messages
513
Reaction score
520
Location
NV
Rating - 0%
0   0   0
Hi Ranjib
No thank you for the chance to try it, so far it does nearly all the things I was looking for.

I did see in the thread a suggestion for a feed button that would be very handy, not sure how easy it would be to code in ( I'm very new to code, can do a little bit for the arduino but not really got the hang of python etc yet)

Also the ability to use the touch display as the controller, that would be icing on the cake, the web based one works fine on a laptop but on the 7" display the graphs overlap each other, would make checking the parameters easier too as the Pi would be right next to the tank anyway.

Once I have tested it for a while it will be put to use on my hospital tank first, I made an ATO for that with an arduino, float switches and a timer relay to prevent the pump running to long, that does work but every now and again it takes to long to top up and the safety cuts it off. The return to the sump is a worry to, I had to put a valve on it to keep it quiet but if it blocks there is no overflow so needed something to cut the return pump off if the tank level got to high, Reefpi will do that nicely.

I have just ordered 4 of the optical level sensors from DFRobot with the interface boards, the ones I'm using are the same sensor (banggood) but I have to add the resistors and extend the wires so in effect they are more expensive than DFRobot (and a pain to do)

Lighting is not to much of a problem as the hospital tank only has basic non dimmable blue and whites so a timer and relay will do them but the main tank has dsuny full spectrum ones so not sure if they are hackable as the controller plugs into one of the lights.

I did make a unit to power all the pumps, wavemakers, doser, ATO etc on the main tank from one 24v 25 amp power supply with a home brew battery backup, mainly to get rid of all the individual power bricks and the free up sockets (in the UK they are a pain that the take up so much room) so adding Reefpi to that will be quite easy.

Thanks again, I'm sure I will be asking loads more questions [emoji846]

You should check out my project. I am not open source like reef-pi nor as far as reef-pi but my project has some of the options you are looking for. I can provide pointers even though I am not providing my code yet - https://www.reef2reef.com/threads/diy-control-system-i-am-building.229595/page-7#post-4923397
 
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 do not know what these connectors are called. I got them from my brother who got them for his chrismtas lights. I have discconected the sensor a couple of times with no issues. I even programed my system that if it doesn't see the temp sesnor to disable the code that checks for the temp.

IMG_0156.JPG
IMG_0157.JPG
Yessss.. these are the xlr / dmx connectors . We can use rj9 or Bnc as well,, anything that does not have the problem of shorting the ends when you plug / unplug
 

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
I am wondering how two l293d is controlling 8 dosing pumps?
Hi Ranjib,
just now when I started to work on the HAT I understand your question better ;)
My daughterboard is connected to the I2C bus (PCA9685). After reading this article again:

theres no fritzing file or documentation yet, but this should get you going:
- L293d is the main IC here: https://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor/lm293d
- en1 and en2 pins are wired to pi GPIO 18 & 19 ( declare them as jacks with rpi driver in reef-pi)
- IN1, IN2, IN3, IN4 are all connected to other GPIO (declare them as outlets in reef-pi, and create 4 virtual equipment to control them)
I'm not sure where I copied it from, but I think you wrote this. A couple of questions:
= Why is it required to use the en1 and en2 pins (it consumes 2 GPIO ports)?
= Is there a need to drive the dosing pumps in 2 directions?

If possible I would like to have the HAT drive following functions:
2 * 8 port relays
DS18B20 sensors
2 Dosings as described above
I2C interface
ATO

However if I counted correctly I will then have no spare GPIO and if possible would like to have more ATO's...

thanks
 
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 Ranjib,
just now when I started to work on the HAT I understand your question better ;)
My daughterboard is connected to the I2C bus (PCA9685). After reading this article again:


I'm not sure where I copied it from, but I think you wrote this. A couple of questions:
= Why is it required to use the en1 and en2 pins (it consumes 2 GPIO ports)?
= Is there a need to drive the dosing pumps in 2 directions?

If possible I would like to have the HAT drive following functions:
2 * 8 port relays
DS18B20 sensors
2 Dosings as described above
I2C interface
ATO

However if I counted correctly I will then have no spare GPIO and if possible would like to have more ATO's...

thanks
I dont know for sure if its required to control the direction of dosing pump, you can certainly fixed their direction, thus, saving 4 GPIO. Or add a physical switch to control the direction. In my build., its a standalone dosing controller, hence I have ample GPIO, and I went with that configuration.
For what its worth, they dosing module in reef-pi is not directionality aware, it only allows controlling the speed, and I have created virtual outlet/equipment to control the direction (and to switch off by in1/in2). en1/2 are PWM pins, which are connected to PI pwm pins (GPIO 18 & 19). If you are using pca9685 for pwm, you'll use any of pca9685 pins.
In short, you can definitely fix the direction, and save 4 GPIO. I went with it (using 4 GPIO to control direction as well as switch it off) because I have spare GPIOs.

Total number of GPIO is going to be a concern if you are driving more that 12 outlets. I plan to work on supporting mcp23017 in 3.x series (read it as after Christmas) which solve this, and we can have lot more outlet/inlet
 
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 Ranjib
No thank you for the chance to try it, so far it does nearly all the things I was looking for.

I did see in the thread a suggestion for a feed button that would be very handy, not sure how easy it would be to code in ( I'm very new to code, can do a little bit for the arduino but not really got the hang of python etc yet)

Also the ability to use the touch display as the controller, that would be icing on the cake, the web based one works fine on a laptop but on the 7" display the graphs overlap each other, would make checking the parameters easier too as the Pi would be right next to the tank anyway.

Once I have tested it for a while it will be put to use on my hospital tank first, I made an ATO for that with an arduino, float switches and a timer relay to prevent the pump running to long, that does work but every now and again it takes to long to top up and the safety cuts it off. The return to the sump is a worry to, I had to put a valve on it to keep it quiet but if it blocks there is no overflow so needed something to cut the return pump off if the tank level got to high, Reefpi will do that nicely.

I have just ordered 4 of the optical level sensors from DFRobot with the interface boards, the ones I'm using are the same sensor (banggood) but I have to add the resistors and extend the wires so in effect they are more expensive than DFRobot (and a pain to do)

Lighting is not to much of a problem as the hospital tank only has basic non dimmable blue and whites so a timer and relay will do them but the main tank has dsuny full spectrum ones so not sure if they are hackable as the controller plugs into one of the lights.

I did make a unit to power all the pumps, wavemakers, doser, ATO etc on the main tank from one 24v 25 amp power supply with a home brew battery backup, mainly to get rid of all the individual power bricks and the free up sockets (in the UK they are a pain that the take up so much room) so adding Reefpi to that will be quite easy.

Thanks again, I'm sure I will be asking loads more questions [emoji846]
Configure the dimension (height & width ) of charts from the Configuration -> Dashboard settings to fit your pi touch screen. If i recall correctly , pi touch screen is 800x480, so go with 350x150 for charts. As of now, reef-pi only has web / browser based interface. I am tempted to write a qt based GUI, but I think it will be lot of extra code to maintain, I think I'll prefer to work on a native mobile client instead, if I have the time.
 
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
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
Thank you Ranjib,the tinker board more expensive but i have used asus for 20 year long and never ever had any problem with the board and the components.Have only one site: https://www.asus.com/ca-en/Single-Board-Computer/Tinker-Board/
Thank you for your help and that tons of work what you provide for the forum members.System was working for one month and today my fan just turned on for no reason i check the pi and my temp sensor reported 120 for the pi so pi turn the fan on.But in real life temp was ok on the second temp sensor.This is when i try to pull out the 3.5 mm stereo jack and plug in again.Pi started to reset by it self,on the setting page (web browser)i click the reboot button and from there never started.@Raspberry forum they suggested wait for 1or2 day and the Polyfuse will reset by it self.
hmm.. thats unfortunate. i always keep a backup sd card, but till now most of my build sustained multiple hard resets without any issue. I am thinking about an easy way to backup and restore data in reef-pi, we need it for exactly this type of scenarios
 

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
I dont know for sure if its required to control the direction of dosing pump, you can certainly fixed their direction, thus, saving 4 GPIO. Or add a physical switch to control the direction. In my build., its a standalone dosing controller, hence I have ample GPIO, and I went with that configuration.
For what its worth, they dosing module in reef-pi is not directionality aware, it only allows controlling the speed, and I have created virtual outlet/equipment to control the direction (and to switch off by in1/in2). en1/2 are PWM pins, which are connected to PI pwm pins (GPIO 18 & 19). If you are using pca9685 for pwm, you'll use any of pca9685 pins.
In short, you can definitely fix the direction, and save 4 GPIO. I went with it (using 4 GPIO to control direction as well as switch it off) because I have spare GPIOs.

Total number of GPIO is going to be a concern if you are driving more that 12 outlets. I plan to work on supporting mcp23017 in 3.x series (read it as after Christmas) which solve this, and we can have lot more outlet/inlet
Understood, thanks!
 

janos

Active Member
View Badges
Joined
Jun 4, 2017
Messages
267
Reaction score
259
Location
Toronto,Canada
Rating - 0%
0   0   0
Thank you Ranjib,i have 4 SD card plus lot of USB thumb drive but it is not help.The Raspberry by it self do not want to start.Nothing wrong with the sd card. Always thank you for your help.
 

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
Thank you Ranjib,i have 4 SD card plus lot of USB thumb drive but it is not help.The Raspberry by it self do not want to start.Nothing wrong with the sd card. Always thank you for your help.

What is your pin configuration on the headphone jack you are using?
The tip should be the +VDC connection so that it does not short to any other conductors during mating.

Have you tested the power supply, or tried using a different supply? If it shorted while mating the connectors, it is possible could have pulled too much current and damaged the supply.
 

janos

Active Member
View Badges
Joined
Jun 4, 2017
Messages
267
Reaction score
259
Location
Toronto,Canada
Rating - 0%
0   0   0
Thank you Ryan115 try different PS but no luck,the pin i do not know i try to check right now as you mentioned,ask in teh Raspberry forum read at least 15 different website and the answer always the same.1 or 2 day later the (Polyfuse)will heal by it self.Would be nice if it is.Now i go to check the pin connection as you told.Thank you

First pin is +
Second is -
Third is data
 
Last edited:

ReefSpy

New Member
View Badges
Joined
Nov 21, 2017
Messages
13
Reaction score
40
Location
Planet Earth
Rating - 0%
0   0   0
Is the MCP3008 supported in Reef-Pi? I have been testing out my PH circuit for the last couple weeks and it seems solid. It could be a lower cost alternative to the Atlas Scientific model, but it requires an MCP3008 ADC. I'd be happy to share details if you think it would be useful.

IMG_1510.jpg
 

njtiger aquariums

Well-Known Member
View Badges
Joined
Oct 9, 2015
Messages
513
Reaction score
520
Location
NV
Rating - 0%
0   0   0
. As of now, reef-pi only has web / browser based interface. I am tempted to write a qt based GUI, but I think it will be lot of extra code to maintain, I think I'll prefer to work on a native mobile client instead, if I have the time.

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
 
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
Is the MCP3008 supported in Reef-Pi? I have been testing out my PH circuit for the last couple weeks and it seems solid. It could be a lower cost alternative to the Atlas Scientific model, but it requires an MCP3008 ADC. I'd be happy to share details if you think it would be useful.

IMG_1510.jpg
The very first version of reef-pi had support for mcp3008, I intended to use it for reading various probes that emit analog signals (ph, temperature etc). Later I realized ds18b20 as a temperature sensor dont need it, since everything is implemented in the kernel (not sure if it does ADC), and with ph probe I went with atlas scientific since this was the first attempt, and I didnt want to tackle everything in one shot (reading analog signal, doing the scale conversion, implementing calibration logic etc). Atlas scintific is certainly more costly, but it took care of all those things, as well as saves cpu cycles for Pi. This is a very good setup for reef-pi. But this does not mean we cant improve.
I am more than happy to add mcp3008 or a beefier ADC support, but we need a full plan around it. i.e. we have to think about what sensors we'll use (ph, what about pt-100? ), how much processing power it will use (does it make sense to use a slave MCU - this is what @theatrus had suggested), what all sofware thing we have to do (scaling, calibration etc) and finally what this entail for the DIY makers (build time, complexity, guides etc). Because we have the atlas scientific probe support I am more bullish about adding an ADC support (since we have a plan B in place). But at the end, this has to be more affordable than the atlas scientific option.
 

ReefSpy

New Member
View Badges
Joined
Nov 21, 2017
Messages
13
Reaction score
40
Location
Planet Earth
Rating - 0%
0   0   0
The very first version of reef-pi had support for mcp3008, I intended to use it for reading various probes that emit analog signals (ph, temperature etc). Later I realized ds18b20 as a temperature sensor dont need it, since everything is implemented in the kernel (not sure if it does ADC), and with ph probe I went with atlas scientific since this was the first attempt, and I didnt want to tackle everything in one shot (reading analog signal, doing the scale conversion, implementing calibration logic etc). Atlas scintific is certainly more costly, but it took care of all those things, as well as saves cpu cycles for Pi. This is a very good setup for reef-pi. But this does not mean we cant improve.
I am more than happy to add mcp3008 or a beefier ADC support, but we need a full plan around it. i.e. we have to think about what sensors we'll use (ph, what about pt-100? ), how much processing power it will use (does it make sense to use a slave MCU - this is what @theatrus had suggested), what all sofware thing we have to do (scaling, calibration etc) and finally what this entail for the DIY makers (build time, complexity, guides etc). Because we have the atlas scientific probe support I am more bullish about adding an ADC support (since we have a plan B in place). But at the end, this has to be more affordable than the atlas scientific option.

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.
 

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.6%
  • 100% dry rock + 100% live sand

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

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

    Votes: 15 10.5%
  • 25% live rock, 75% live sand

    Votes: 10 7.0%
Back
Top