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
On another note. I have fully 3d printed a rollermat that is now controlled by Pi.

right now I’d like setup it up a timer to activate the motor until I get the float switch fully dialed into position.
This is awesome . You plan to opensource the design ? I’d love to build one
 
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
Wow I can't believe that's priced how it should be. Based on the ruler my guess is it's analog, unfortunately the Pi doesn't have any analog pins so if you wanted to know the actual water level you would need to add a ADS1015 ADC to your system, reef-pi has a driver for it. Of course you would need to figure out the wiring, if someone hasn't done it before on a forum it could be difficult getting it right. If you were successful you would get an analog value from the ADS1015 which you would use as a reference. If it is analog you could still connect it to a digital pin on the Pi and it would either read on or off but anyone's guess as to where that might be on the ruler.

We should be able to integrate these things using the Esp32 driver right ?
 
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
DFCEBB32-6B15-4532-A37B-2F77ADF31C47.jpeg

I noticed these Neptune liquid level sensors have a familiar connector. How difficult would they be to add to reef-pi ATO?
Chances are you can hook them up with Esp32 and use ph module (analog input ) for monitoring and control
 

InactiveAcct

Well-Known Member
View Badges
Joined
Dec 2, 2019
Messages
520
Reaction score
501
Rating - 0%
0   0   0
Wow I can't believe that's priced how it should be

I was surprised too!

Based on the ruler my guess is it's analog, unfortunately the Pi doesn't have any analog pins so if you wanted to know the actual water level you would need to add a ADS1015 ADC to your system, reef-pi has a driver for it.
Yeah I was thinking analog... one of the things I noticed was when users pair to Apex they have to specify the size of the LLS they are adding, I feel like if it were I2C, etc, the size would be built in and it would just send across the measured depth - I also feel like the top would be a little bulkier since I assume it would need to have a circuit built in.

that’s also what I’m worried about, since the Connector has 4 contacts
I'm concerned about that too - I guess it's possible there's contacts to maintain compatibility with other Apex Fluid Monitoring Module devices.

We should be able to integrate these things using the Esp32 driver right ?
Awesome. I think I'll buy one to see if I can figure out what's going across the jack. Hopefully buzzing it out with a multimeter is adequate to get started.
 

robsworld78

Valuable Member
View Badges
Joined
Feb 14, 2020
Messages
1,029
Reaction score
1,293
Location
Edmonton, Canada
Rating - 0%
0   0   0
As @robsworld78 mentioned it’s not straight forward if you don’t know the internals. E.G. what contact is ground, VCC and data lines. Next, what kind of data is used, e.g. is it a digital interface like I2C or SPI, is it semi-digital giving a PWM signal or an analog voltage.

Both PWM and analog are easy to read into reef-Pi, e.g. using the ADC circuit (ADS1015) that rob mentioned. If it’s digital it’s a lot more difficult if you don’t know the protocol.

that’s also what I’m worried about, since the Connector has 4 contacts … typically you would only need 3 (VCC, signal and GND) for either PWM or analog signal. 4 contacts looks more like a digital interface like I2C.

depending on the price you could simply buy and open it up to see if the connections on the cable give you some info.
It's highly unlikely it would be I2C or SPI, neither of those would ever be used like that in a true commercial product. I think Apex uses CAN bus for all their extensions but it's unlikely the sensor would be that especially based on the price of this sensor.
 
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
Hello everyone,
i have cut the next major release of reef-pi. Here is the announement post:

key highlight is the esp32 integration. I intend to work on guides as r2r post under reef-pi sub forum. ESP32 integration is on the list , but feel free to share anything that can be of use. I plan to consolidate the adafruit guides along with all the new things that happened since then, but keep the same module specific formats.

happy thanks giving
ranjib
 
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
This is my main display tank. It’s been running for little more than a year now. Entirely on reef-pi, all equipment control, temperature , ato controller , ph monitor . Pump and light is controlled by manufacturer controller.
41E12145-026F-45A9-8C0A-B455EFD152C4.jpeg
 
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
dashboard of my reefer 300xl, notice the temperature swing due to bad heater. It went long before I could get the time to investigate and address it.
1C67F0C0-6528-473E-81D9-65131EDA48CE.jpeg


and corresponding grafana dashboard, that has long term retention
reefer-300xl-tempswing.png


more i look at this graph, more i feel guilty :-( . Anyhow, no corals were lost, and now its fixed. When this problem initially started, i suspected the heater is not able to keep up .. since the temp control chart was showing heater is 100% time on. The internal thermister was turning off the heater, and that went undetected. Although, this was easily preventable, as the kasa hs300 provides current draw numbers and reef-pi can read this as analog sensor. Those number would make it abundantly clear that the 300w heater was barely drawing any current most of the time (when i manually checked, it was 1w ).
I hope i'll remember to add these learnings in the temperature controller guide (that not just temperature swing , but also the current draw of the heater can be used for early detection of failures)
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Hi All! I'm having trouble with an SHT31D reading, I was testing all on breadboard and everything works fine.
I've now moved the controller on a PCB and with the same lenght of cable I'm unable to read the data from my sensor.
I always have this error:

ph subsystem: Failed read probe:Sump TemperatureError:CRCs doesn't match: CRC from sensor (0xFF) != calculated CRC (0xA4)

I2C bus seems to works fine because I can detect the sensor at address 44 (68 on reef-pi) but I have comunication problems...
Also an LTC4311 didn't help me...
What can I try to do?
Thanks all!
 

zab34

Active Member
View Badges
Joined
Jan 23, 2012
Messages
354
Reaction score
72
Location
Orlando
Rating - 0%
0   0   0
This is awesome . You plan to opensource the design ? I’d love to build one
Unsure at the moment. I am sure there is some room for Improvement. Ideally I would have designed it to be more easily scalable for people’s various needs.
Right now I am going to let it run for the next month and see if I encounter any major issues.
 

robsworld78

Valuable Member
View Badges
Joined
Feb 14, 2020
Messages
1,029
Reaction score
1,293
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi All! I'm having trouble with an SHT31D reading, I was testing all on breadboard and everything works fine.
I've now moved the controller on a PCB and with the same lenght of cable I'm unable to read the data from my sensor.
I always have this error:

ph subsystem: Failed read probe:Sump TemperatureError:CRCs doesn't match: CRC from sensor (0xFF) != calculated CRC (0xA4)

I2C bus seems to works fine because I can detect the sensor at address 44 (68 on reef-pi) but I have comunication problems...
Also an LTC4311 didn't help me...
What can I try to do?
Thanks all!
Some noise must be getting in the lines somewhere, maybe it's some equipment nearby, some LED drivers can emit noise. If you have one turned on see if it works better when its off or unplugged. You also might have to power cycle the Pi to get the I2C working again if it's hung up. How long is the cable? Try and keep it under a foot and if you can get shielded cable that will help. If you don't have for a quick fix try wrapping the cable in aluminum foil used for cooking. Even though you can read the address there could still be problems. Your best bet might be to get an ESP32, connect a DHT22 to it, you should be able to find example code on the web and then have the data sent to reef-pi using the new driver. DHT22 uses a digital pin so there will be no issues with long cables.
 

Jason Judd

Community Member
View Badges
Joined
Jul 8, 2018
Messages
30
Reaction score
14
Rating - 0%
0   0   0
Has anyone had issues with auto top off hanging? In the UI the toggle for on and off becomes unresponsive. And the actual Auto top off is not operating. I cleared up my database and rebuilt everything wondering if I had an issue in there. However with only the three basic Auto top offs that I'm using I'm still seeing the same issue.

ATO1: Standard Auto top off turning on a pump to pump in freshwater
ATO2: used on my protein skimmer overflow connected to a macro that turns off the protein skimmer and sends a text when the Overflow gets full
ATO3 (appears to be the culprit, all ATO stopped working in the same hour this teiggerd): used to detect high water on the main tank. When activated it temporarily shuts down part of the system and sends me a text. Typically the high water comes because of algae trapped on filter. Cycling the system often shifts the algae enough to get me going temporarily. It triggers once every couple of months and prevents an overflow spillage event.

Here's the image of the ATO, although it could be random that the ATOs stopped within an hour of this triggering. (I'll have to figure out uploading a photo a bit later today...)

Any thoughts?
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Some noise must be getting in the lines somewhere, maybe it's some equipment nearby, some LED drivers can emit noise. If you have one turned on see if it works better when its off or unplugged. You also might have to power cycle the Pi to get the I2C working again if it's hung up. How long is the cable? Try and keep it under a foot and if you can get shielded cable that will help. If you don't have for a quick fix try wrapping the cable in aluminum foil used for cooking. Even though you can read the address there could still be problems. Your best bet might be to get an ESP32, connect a DHT22 to it, you should be able to find example code on the web and then have the data sent to reef-pi using the new driver. DHT22 uses a digital pin so there will be no issues with long cables.
Hi Rob, thank you for your answer.
I’ve done some test:
I’m running a board with multiple PCA9507 as I2C extender; if I connect the sensor with 20cm of cable everything works fine.
If I run the full cable (around 2mt) to the same connector the sensor doesn’t work.

I’ve then tested the sensor attached to the outlet expansion board (which is connected to the cpu board by a bus extended by P82B96D): the PCA9685 that drives the output works without a problem, SHT31D connected to the same bus with 20cm of cable doesn’t work…

I was testing everything on a prototype board with very long cable (about 5 meters) and everything was working fine so I tought that with shorter cable I’ll not have any problem… could it be something related to the pullman-up resistor value? On my board I have 2.2K pull-up…
Let me know if tou have any idea, I’ll keep as last chance the use of the ESP32 only to read this sensor…
Thank you!
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
Hi Rob, thank you for your answer.
I’ve done some test:
I’m running a board with multiple PCA9507 as I2C extender; if I connect the sensor with 20cm of cable everything works fine.
If I run the full cable (around 2mt) to the same connector the sensor doesn’t work.

I’ve then tested the sensor attached to the outlet expansion board (which is connected to the cpu board by a bus extended by P82B96D): the PCA9685 that drives the output works without a problem, SHT31D connected to the same bus with 20cm of cable doesn’t work…

I was testing everything on a prototype board with very long cable (about 5 meters) and everything was working fine so I tought that with shorter cable I’ll not have any problem… could it be something related to the pullman-up resistor value? On my board I have 2.2K pull-up…
Let me know if tou have any idea, I’ll keep as last chance the use of the ESP32 only to read this sensor…
Thank you!
2.2k actually sounds excessive, depending on the other components in the system that might also have internal pullups as well. I'm also unsure about the "multiple" PCA9507. I don't think you need multiple and they may in fact result in unwanted behavior. Adafruit was able to run an I2C line over 50m Ethernet cable with just ONE LTC4311.

I would recommend starting a dedicated thread and lay out the details of your setup: Power supplies, how they are connected to the PI, your I2C network and how that is powered/level shifted (if at all). That would help greatly in analysing the problem and helping you solve it.
 

robsworld78

Valuable Member
View Badges
Joined
Feb 14, 2020
Messages
1,029
Reaction score
1,293
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi Rob, thank you for your answer.
I’ve done some test:
I’m running a board with multiple PCA9507 as I2C extender; if I connect the sensor with 20cm of cable everything works fine.
If I run the full cable (around 2mt) to the same connector the sensor doesn’t work.

I’ve then tested the sensor attached to the outlet expansion board (which is connected to the cpu board by a bus extended by P82B96D): the PCA9685 that drives the output works without a problem, SHT31D connected to the same bus with 20cm of cable doesn’t work…

I was testing everything on a prototype board with very long cable (about 5 meters) and everything was working fine so I tought that with shorter cable I’ll not have any problem… could it be something related to the pullman-up resistor value? On my board I have 2.2K pull-up…
Let me know if tou have any idea, I’ll keep as last chance the use of the ESP32 only to read this sensor…
Thank you!
No problem, and yeah something isn't right, the pca9507 is decent, I've used that part in the past and it definitely helps, 2 meters is doable. One thing to note which I forgot to mention is the Pi has 1.8k resistors already installed on the SDA and SCL pins so that may be enough. On my controller I rely on them before the 5v converter then I use 4.7k. With those 1.8k resistors and the 2.2.k you've installed you're down to 0.99k, then if the pca9507 has 2.2k now you have 3 pullups in parallel giving you 0.0022k which could definitely be a problem. As @Sral mentioned it's likely the extender and other devices on I2C have pullups so look for those and remove them if they have them.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
No problem, and yeah something isn't right, the pca9507 is decent, I've used that part in the past and it definitely helps, 2 meters is doable. One thing to note which I forgot to mention is the Pi has 1.8k resistors already installed on the SDA and SCL pins so that may be enough. On my controller I rely on them before the 5v converter then I use 4.7k. With those 1.8k resistors and the 2.2.k you've installed you're down to 0.99k, then if the pca9507 has 2.2k now you have 3 pullups in parallel giving you 0.0022k which could definitely be a problem. As @Sral mentioned it's likely the extender and other devices on I2C have pullups so look for those and remove them if they have them.
My thinking as well, the 5V Converter might also have another 10k on both sides as well.
My Setup does absolutely fine So far using only internal pull-ups on:
3.3V line:
Pi Zero
Adafruit ISO1540 (isolation and level shifting)

5V line:
Adafruit ISO1540
Adafruit LTC4311 (dynamic pull-up)
RTC module
Adafruit SCD30 Module ( after 1m of shielded USB cable)
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Thank you for all of the answers!
My setup is this one:
Custom PCB with 2.2K Pull-up on 3.3V I2C Bus Line.
On this bus I have:
- 1x P82B96D to extend bus to output board (works fine)
- 1x DS3231 RTC (seems to works fine)
- 4x PCA9507 to have 4 dedicated I2C output at 5V - each outup have his own 2.2K pull up
- 1x ADS1115 ADC (works fine)

Now I've removed the main 2.2K resistor (since raspberry has his own) and I'm trying to connect the SHT31D directly to the 3.3V bus and power.
I'm doing a reading every 30 sec and I'm having some numbers.. at some times the reading is 0 but it's a step forward.
Now I'll try again with PCA9507 as level converter...
@Sral do you have any photo of your setup?
thank you!
 
Last edited:

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
Have a look on page 6 of the PCA9507's datasheet. It specifies typicall pull-up values of 10k and gives some formulas on what minimum and maximum Pull-Ups to use. They do for example mention that the minimum Pull-Up Resistor value depends on the maximum Pull-down current of your device(s).
The P82B96's datasheet for example mentions a maximum output sink capability on I2C bus of 5.5mA, which equates to a minimum total pull-up resistance to 5V of 0.9k.
The SHT31D's datasheet mentions a sink current of 3mA, at 5V that euqates to a minimum total pull-up value of 1.37k . That's already pretty close to your 2.2k
The DS3231's datasheet mentions the same conditions, 1 to 3mA.

I would therefore caution against such strong pull-ups.

@robsworld78 1.8k on a PI sounds way too little resistance. I have looked it up: here under "voltage specifications" it mentions a pull up between 50 to 65k. That sounds more reasonable.


@Simonv92 You can find a few pictures of my setup in my build thread, like this post for example. I have made a kind of switchboard for the I2C line, which you can see here. The switchboard is the big block of 2x8 female headers, made up of 4 blocks of interconnected 2x2 female headers, one block for each of VCC, GND, SCL and SDA. It's simply there to power the 5V side of my I2C network and provide connection to all 4 "devices", e.g. one line in from the level shifter, one line out to the USB sockets and one line each to the LTC4311 dynamic pull-up and RTC module.
If you scroll a bit down to this post you can see the SCD30 Air Quality sensor that I have connected via a 1m shielded USB cable using USB-A sockets. The only strange thing is that I can't get a connection to the BMP280 air pressure sensor, that's connected identically next to the SCD30.
Downside to this is the ridiculuosly long power line that has way to many connectors with contact resistance, so I'll probably have to be carefull with current hungry devices :grinning-face-with-sweat:
 
Last edited:

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Thank you very much @Sral, I've already seen the PCA9507 datasheet and I've choosen 2.2K based on the informations right there...
All of the devices connected before the PCA9507 works fine (DS3231, P82B96). I've now connected a Ph board to the PCA9597 with 20cm of cable and it works fine (the same thing does SHT31D with 20cm of cable).
Now I'm able to run SHT31D with long cable only attaching it directly to the 3.3V bus which sounds a bit strange, since the PCA should improve the signal quality over long distances...
I don't know what to do... maybe I can try a setup like yours, with a ISO1540 as level shifter from 3.3 to 5V and a LTC4311 to improve signal quality (which I already have but in my setup does nothing...)
What do you think?
 

TOP 10 Trending Threads

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

  • 100% live rock + bagged sand

    Votes: 37 27.4%
  • 100% dry rock + 100% live sand

    Votes: 46 34.1%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 22.2%
  • 75% live rock, 25% live sand

    Votes: 12 8.9%
  • 25% live rock, 75% live sand

    Votes: 10 7.4%
Back
Top