Ph probe, co2 and solenoid valve

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
What state or country do you live in
Other International
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
 
Can you give more info on your hardware and how things connect?
 
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.
 
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
 
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:
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.
 
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.
 
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!
 
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.
 
@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?
 
@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.
 
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.
 
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.
 
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?
 
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
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%

New Posts

Back
Top