Ph probe, co2 and solenoid valve

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
When i control my solenoid valve using the ph probe in reef-pi, every 60 seconds the valve turns off and on, you can see the spike in the graph.
For me there is a bug in the program.

If i turn the solenoid valve on and off manually by the equipment page, i have no spike so i don't have a cable problem

Screenshot_20210512-210457_Chrome.jpg
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
I have bought this board



but I have replaced every single cheap chinese relay with an Omron pin-to-pin compatible one,
I'm using a UNL2803A interface from raspberry to relays board
I also have a separate +5V power supply for relays board. I don't remember if the ground is in common but I think I separate it too

I have a three ph-board https://github.com/reef-pi/pH-Board/blob/master/README.md connected together with a 20 cm long cable (total length).

every time I try to use one of my probes to control equipment, I can enter any value in the high or low threshold and the equipment starts to switch off and on continuously, without any reason. For example, now I can read, in my calcium reactor, 6.5 ph, the lower threshold is 6, the high threshold is 9, the equipment (my solenoid valve) start to switch on and off every 30 sec.
The raw value of my probe (i see it in the calibration tab) is from 3865 to 3935, using reef-pi log "sudo journalctl -fu reef-pi.service" i can read

2021/05/13 07:24:29 ph sub-system: Probe: PH-REATTORE Reading: 6.522382974262201
2021/05/13 07:24:30 ph sub-system: Probe: PH-REATTORE Reading: 6.515786549247785
2021/05/13 07:24:31 ph sub-system: Probe: PH-REATTORE Reading: 6.515336792996802
2021/05/13 07:24:32 ph sub-system: Probe: PH-REATTORE Reading: 6.514587199245165
2021/05/13 07:24:33 ph sub-system: Probe: PH-REATTORE Reading: 6.514587199245165
2021/05/13 07:24:34 ph sub-system: Probe: PH-REATTORE Reading: 6.513987524243854
2021/05/13 07:24:35 ph sub-system: Probe: PH-REATTORE Reading: 6.513837605493526
2021/05/13 07:24:36 ph sub-system: Probe: PH-REATTORE Reading: 6.514137442994182

so I can read a nearly stable vale (6.5), if I read the value every 300 seconds I think my solenoid valve turns off and on every 300 seconds but turn on and off every 30 sec instead.

because of that, I think there is a bug in the program.
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
ag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro-subsystem: executing step: equipment id: 11 state: true
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 Euipment: 11 On: true
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro subsystem. Finished: ON Co2
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro subsystem. Running: OFF Co2
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro-subsystem: executing step: equipment id: 11 state: false
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 Euipment: 11 On: false
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro subsystem. Finished: OFF Co2
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 ph sub-system: Probe: PH-VASCA Reading: 7.79179845158015
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 ph sub-system: Probe: REDOX Reading: 1.168598151408451
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 ph sub-system: Probe: PH-REATTORE Reading: 6.530028830528909
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 Current value of 'PH-REATTORE' within range switching off control equipments
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro subsystem. Running: ON Co2
mag 13 08:33:13 reef-pi reef-pi[2487]: 2021/05/13 08:33:13 macro-subsystem: executing step: sleep for 300 seconds
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
I have made two macros,

the first one, OFF co2, turn off the equipment co2
the second one, ON co2, wait 300 sec and turn on equipment co2

in the log, I see running both macros!

the program must do these step:

Code:
if (threshold < 6.5) {
       if(co2==on){
              co2=off;
       else
              ;
       }
}
if (threshold > 6.8){
     if(co2==off){
               co2=on;
      else
             ;
      }
}
 
Last edited:

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Sorry I can't help with this, it does sound like you're on to something, I think there's some misunderstanding on how to use macros properly or something needs tweaked. When I try to trigger a macro based on a sensor it seems like if there is more than one step it doesn't run properly.
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
in my opinion, reef-pi can do a lot of things, but there is a lack of documentation.
for example, I'm used to read 20 years old siemens plc program in my job, every single line have a comment because, after so many years and a lot of people working on it, without comment no-one can understand the program

I can try to learn how to use git-hub, go, and try to work on the reef-pi project, but without comment on the program line, it's hard task to do.
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
I made you an example, my plc run in a heavy electromagnetic noise environment, so if I need to read an analog value, I need to make an electronic filtration, built-in analog-in plc module, and software filtration.
For the calibration routine, I read like 20 values, I remove the highest and the smallest value, and I make the average of the rest.
After that, if the actual value is near the previous value ( previous-value +-10% ) I use it, otherwise, i reject it. and so on.

If I read ph 8,2, after 10ms I read ph 4, after 10 ms I read ph 8,2, certainly, the ph4 is an electromagnetic noise

ah, i apologize for my grammatically incorrect English, i woke up at 4 a.m, it's Friday and i'm soo tired!
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Yeah without comments it's very hard, I've looked in the code a few times but get lost quick.

I like how you filter and average the readings, that's a good thing to do.
 

ZaneTer

Well-Known Member
View Badges
Joined
Jan 14, 2018
Messages
922
Reaction score
878
Rating - 0%
0   0   0
@Kurtzisa

it’s nice to see there are a few other Siemens PLC programmers around here. Why didn’t you choose to go with a small PLC and then interface it with an Arduino for analogue readings?
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
@Kurtzisa

it’s nice to see there are a few other Siemens PLC programmers around here. Why didn’t you choose to go with a small PLC and then interface it with an Arduino for analogue readings?
I'm too lazy to do it :p

Seriously, there is a lot of open projects, i found one i like most and i work on it.
I'm a maintainer, so i know to found a bug, to improve the program but i'm not a real programmer. For example, i don't know how to make a graphical interface.
 

ZaneTer

Well-Known Member
View Badges
Joined
Jan 14, 2018
Messages
922
Reaction score
878
Rating - 0%
0   0   0
I'm too lazy to do it :p

Seriously, there is a lot of open projects, i found one i like most and i work on it.
I'm a maintainer, so i know to found a bug, to improve the program but i'm not a real programmer. For example, i don't know how to make a graphical interface.
The graphical interface is VERY easy to do. Then you can use something like AnyDesk to allow remote access even through your phone.
 

GuppyHJD

Valuable Member
View Badges
Joined
Jun 15, 2020
Messages
1,127
Reaction score
687
Location
North Port, FL
Rating - 0%
0   0   0
The graphical interface is VERY easy to do. Then you can use something like AnyDesk to allow remote access even through your phone.
ZaneTer
Are you saying the graphical interface is easy on the ReefPi or the PLC?
I am just starting with an arduino and trying to graph my pH readings. My pH values have not moved in weeks, so I am trouble shooting that.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
im trying to understand the bug you encountered . is it related to macro? does it work as intended if its not a macro and just an equipment?
 
OP
OP
Kurtzisa

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
im trying to understand the bug you encountered . is it related to macro? does it work as intended if its not a macro and just an equipment?
from version 3.4 to version 5.0 when I try to use the ph probe into the calcium reactor to open-close co2 solenoid valve, this function doesn't work, every 30 seconds the solenoid valve turns off and on.
I try to make a workaround using macros but doesn't work either.

there is no documentation for using reef-pi
 

More than just hot air: Is there a Pufferfish in your aquarium?

  • There is currently a pufferfish in my aquarium.

    Votes: 30 18.1%
  • There is not currently a pufferfish in my aquarium, but I have kept one in the past.

    Votes: 27 16.3%
  • There has never been a pufferfish in my aquarium, but I plan to keep one in the future.

    Votes: 32 19.3%
  • I have no plans to keep a pufferfish in my aquarium.

    Votes: 69 41.6%
  • Other.

    Votes: 8 4.8%
Back
Top