I experienced the same as described in this question: A AD8603 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?

  • \$\begingroup\$ Welcome to SE. A circuit diagram of the relevant connections would be really good. There's a schematic button on the editor toolbar. \$\endgroup\$ – Transistor Feb 16 '16 at 20:31

Many SMPS (primarily those without a grounded housing) use a Y-capacitor to bring the output to a defined voltage level. This is done to prevent several problems associated with a floating ground on the output.

What means that here? Effectively a voltage divider is built from two small capacitors into the primary side. It's ends are connected to live and neutral. This means the middle of that divider has the same potential regardless the orientation you put the plug into the wall outlet. It has half the mains voltage over neutral. This node is then connected to the ground of the secondary side. This way the output ground and positive get a well defined potential relative to earth and relative to the primary circuitry. This helps to prevent breakdown of insulation at the feedback optocouplers for example due to ESD buildup.

But this leads to the uncomfortable situation that you cannot build circuitry which may touch earth without additional measures because if you do so an AC current will flow from live over the upper capacitor of the divider through the secondary part of the SMPS and your connected circuitry to earth.

Usually this current (due to safety code it is limited to 0.7 mA by selection of appropriate Y-capacitors) is sufficient to turn all sensible measurments into crap. This is similar to playing piano while getting your fingers constantly hit by little dwarfs with copper mallets standing on your keyboard.

In fact, if you look in the data sheet of the 1W vigortronix SMPS you find a „leakage current“ of 0.1 mA. This most likely is the source of your headaches.

You may try to earth the secondary circuit of the SMPS, but be aware that this may violate some code, depending on the design of your whole device. Also there may be some SMPS out there without a capacitor like this.

  • \$\begingroup\$ Thanks for this excellent explanation, but what are the problems with a floating output? Something that is floating could not sink nor source any current I'd say. \$\endgroup\$ – user1256759 Feb 17 '16 at 13:59
  • \$\begingroup\$ The most obvious problem is ESD resilience. In between primary and secondary circuit there are mainly two parts. A transformer and an optocoupler. While the transformer typically won't be damaged by ESD, the optocouplers are susceptible to. If a discharge is injected into the secondary circuit of the SMPS the current path will include the optocoupler if the voltage of the discharge exceeds the typical isolation voltage of the coupler (ELD207 has 3.75 kV). The discharge can easily destroy the coupler and adjacent devices. An Y-capacitor will open a low impedance path to the discharge. \$\endgroup\$ – Ariser Feb 17 '16 at 14:21

Key phase here: Switched mode power supply. I'll bet your having an RF problem. Your power supply stinks and is conducting RF onto your PCB and that is causing your sensor to function like an antenna. And the RF pathway is even better when you stick the sensor in water. RF problems are weird, its an art not a science because if its really high frequency above 100MHz, measuring it with even an oscilloscope probe or moving a cable can change the preferred pathway for the signal.

Stick a voltmeter between the sensor and the water, do this for DC and AC mode, also check everything with an oscilloscope. If you have a spectrum analyzer with a near field wand that would be great too.

What can you do? Make sure you isolate your analog electronics from bad things. Use shielding, ferrites and low pass filters to keep signals out of your sensor that you don't want. Follow good PCB practices. Even digital sampling of the ADC can change your signal.

If its not an RF problem, its a ground loop problem, and by ground we are talking very small currents, like pA's of current, like the kind your amplifier will pick up. There are pA's of current flowing everywhere. I doubt this is the problem but something to think about

  • \$\begingroup\$ I'll bet against :) Encapsulated SMPS tend to be a rather good choice in terms of RF problems. I bet on leakage current. \$\endgroup\$ – Ariser Feb 16 '16 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.