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

elmo2002

New Member
View Badges
Joined
Dec 31, 2022
Messages
3
Reaction score
3
Location
uk
Rating - 0%
0   0   0
Ok thanks i had looked at the ato guide but as robo-tank has all outlet pins assigned to power bar plugs I was hoping there would be a different way, but not to worry I'll start with powerbar2 outlet 8 and work my way backwards.

One thing I have noticed it that my pH probe keeps toggling itself off?? Why would this be?
 
Last edited:

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
Ok thanks i had looked at the ato guide but as robo-tank has all outlet pins assigned to power bar plugs I was hoping there would be a different way, but not to worry I'll start with powerbar2 outlet 8 and work my way backwards.

One thing I have noticed it that my pH probe keeps toggling itself off?? Why would this be?
In case you have the Sensor extension, you can simply use one of the sensor ports with the right jumper setting.
If you do not, you could build something yourself that connects to the RJ45 Ethernet socket for the sensor extension.

Depending on which version of RoboTank you have, of course.

What exactly do you mean by "toggling itself off" ?
Does it intermittently show values of 0.0 or does the probe's entry in the pH tab switch to "disabled" ?
The first suggests an incorrect I2C setting as described here.
 

elmo2002

New Member
View Badges
Joined
Dec 31, 2022
Messages
3
Reaction score
3
Location
uk
Rating - 0%
0   0   0
I have a robo-tank v3 i believe and purchased the Sensor extension so will be using those ports. I was just confused with how to monitor just the sensor without adding it to an outlet / equipment.

The probes entry in the pH tab switches to off, see attached screenshot
Screenshot1.png


The strange thing is that although the graph i have set u on the dashboard shows no data and under the pH tab it shows that the probe has toggled itself off, I still have a full set of data from the pH probe in my home assistant :face-with-raised-eyebrow:
Screenshot2.png
 

trexodore

Community Member
View Badges
Joined
Aug 27, 2021
Messages
88
Reaction score
87
Location
Orlando, FL
Rating - 0%
0   0   0
hey guys, I'm finally getting around to building this and I'm following the guides on adafruit.com. There's a few parts that are no longer available. One being the DB9 male adapters here:
Amazon product.
Is this a good alternative? Amazon product

Additionally the LM2596 Buck converter link is broken but this is the only one I can find that specifies 12v to 5v: Amazon product
 

Krheigh

New Member
View Badges
Joined
Apr 17, 2020
Messages
21
Reaction score
17
Rating - 0%
0   0   0
Adding analog sensors with ADS1115

Michael Lane has been working on a new ADS1015/ADS1115 driver for reef-pi.

This brings new possibilities to Reef-Pi:
  • PH/Orp probes
  • Pressure sensors
  • Flow sensors
  • Etc.
Any analog sensor can be used as long as the analog signal is in between 2.0V to 5.5V.

ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier

ADS1115.png


ADS1115 Features:
  • Resolution: 16 Bits
  • Programmable Sample Rate: 8 to 860 Samples/Second
  • Power Supply/Logic Levels: 2.0V to 5.5V
  • Low Current Consumption: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
  • Internal Low-Drift Voltage Reference
  • Internal Oscillator
  • Internal PGA: up to x16
  • I2C Interface: 4-Pin-Selectable Addresses
  • Four Single-Ended or 2 Differential Inputs
  • Programmable Comparator
I had an ADS1115 board so I tried if my PH probe is working. So I made a “How to guide” maybe it will be of use for others. I used a Raspberry Pi 2 Model B with Reef-Pi version 3.5.

Add driver under Configuration/Drivers
1.png


Configure the Driver:
2.png

Name: PH
Type: ads1115
Address: standard is 72
Gain: 2/3, 1, 2, 4, 8 or 16

An Adafruit tutorial has this guidance.
# Choose a gain of 1 for reading voltages from 0 to 4.09V.
# Or pick a different gain to change the range of voltages that are read:
# - 2/3 = +/-6.144V (High Gain, Sensitive to noise)
# - 1 = +/-4.096V
# - 2 = +/-2.048V
# - 4 = +/-1.024V
# - 8 = +/-0.512V
# - 16 = +/-0.256V (Low Gain, Not Sensitive to Noise)
# See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.

Reboot (Configuration/Admin)

Add analog input under Configuration/Connectors
3.png


Configure the connector
4.png

Name: PHpin0
Pins: 0 (depends what pin you use on the ADS1115 board)
Driver: PH
Reload (Configuration/Admin)

Add the probe under pH
5.png


Configure the PH probe
6.png

Name: PH
Analog input: PHpin0
Check frequency: 10
Ph status: Enabled
The other settings are not mandatory.

Calibration
The first readings will be high:
7.png

Therefore you need to calibrate!

To be able to calibrate you first have to disable the Ph status
  • Edit ph.
  • Disable probe.
  • Save
  • Calibrate
  • Rinse probe in rodi
  • Place in 7 calibration fluid
  • Wait for readings to stabilize
  • Set cal value to 7 (Midpoint)
  • Push Run
  • Rinse probe
  • Put in 10 calibration fluid
  • Set cal value to 10 (Second Point)
  • Run
  • Enable probe
  • Rinse probe and check both 7 and 10 and make sure it’s close.
Enjoy!
Can anyone explain why there's gain 1-4?
Should I have different gains in the boxes or should I have same gain in all?
My brobe says -61 pH even if I do calibration
 

kboogie

Well-Known Member
View Badges
Joined
Aug 6, 2021
Messages
879
Reaction score
553
Location
Boynton Beach
Rating - 0%
0   0   0
Has anyone every used one of these Tuya PH and Salinity probes? I bet it would be easy to use the Tuya API to get the data.

 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
sorry again
what is the best way to do it? tried it with no result or a plank in front of my head
You create the driver like normal, then you create an outlet that points to the particular channel of the pca9685 driver, then a piece of equipment that points to that outlet. So instead of driver->jack->doser for all your PWM channels, you go driver->outlet->equipment for the ato channels and Jack only for the other channels.

Oh and by channels I mean the pin number field
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
Can anyone explain why there's gain 1-4?
Should I have different gains in the boxes or should I have same gain in all?
My brobe says -61 pH even if I do calibration
The ADS1115 has a gain setting, that allows you to measure different voltage ranges and as far as I think to know, therefore either increase your measurement range up to the supply voltage (in the 2/3 setting) or improve resolution for very low voltages (in the 2 to 16 setting), as you can see in table 3 in the datasheet:
PGA SETTING2/3124816
Full Scale (V)±6.144V*±4.096V*±2.048V±1.024V±0.512V ±0.256V
"Resolution"~0.19mV~0.13 mV~0.06 mV~0.03 mV~0.016~0.008 mV
* ... don't apply voltages below GND-0.3V or above VDD+0.3 volt on the signal inputs
"" ... that is only the digital resolution, noise might (and likely will) be higher than this

The ADS1115 or 1015 measure a voltage. I'm guessing that the driver returns volt or millivolts, but I don't know.
You now need to calculate this voltage into a pH value, depending on your circuit.
 
Last edited:

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
Has anyone every used one of these Tuya PH and Salinity probes? I bet it would be easy to use the Tuya API to get the data.

It’s only easy if there is a publicly documented API or home assistant interface, as far as I know.
 

ColoredRock

Well-Known Member
View Badges
Joined
Aug 9, 2021
Messages
856
Reaction score
976
Location
Murrieta, CA (North of San Diego)
Rating - 0%
0   0   0

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
I think I am missing something, probably some weird quirk of the macro system, but how do I set it up so when I have 2 level sensors for ato, the second, slightly higher one acts as a backup cutoff incase the first is stuck and shuts the pump off?
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
I think I am missing something, probably some weird quirk of the macro system, but how do I set it up so when I have 2 level sensors for ato, the second, slightly higher one acts as a backup cutoff incase the first is stuck and shuts the pump off?
I believe you have to configure the backup as an ATO (but inverted) as well and run a macro that disables the first ATO and shuts off the pump.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
I believe you have to configure the backup as an ATO (but inverted) as well and run a macro that disables the first ATO and shuts off the pump.
If I leave the working single ato as it is, add a second one, either with inverted or non inverted inlet, and have it control a reversible macro that either just enables or disables the other ato, then the pump either doesn't start or doesn't stop and the enable disable button for the safety ato and/or the other one locks up with no reaction when clicking it, other equipment switches still work at that point. In trying to fix that by trying to delete the safety ato configuration, my pi crashed.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
If I leave the working single ato as it is, add a second one, either with inverted or non inverted inlet, and have it control a reversible macro that either just enables or disables the other ato, then the pump either doesn't start or doesn't stop and the enable disable button for the safety ato and/or the other one locks up with no reaction when clicking it, other equipment switches still work at that point. In trying to fix that by trying to delete the safety ato configuration, my pi crashed.
Hm. My guess is that it "locks up" (maybe intentionally), because the safety ATO and the associated macro are constantly engaged (switching the first).
In the inverted case this should happen when the safety ATO triggers and in the non-inverted case it should happen all the time (when the safety ATO is not triggered), stopping the first ATO from starting the pump in the first place.

Also, ATOs might have a check period, so I believe they should only change their behavior once every >insert period here< seconds.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
If I leave the working single ato as it is, add a second one, either with inverted or non inverted inlet, and have it control a reversible macro that either just enables or disables the other ato, then the pump either doesn't start or doesn't stop and the enable disable button for the safety ato and/or the other one locks up with no reaction when clicking it, other equipment switches still work at that point. In trying to fix that by trying to delete the safety ato configuration, my pi crashed.
Another thing: if you make it a reversible macro turning off the pump, if the safety ATO is off, it might actually trigger the reverse of this, e.g. turn the pump on all the time, when the safety ATO is not triggered.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
Another thing: if you make it a reversible macro turning off the pump, if the safety ATO is off, it might actually trigger the reverse of this, e.g. turn the pump on all the time, when the safety ATO is not triggered.
No the macro is turning on and off the other ato system, not the pump.

But yeah, among various crashes that's what I have been getting: pump either stays on or stays off, it doesn't switch at the transitions of the sensors
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
No the macro is turning on and off the other ato system, not the pump.

But yeah, among various crashes that's what I have been getting: pump either stays on or stays off, it doesn't switch at the transitions of the sensors
Hmm, what is your ATOs’ respective check period ? E.g. if that’s 10s, it could happen, that the pump only turns off up to 10s after the sensor is triggered.

If your safety ATO is not correctly inverted (at this point I wouldn’t claim to know which setting is the „correct“ one ), it switches the first ATO off when water is lower than the safety sensor. If that ATO already triggered the pump (because the first ATO is first in the list, hence it triggers first), the pump will never shut off.
If that first ATO didn’t trigger yet, it’s off now and can’t activate the pump.
This would explain your behavior. In that Case I believe your safety ATO‘s signal is incorrectly inverted.

Since in your current setting the safety ATO only triggers the first ATO, which is responsible for deactivating the pump, the pump can never shut off when reaching the safety sensor. At least as long as switching off an ATO doesn’t also switch off the triggered equipment.
 
Last edited:

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,015
Reaction score
943
Location
Germany
Rating - 0%
0   0   0
No the macro is turning on and off the other ato system, not the pump.

But yeah, among various crashes that's what I have been getting: pump either stays on or stays off, it doesn't switch at the transitions of the sensors
Personally, I’m not quite sure if you’d want a safety ATO to be reversible. You want it to deactivate the faulty ATO and the pump so you can afterwards manually remove the fault and reset the system.
What you could do is set up both ATO and backup ATO as an actual ATO, but turn off the backup ATO.
Then additionally define a safety ATO that uses the backup ATO as inverted signal and as soon as that’s triggered, switch off the first ATO, activate the backup ATO and switch off the pump (nonreversible).

That way, as soon as your backup ATO sees water, it takes over from the faulty first one.
 

TOP 10 Trending Threads

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

  • 100% live rock + bagged sand

    Votes: 34 26.4%
  • 100% dry rock + 100% live sand

    Votes: 45 34.9%
  • 50/50 live/dry rock, 50/50 live/bagged sand

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

    Votes: 11 8.5%
  • 25% live rock, 75% live sand

    Votes: 10 7.8%
Back
Top