I have been experiencing a very difficult to solve ground loop problem with my pH measuring system. My basic setup is a standard pH electrode running through an op-amp to an ADC which communicates through I2C to a Raspberry Pi.
Calibration of the probe proceeds as expected and testing various liquids in glasses works perfectly. The purpose of the pH meter is to measure the pH of a fish tank. When placed in the process fluid I get very strange reading (sometimes ph of < 1 or > 14). The calibration of the probe also quickly becomes altered. If I have the probe suspended in the process fluid and scoop the probe out with a cup the reading returns to the expected value as soon as the cup breaks the water.
I assume this is a ground loop issue. I have shut off and removed all heaters and pumps however this does not fix the issue. I have noted that plugging and unplugging a monitor into the HDMI port of the Raspberry Pi changes my reading significantly, although it is still wrong either way. The Pi is being powered from a standard cell phone charger.
I am using a Ti LMC6001 Op-amp. My circuit is taken from the datasheet http://www.ti.com/lit/ds/symlink/lmc6001.pdf The only changes are some resistor value changes to change the scaling of the voltage.
A AD8603(datasheet:http://www.kynix.com/uploadfiles/pdf86758/AD8603AUJ-REEL.pdf) is used as voltage follower to amplify the pH sensor signal to a microcontroller. As this opamp has a single supply and thus cannot output a negative voltage, the pH sensor is connected between a 600mV reference and the AD8603 non-inverting input (with a 1M resistor in series, as described in an Analog Devices application note).
For power supply I used vigortronix switched mode power supply modules that accept 230VAC as input and 5V for output.
Everything works as expected, except, when the pH sensor comes in contact with the liquid to be measured in a real production environment the output of the AD8603 clips to its supply voltage. The liquid (for the most part just water) runs through metal pumps that are connected to earth, so the potential of the liquid is about the same as the earth potential I’d say.
I was able to reproduce this behavior on my desk by holding a wire connected to earth in the glass with the testing liquid (pH buffer 7.0).
I replaced the vigortronix module with a simple linear power supply: transformer, rectifier, buffer capacitors and 5V voltage regulator and the problem is almost gone. I say almost, as I see a tiny fluctuation (0.1 pH at most) in the measured pH when I hold the wire connected to earth in the liquid but I’m not sure if this is caused by the wire.
I don’t understand what is going on here. This circuit has no connection to earth, it is completely floating. I cannot connect earth to the ground of the circuit as that would short circuit the reference voltage (pH sensor electrode is connected to earth via liquid). But even if that was not the case, connecting earth to ground will introduce the ground loop.
What are switching power supplies doing that can cause this behavior?