pH controller unstable in field measurements

Hello.

Sorry for no updates but I had other efforts to delve in and went back to this one a few days ago, only to find out that I am having problems again.

It was all working fine after fixing the ground leakage issue Doc pointed out. However, after about 3 to 4 weeks of usage, I was reported that the measurements were oscillating again. I went to the site and the situation was terribly worse than ever before.

Not only was the ph oscillating (by about 2 ph, in addition to being lower much than the expected set point, it should be around 8.20 and measurements went from 5ish to 8 ), but also the temperature sensor was reporting temperatures from 50ºC to 60ºC, when it should be 24ºC (and I had never had any trouble with the LM35 before).

First thing I checked was the power supply to see if it had a ground-neutral short. No such thing.
After some research and a few hours in the think tank, I thought I had come up with a plausible theory. My guess was that I had a ground loop in the system which hadn't been problematic before. But now maybe my LM35 had acquired some condensation in the conductor (as I had used a cat5 with a plastic cap/epoxy on the sensor), which changed the capacitance, and that was adding noise which would go into the ph line through the ground loop, explaining both sensors going bonkers. However, I ran some tests where I only used one sensor and the other value was fixed, and I still have terrible variation in the water tank. Again, on a water sample from a bottle, it works great, so the problem involves the tank again.

After a few hours of trying different things, I realized that for some reason, the hose that is adding water into the system is the one responsible for my LM35 going bananas. I don't know why suddenly it does when it didn't before, maybe there was some change in the electrical installation of the pumps, but I doubt. If the hose as much as touches the water, a lot of noise is added into the system. Also, if the hose stays in the air and the water is dropped in the tank, it also adds noise (water carries the charge).

So, this solves the temperature problem, BUT the ph values still have a variation of 0.4 (when I should be looking at a 0.01 at most, as it did last time everything was working fine). I also thought it might have to do with a dirty sensor, I still haven't managed to get a hold of another to try it, but I still doubt it.

I also thought about adding a low pass filter to the entrance, however I'm not so sure about it. After designing it and looking at the bode amplitude plot, I realised that, as I'm doing a 200 value averaging for every measurement, the speed of every one of those 200 value measurement is faster than the bode plot takes to reach it's peak value. So every measurement would be undercut by a lot. And then there's the problem with high impedance and the filter probably will degrade the signal even further before it gets to the amp-op. And I kind of gave up on it. However I might be wrong, my filter design skills haven't been used a lot lately.

I measured the DC input to the arduino (for the ph) and the value is stable, however I also have a large enough AC value in it and that's probably the noise I'm having.

Anyone has any thoughts about what could be doing it? Or a nice filter solution?

Thank you very much for any help.

Andre