Soil moisture sensors and ground loop issues - Page 1
Forum section: electronics / projects

author: aberco
author_rank: Contributor
timestamp: March 01, 2019, 04:17:50 am
content: Dear all,I am facing ground loop issues as I am designing a soil moisture logging device, and are looking for some advices to circumvent the problem.Setup:- I have designed a logging station that is powered from a main switching power supply (56VDC).- And 16 sensor units are daisy-chained to the logging station using ethernet cables with 56VCD power and RS485 signaling.- Each sensor unit contains a NE555 front-end to interface to a soil humidity sensor (resistive type).Everything works very well, but I forgot to consider ground loop current while doing the design: once the sensors are installed into the ground, readings are getting all over the place. I ran the setup from a battery UPS and it works well as long as only one sensor is in the ground.Since I have already designed the logger hardware, made custom PCBs etc., I am looking for a solution that can be adapted without too much troubles to the existing design. It seems that the only way to avoid problem is to isolate the power supply and signal of elements connected to the ground. I came up with the possibility to isolate the NE555 frontend + sensor using a isolated DC/DC converter for power and an optocoupler for the signal output (see attached image). Would this be a sufficient solution?I would like to run the sensors in parallel as well, they should not interact as they are separated by at least 5m.Ultimately I could power them up in sequence one after another to take readings, but I would rather avoid doing this if possible as it would involve some major changes in the code.Any help greatly appreciated!

author: floobydust
author_rank: Super Contributor
timestamp: March 02, 2019, 04:39:37 am
content: RS-485 is a 3-wire system (Rx, Tx, Gnd.)If you are only running two wires between nodes, then there is a problem.Seeking ground, there will be a lot of common-mode noise at each node due to RS-485 imbalance. Do you have a termination resistor with bias network at the master station, which is earth-grounded? Somewhere the RS-485 needs an earth-ground reference and I don't see it in your block diagram.The possible fix using an opto-coupler should work if you are using a second DC-DC converter, to isolate the 555 and MCU/RS-485 circuits' +5V rails. I don't know the 555 frequency or sensor capacitance/resistance, as the DC-DC converter can add its own noise and give you more trouble.

author: aberco
author_rank: Contributor
timestamp: March 02, 2019, 07:30:59 am
content: The RS485 network does work really well, it has its own ground. It is also properly terminated (120 ohms and 680 ohms to ground and V+ for A and B).I have not included much details on this part of the circuit because it all work. The base station is earth grounded and powered through mains with a switching power supply.I have read other feedback on project involving soil moisture sensors (and not related to a RS485 line) that give crazy readings when plugged into the ground (and powered from mains voltage).For practical reasons, I would like to isolate the front end exclusively (orange frame on my schematics), by powering only the NE555 from an isolated DC/DC converter and feeding the signal to the MCU trough an optocoupler.555 is between 50Hz and maybe ~10kHz depending of soil moisture.

author: floobydust
author_rank: Super Contributor
timestamp: March 02, 2019, 07:53:16 pm
content: The problem seems to be common-mode noise upsetting the 555 oscillator.In reality the 2-wire soil sensor has a third RC influence to soil earth ground.If the master station is earth-grounded, then it's not making sense why adding node 2 affects node 1. Did you confirm where the noise is getting in ? Is it low freq. AC mains hum or HF from the DC-DC converter, or a noisy 56V PSU?A building's powerline ground is always noisy compared to nearby soil. Connection to the utility grid, a corroded ground rod etc. Underground pipelines with cathodic protection having pulsed DC are another source of noise in dirt.You can test it by measuring ACV between the RS-485 ground and a local ground rod stuck in the soil at a sensor, assuming it's far away.A new DC-DC converter will add its own noise, the little 1W modules run at about 300kHz and have lots of internal stray capacitance. So the 5V side would have 300kHz noise there. I add a small CM choke and Y-cap to get rid of this. There is a good chance galvanic isolation with a DC-DC does not work as expected.Your firmware could filter out mains hum and other periodic noise, assuming the 555 is still able to pick out soil sensor. I would add a small speaker and listen to the 555 timer's output, to hear what is modulating things, as a poor man's test.

author: ogden
author_rank: Super Contributor
timestamp: March 02, 2019, 08:18:24 pm
content: Today there's no point of wired soil moisture sensors. 20 years ago it would be good solution indeed.

author: aberco
author_rank: Contributor
timestamp: March 03, 2019, 05:29:38 am
content: Thanks floobydust,Yes the problem is clearly common-mode noise.Test of the entire setup in the lab, "off ground", is giving great performance on the reading of the sensors. There is no noise on the analog front end, the readings are rock solid.I have also measured critical points for noise with an oscilloscope (with proper grounding methods for the probe) and the 56V DC-DC converter has appropriate filtering (there's minimal noise on Vcc). There is actually a second stage regulation done by a 5V LDO, after the DC-DC. The module is a double sided PCB with proper grounding.I am not too worried about ripple created by adding an isolated DC-DC on the NE555 frontend, since the reading is frequency of a square wave signal. If it is a problem it can be filtered with choke & PI filter as you mentioned.When tested outside, the setup:1) works if powered from a battery (UPS) and only one humidity sensor is in the ground2) works if powered from mains and any sensors are isolated from ground (i.e. in a flower pot)3) does not work if powered from a battery (UPS) and two or more humidity sensor is in the ground4) does not work if powered from mains and one or more humidity sensor is in the groundBasically, if there's more than one ground, there's a ground loop and things go bad.Here's someone experiencing the same issue with a different setup:https://electronics.stackexchange.com/questions/374749/soil-moisture-sensor-value-is-fluctuating-when-plugged-into-the-soilSome clues here as well:http://www.irrometer.com/200ss.html"Devices reading WATERMARK sensors must isolate the sensor reading circuit from any earth ground. Mains powered devices will need transformer isolation to prevent a loop to ground through nearby equipment, and any communication line intended to be permanently connected to another grounded device will require optical isolation. If a ground loop exists, the readings will be wrong and current leakage may quickly destroy the sensor electrodes. Battery powered devices are more isolated by nature, but grounds for lightning protection etc. can cause the same problem.In addition to general device isolation from ground, when reading multiple sensors the circuit must be designed to accommodate isolating sensors from each other. The wet soil in which sensors are installed creates a common conductive path between sensors. In effect, without isolation a device can be reading partially or fully between electrodes in different sensors rather than between electrodes inside each sensor.Sensors must be powered individually, and the ground must be isolated from sensor to sensor. Even if powered individually, an open ground path to another un-powered sensor can't be allowed. This is best accomplished using multiplexers to open and close the appropriate channels."

author: mikerj
author_rank: Super Contributor
timestamp: March 03, 2019, 10:16:23 am
content: Could you consider an alternative sensing method? You could drive an AC signal through the soil via a small transformer with a suitably high impedance driver, and then measure primary voltage which would depend on the secondary loading (i.e. soil moisture content). No isolated DC-DC power converters required, just a small signal transformer. The signal to drive the transformer could come from a 555, or the micro if you have sufficient pins. You would need some way of measuring the primary voltage, e.g. ADC input or convert to PWM if you only have the CCP pin.

author: JVR
author_rank: Regular Contributor
timestamp: March 05, 2019, 11:38:30 am
content: Why not switch out the SMPS for a transformer? Seems like the easiest fix to isolate the entire sensor network.

author: ajb
author_rank: Super Contributor
timestamp: March 05, 2019, 03:38:39 pm
content: So the problem is that when the sensors are all plugged into the earth, the earth forms a network of parasitic resistances among the sensor probes and electrical ground, and this disrupts your sensor readings. Your optocoupler and isolated DC-DC solution is probably the chance of solving the problem with minimal modification to the circuitry. However, this may not be enough if the sensors are relatively close together and are especially sensitive (I haven't looked at your circuitry to figure this out). Just be aware of parasitic coupling across the isolation barrier (IE, leave a solid break in any power/ground planes on the board. It doesn't have to be a wide break, because you're not concerned about withstanding a ton of voltage, and edge-to-edge coupling is less significant than face-to-face coupling).

author: perieanuo
author_rank: Frequent Contributor
timestamp: March 05, 2019, 05:44:28 pm
content: The dcdc solution is the ONLY one.or rethinking the moisture detection...Envoyé de mon iPad en utilisant Tapatalk

author: ogden
author_rank: Super Contributor
timestamp: March 05, 2019, 07:16:58 pm
content: Quote from: perieanuo on March 05, 2019, 05:44:28 pmIt's not. There's wireless solution as well.

author: aberco
author_rank: Contributor
timestamp: March 07, 2019, 03:55:57 am
content: Than you all, this is very helpful.mikerj, I'd like to keep the sensors I have already purchased. I have used watermark sensors which are the standard in irrigation measurement: they have a granular material between the electrode that has been factory calibrated, so it is easy to convert sensor resistance into soil tension values (in -hPa or cBar).JVR, as noted above, even when not using an SMPS (system is powered from a battery), I have problem when more than one sensor is in the ground.ajb, I will give it a try... that's all I can think of right now and I can implement the DC/DC + optocoupler relatively easily: I am designing a little bodge PCB for that purpose. I have good experience in PCB design so I will certainly separate the sensor front end to the rest of the circuit and minimise coupling. The sensors are all physically separated by a couple meters from one another, which I hope will be enough. If not I will write a software routine to sequentially turn them on one at a time.ogden, wireless could have been the solution, but I am also running other sensors like a CO2 sensor that consume 200mA. Having 16 battery powered units with that much power draw is just not very practical for my application.I have attached a photo of the sensor units, the humidity sensing front end is on the upper right corner of the PCB.Will send an update of the results as well!

author: aberco
author_rank: Contributor
timestamp: April 14, 2019, 12:43:58 am
content: So I finally got the parts and got my little fix PCB manufactured.I have used one of the common 1W 5V-5V isolated DC/DC converters. The load (555 and IR LED) is about 3.5-5.0mA, on the DC/DC input side it consumes about 25-30mA (efficiency is terrible for light loads, but of course it's the isolation that matters).Also, at low loads, the converter is not delivering 5V but a higher voltage, so I rewrote my sensor calibration (resistance to frequency conversion by the 555 is dependent over supply voltage).Electrically everything does work, now I have to plant it in the ground and see if the isolation does the trick!

author: aberco
author_rank: Contributor
timestamp: April 27, 2019, 07:10:46 pm
content: And it all work!I planted 3 sensors in wet soil, and they all give super steady readings.Thanks for the help and I hope this can serve someone interested in designing a similar application.