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

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
Interesting. Well, 50-65k are not realy excessive, they provide some kind of pull-up, but won't overpower devices with very little pull-down capability, so it sounds like a compromise between having at leat A pull-up, while also having compatibility with weak devices. Maybe those 50-60k are the on-chip resistors and 1.8k are external on the board, that could make sense. Something to learn every day !
Yeah maybe 50+k is better than 1.8k for I2C, that's above my pay grade. :) I've seen others complain about them being so low as well so still thinking they are 1.8k but can't be certain now, thanks. I searched that page you linked which is official and no mention of 1.8k or any other values.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
Thank you @Sral for all your help!
I2C diagram is this one:

Raspberry Pi Zero W 2 -> 3.3V Bus
3.3V Bus -> P82B96 to expansions board (equipped with another P82B96 to decode bus)
3.3V Bus -> DS3231 RTC
3.3V Bus -> ADS1115 ADC
3.3V Bus -> PCA9507 -> 5.0V Bus 1 to external devices -> 4 way terminal block
3.3V Bus -> PCA9507 -> 5.0V Bus 2 to external devices -> 4 way terminal block
3.3V Bus -> PCA9507 -> 5.0V Bus 3 to external devices -> 4 way terminal block
3.3V Bus -> PCA9507 -> 5.0V Bus 4 to external devices -> 4 way terminal block

Let me know if it's clear otherwise I'll draw it graphically..
I'm not trying to bring you down but It looks like you're working on a fairly large project, if you're planning to run 18 I2C devices you might need to rethink things. A few years ago I wanted my controller to expand to large levels and went down the road you are heading on and for me it didn't end well. I attempted to make it work for months, even went to the expense of getting lots of PCB's made. I tried a few buffers, the pca9507 was the best. Running multiple pca9507 like you are I was able to successfully run 22-24 devices with about 100 feet USB cable total but it wasn't reliable. Even with only a few devices connected it wasn't perfect. I hate to say it and I hated to read it when I was doing this, it's just not possible if you need reliability. For any chance of it working you would have to code a strong CRC check and figure out how to handle the bus locking up.

Bottom line is you need to look at other protocols such as RS-485 or CAN bus. If you really want to keep going look at the PCA9615 to split the I2C signals into differential signals, personally I haven't used this as I finally came to accept this isn't the route a person should be taking but this does sound like the best bet.


Here's a good article explaining how differential signals works.


Here's a pic with most of the stuff connected, I had 8 AC power bars connected as well at one point. All that and more went in the trash. :(

DSCN7789-Optimized.JPG
 
Last edited:

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
106
Reaction score
97
Location
Italy
Rating - 0%
0   0   0
That's clear enough, thanks.

Hmmmm, the datasheets are not clear enough for me to judge the compatibility of the P82B96 and PCA9507 in your situation with certainty. Maybe you can test it out, e.g. connect the SHT31D to the PC9507 (test several, in case the one used is broken) , remove or deactivate the P82B96 from the network and see if the connection works then.

Another thing I noticed on the PCA9507: the datasheet only mentions standard topographies of multiple A-Port together in a star-topography, or A and B ports in series. So maybe they don't play well with each other, when you connect multiple B-ports to each other ? To test that you would of course have to remove or deactivate 3 of the 4 PCA9507's and then connect the SHT31D to the remaining one.

I hope that is even possible for you and you can find a solution.
Thank you again @Sral, I'll do some more test and I'll try to find out a reliable way to make everything works...
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
106
Reaction score
97
Location
Italy
Rating - 0%
0   0   0
I'm not trying to bring you down but It looks like you're working on a fairly large project, if you're planning to run 18 I2C devices you might need to rethink things. A few years ago I wanted my controller to expand to large levels and went down the road you are heading on and for me it didn't end well. I attempted to make it work for months, even went to the expense of getting lots of PCB's made. I tried a few buffers, the pca9507 was the best. Running multiple pca9507 like you are I was able to successfully run 22-24 devices with about 100 feet USB cable total but it wasn't reliable. Even with only a few devices connected it wasn't perfect. I hate to say it and I hated to read it when I was doing this, it's just not possible if you need reliability. For any chance of it working you would have to code a strong CRC check and figure out how to handle the bus locking up.

Bottom line is you need to look at other protocols such as RS-485 or CAN bus. If you really want to keep going look at the PCA9615 to split the I2C signals into differential signals, personally I haven't used this as I finally came to accept this isn't the route a person should be taking but this does sound like the best bet.


Here's a good article explaining how differential signals works.


Here's a pic with most of the stuff connected, I had 8 AC power bars connected as well at one point. All that and more went in the trash. :(

DSCN7789-Optimized.JPG
Hi Rob,
thank you for your message, yes I was following your old project so I understand what you're saying... It was a very complex project but, in my opinion, it had one of the best looking GUI I've ever seen in a reef controller (and not only that)...
Regarding my project.. Is not that complicated, I think I've complicated the things by myself...
My goal is to run 3 separate PCBs in 1 single enclosure (to minimize cable run an footprint) the boards are these:
CPU Board - with Raspberry Pi Zero, and all the circuit for input side, 0-10V out from Rpi, DS18B20, ADC and I2C
Powerbar - connected to the previous board by a CAT5 0.15cm cable. It runs 8 AC outlet and 8 DC outlet by a PCA9685.
Light/Dosing - to design yet, it'll have another PCA9685 connected by the same CAT5 cable and it'll control 3/4 dosing pump and 3/4 lights channel.

I was trying to keep I2C signal very short since I know that long cable can cause many troubles.
Attached to the CPU board (but in the same box) I'll have 2 Ph Board (the one made by Roberto Buti) and the SHT31D sensor which is the only device connected by a long cable to reach my sump and measure temp/humidity to control an exhaust fan.

I was also thinking about changing the SHT31D to a DHT22 (as you do in your new software if I rember correctly) to be able to have long cable without problem, but I don't know how to add it to Rpi...
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I'm not trying to bring you down but It looks like you're working on a fairly large project, if you're planning to run 18 I2C devices you might need to rethink things. A few years ago I wanted my controller to expand to large levels and went down the road you are heading on and for me it didn't end well. I attempted to make it work for months, even went to the expense of getting lots of PCB's made. I tried a few buffers, the pca9507 was the best. Running multiple pca9507 like you are I was able to successfully run 22-24 devices with about 100 feet USB cable total but it wasn't reliable. Even with only a few devices connected it wasn't perfect. I hate to say it and I hated to read it when I was doing this, it's just not possible if you need reliability. For any chance of it working you would have to code a strong CRC check and figure out how to handle the bus locking up.

Bottom line is you need to look at other protocols such as RS-485 or CAN bus. If you really want to keep going look at the PCA9615 to split the I2C signals into differential signals, personally I haven't used this as I finally came to accept this isn't the route a person should be taking but this does sound like the best bet.


Here's a good article explaining how differential signals works.


Here's a pic with most of the stuff connected, I had 8 AC power bars connected as well at one point. All that and more went in the trash. :(

DSCN7789-Optimized.JPG
yes, at that scale go plc/scada for industrial setup, or home lab type setup with x96 and cat5/6.


thank you for sharing. this is a fun read
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Some pics from the current tanks
074485DF-2EC2-4305-8138-942DCB2CADB6.jpeg

I love palys :) . I think they look super contrasting , the palette with zoa colors pop .
C186D50F-D5B1-4A5E-AC7B-F8F634D8641A.jpeg

Got some time to do some more work on the new pico stand. This one shows my last two years of wood working maturity :) . The entire thing is built with 3/4” walnut vineered plywood , with domino as joinery.
CDE7EA08-6CCB-429A-9B43-1BB5DBBBF77F.jpeg

Doors on two sides and the front pane will allow hooking up common control such as light mode, disable ato etc. the color choices (white and gold ) is to keep it in tune with rest of home furniture (wify dictates those ) . Hardwares are all from

E84926A2-EF19-43A4-9DBC-E37D8B9AEB3F.jpeg



Hopefully this one will blend in well and also make things easier to operate .
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi Rob,
thank you for your message, yes I was following your old project so I understand what you're saying... It was a very complex project but, in my opinion, it had one of the best looking GUI I've ever seen in a reef controller (and not only that)...
Regarding my project.. Is not that complicated, I think I've complicated the things by myself...
My goal is to run 3 separate PCBs in 1 single enclosure (to minimize cable run an footprint) the boards are these:
CPU Board - with Raspberry Pi Zero, and all the circuit for input side, 0-10V out from Rpi, DS18B20, ADC and I2C
Powerbar - connected to the previous board by a CAT5 0.15cm cable. It runs 8 AC outlet and 8 DC outlet by a PCA9685.
Light/Dosing - to design yet, it'll have another PCA9685 connected by the same CAT5 cable and it'll control 3/4 dosing pump and 3/4 lights channel.

I was trying to keep I2C signal very short since I know that long cable can cause many troubles.
Attached to the CPU board (but in the same box) I'll have 2 Ph Board (the one made by Roberto Buti) and the SHT31D sensor which is the only device connected by a long cable to reach my sump and measure temp/humidity to control an exhaust fan.

I was also thinking about changing the SHT31D to a DHT22 (as you do in your new software if I rember correctly) to be able to have long cable without problem, but I don't know how to add it to Rpi...
Thanks for the kind words, working on bringing back that GUI. :) For the DHT22 you can run a python script like this, if you edit it so only the humidity is saved to the file you can import it in reef-pi using the file driver. If you can get away from I2C its best, I know it's tempting though with 2 wires vs 16.

 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
106
Reaction score
97
Location
Italy
Rating - 0%
0   0   0
Thanks for the kind words, working on bringing back that GUI. :) For the DHT22 you can run a python script like this, if you edit it so only the humidity is saved to the file you can import it in reef-pi using the file driver. If you can get away from I2C its best, I know it's tempting though with 2 wires vs 16.

Thank you Rob, I'll give it a try :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
One of my tank. Now the sps are growing at a rate and has passed a size that I can sustainably frag a few (green slimer, forest fire digitata , red milli pora, strawberry shortcake ) for testing in pico tank
F0E0EDC9-E301-4EFA-9952-A66A89EC3F55.jpeg

Here is a close up of the green slimer colony . I have to frag it, otherwise it will shade the other acro frags glued beneath
0EC770E6-A397-45E1-A9F7-10BC0D8711C5.jpeg


strawberry shortcake colony
E98BA855-4A87-46FD-B5A1-657F97B9C24E.jpeg

Pink stylo
A24501C7-F413-46B3-91E1-B1C1A85DB76C.jpeg

I really want to test a minimal reef-pi setup that can keep at least some of these across. I am able to keep green slimer and monti right now. Without any dosing . But over the last few months I have sourced pretty awesome 12v brushless motor that generates ample flow, and now that dosing systems are tested with all for reef based alk/ca supplement , I think i have all the things needed. I am really excited about this. It will be so cool to have a pico tank with a sizable sps colony as the center piece , all grown out with reef-pi in a very affordable and open setup. That will be an awesome milestone
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Another question, How do I calibrate a single point calibration probe such as ORP?
If I set 225mV for both mid value and second point I always have 225 reading... I'm missing something :downcast-face-with-sweat:
Well, judging from the Atlas Instrument datasheet, which gives some Information on working principle and calibration, I would hazard the guess that it’s similar to pH, e.g. that the „mid-value“ is supposed to be 0mV, corresponding to the ORP value of silver chloride. That probably needs to have a value of zero, but I’m not completely sure about that.

Actually: I wouldn’t at all be surprised if you could in principle connect an ORP probe to @robsworld78 ‘s pH circuit and measure it that way. The circuit does after all only seem to measure an isolated voltage between -700 and +700mV :grinning-face-with-sweat:
 
Last edited:

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
Actually: I wouldn’t at all be surprised if you could in principle connect an ORP probe to @robsworld78 ‘s pH circuit and measure it that way. The circuit does after all only seem to measure an isolated voltage between -700 and +700mV :grinning-face-with-sweat:
Exactly, a high resolution volt meter. The other day someone told me after running it along side his other good meter it's bang on. Heard this many times now. :) I've never tested it for ORP but a while ago someone told me to add an extra resistor and it would work with ORP so I've actually revised the board since you got yours, it's even smaller now. Currently it has a solder jumper to activate the extra resistor for ORP. I haven't really tested it yet but I bought a cheap ORP probe and some 225mV calibration solution. I don't really know how to test it properly so I'm just going to see how close it is to 225mV, figures crossed. :)
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Exactly, a high resolution volt meter. The other day someone told me after running it along side his other good meter it's bang on. Heard this many times now. :) I've never tested it for ORP but a while ago someone told me to add an extra resistor and it would work with ORP so I've actually revised the board since you got yours, it's even smaller now. Currently it has a solder jumper to activate the extra resistor for ORP. I haven't really tested it yet but I bought a cheap ORP probe and some 225mV calibration solution. I don't really know how to test it properly so I'm just going to see how close it is to 225mV, figures crossed. :)
Nice, can you elaborate on why you need that extra resistor ? Change the amplification on the OP-Amps ?
 
Last edited:

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Let's see if you can tell me? :grinning-face-with-smiling-eyes: :face-with-tears-of-joy: :rolling-on-the-floor-laughing:
Well, you basically measure the voltage between the probe‘s contacts. Since this voltage can also be negative you have to bias this voltage to a point between VCC and GND. This bias point should be identical for pH and ORP, but might be different if you are only interested in specific value ranges.
This means if you are for example not interested to measure pH symmetrically around 7.0 you can shift this by using a different bias that’s not the exact middle of VCC and GND.

this resistor does basically that, it moves this bias to pretty much the middle, ensuring a symmetrical measurement range for ORP.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have just completed the first draft of the telemetry server setup for reef-pi 6.0. If you are inrterested please check it out and provide any feedback you may have

thank you,
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
Well, you basically measure the voltage between the probe‘s contacts. Since this voltage can also be negative you have to bias this voltage to a point between VCC and GND. This bias point should be identical for pH and ORP, but might be different if you are only interested in specific value ranges.
This means if you are for example not interested to measure pH symmetrically around 7.0 you can shift this by using a different bias that’s not the exact middle of VCC and GND.

this resistor does basically that, it moves this bias to pretty much the middle, ensuring a symmetrical measurement range for ORP.
Exactly how I would have said it. :rolling-on-the-floor-laughing: I had a feeling it was due to the negative voltage, couldn't remember exactly though but knew you would know and you did. :)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,720
Location
Missouri
Rating - 0%
0   0   0
One of my tank. Now the sps are growing at a rate and has passed a size that I can sustainably frag a few (green slimer, forest fire digitata , red milli pora, strawberry shortcake ) for testing in pico tank
F0E0EDC9-E301-4EFA-9952-A66A89EC3F55.jpeg

Here is a close up of the green slimer colony . I have to frag it, otherwise it will shade the other acro frags glued beneath
0EC770E6-A397-45E1-A9F7-10BC0D8711C5.jpeg


strawberry shortcake colony
E98BA855-4A87-46FD-B5A1-657F97B9C24E.jpeg

Pink stylo
A24501C7-F413-46B3-91E1-B1C1A85DB76C.jpeg

I really want to test a minimal reef-pi setup that can keep at least some of these across. I am able to keep green slimer and monti right now. Without any dosing . But over the last few months I have sourced pretty awesome 12v brushless motor that generates ample flow, and now that dosing systems are tested with all for reef based alk/ca supplement , I think i have all the things needed. I am really excited about this. It will be so cool to have a pico tank with a sizable sps colony as the center piece , all grown out with reef-pi in a very affordable and open setup. That will be an awesome milestone
Awesome as usual I went to Tropic Marin all for reef and that way all I have to dose is one thing....works really well but man your tanks always look so much better than mine, lol...if you want to ship any of those SPS frags I will gladdly pay for shipping :)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,720
Location
Missouri
Rating - 0%
0   0   0
One more comment, I am always playing and just loaded a mini reef-pi for my copepod cultures since I added heaters but IMHO it would be nice to know which releases we consider a LTS release. Basically I always view the new releases as bleeding edge until enough testing and users have beat on it and I usually load it up on my test units but at least for me it would be nice to know which versions we consider LTS stable so I have a better idea on which version to go and grab. Looks like @robsworld78 script is pulling 5.2 so I assume its pretty stable but thought I would ask.

Thanks
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,720
Location
Missouri
Rating - 0%
0   0   0
So 5.2 has a pesky issue with the hysteresis and controlling a heater, threshold under value error. I was able to find a bug in git and figured out a workaround but wondering if that bug was corrected in 5.3. I think 5.3 was the latest 5.x build?

Another topic can someone explain how hysteresis is supposed to work, I thought I knew but was getting some odd variation with my heater. The way I thought it worked is you could provide some float around the setting that you are using, say I set my heater threshold for 79deg and a hysteresis of 1deg then it would float the temp down to 78deg before turning back on or is it I have threshold set to 79deg and hysteresis set to 1deg it will float from 79 to 80 before shutting off...I had it set like the first example and it was turning off at 79 but as soon as it hit 78.9 turning back on even though I had hysteresis set to 1deg. Maybe i forgot to reload after changing it, doing some more testing.

PSA, i thought my temp probes were close enough but ive had some heaters failing and finally got another temp gauge that would take a temp reading and even testing it against a cup of ice water was off 1.5deg. Bottom line get a calibrated handheld temp gauge that you can ensure is calibrated to then adjust your reef-pi temp probes, I had been running my tank much higher than I thought...
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
So 5.2 has a pesky issue with the hysteresis and controlling a heater, threshold under value error. I was able to find a bug in git and figured out a workaround but wondering if that bug was corrected in 5.3. I think 5.3 was the latest 5.x build?

Another topic can someone explain how hysteresis is supposed to work, I thought I knew but was getting some odd variation with my heater. The way I thought it worked is you could provide some float around the setting that you are using, say I set my heater threshold for 79deg and a hysteresis of 1deg then it would float the temp down to 78deg before turning back on or is it I have threshold set to 79deg and hysteresis set to 1deg it will float from 79 to 80 before shutting off...I had it set like the first example and it was turning off at 79 but as soon as it hit 78.9 turning back on even though I had hysteresis set to 1deg. Maybe i forgot to reload after changing it, doing some more testing.

PSA, i thought my temp probes were close enough but ive had some heaters failing and finally got another temp gauge that would take a temp reading and even testing it against a cup of ice water was off 1.5deg. Bottom line get a calibrated handheld temp gauge that you can ensure is calibrated to then adjust your reef-pi temp probes, I had been running my tank much higher than I thought...
Hmm, can‘t quite elaborate on the hysteresis with certainty, but I think it should work like your first thought, e.g. shut down on target and turn on below target-hysteresis.

Temperature probes are notoriously inaccurate in absolute terms, e.g. 78 degrees typically means something in the range of 77 to 78, which is what you can see when you have several probes in the same environment, e.g. the same cup of water.
My probes are bought calibrated a few months ago I think, which is why they show the same right now, when they are in the same room. This is only true right now, next year they might be slightly different.
However they are pretty accurate in relative terms when the probe shows 78 degrees today and tomorrow you can be sure that the temperature is the same to about 0.1 degrees, or when you have several probes in the same environment and one probe rises 1.0 degrees all probes will rise by pretty much 1.0 degrees.
 
Back
Top