Im having some issues using these soil Moisture sensors. Irrometer Watermark 200ss.
I would like to share experiences with installation and troubleshooting with anyone with real experience in using them.
Thaks in advance!
Eduardo
Im having some issues using these soil Moisture sensors. Irrometer Watermark 200ss.
I would like to share experiences with installation and troubleshooting with anyone with real experience in using them.
Thaks in advance!
Eduardo
Manufacturer's page: Sensors.
Same question: soil moisture sensor drift - Sensors - Arduino Forum.
Koepel, I had already read all the official documentation from the manufacturer, as well as lots of posts on this forum (including the one you pointed out, thanks) regarding these sensors, but I still have issues I want to share with someone who has used them, they are not related to those posted in those forums
Im using the schematic provided by Van der Lee in his vinduino project:
Vinduino Schematic
I get readings that look very reasonable according to the existing humidity in the sensor, 300-400 Ohm while saturated, several KOhm when dry). But I still have these 2 issues:
1.-When I duplicate the driving circuit to use 2 sensors, I see a big resistance increase (500 instead of 300) when both sensors are in the same water glass. It also ocurrs when they are placed in the same soil, 1 or 2 ft away. My guess is that it is due to current flowing from one sensor thru the soil to the other and then to ground thru it's 4.7K resistors, thus altering the "probe" resistor value. I tried using a digital output for GND, driving it LOW when measuring that sensor, and setting it as INPUT while measuring the other sensor, but for some reason it didn't make any change
2.-Other issue Im having is in 2 of the 3 fields I've installed it, in one of them the sensor has never "seen" any water from the irrigation, it only slowly dropped from saturation (installation) to a total dry reading after weeks. We made sure it made full contact with the soil by pouring a good mix of dirt and water in the gap, and it got pretty solid to the ground. But it still doesn't see the humidity when they water the crop.
The other one worked good for several weeks, maybe 1.5 or 2 months, showing all the watering cycles, but then it started to keep going down as well not seeing any more water, like the other one. Im starting to suspect the installation process (Believe me I've read all the guidelines from manufacturer) is extremely picky. And what's worse, it may work for some time and then stop working, which is really scary for us as a provider
Any help will be greatly appreciated!
Eduardo
Then you have read that alternating the current through the sensor did not work after a while for me and I'm experimenting with sending 250 kHz AC through the soil and that only capacitive sensors are reliable.
You probably use the wrong circuit combined with the wrong sketch.
Please show your sketch.
I'm looking at: GitHub - ReiniervdL/Vinduino: Vinduino is an open license project for agricultural irrigation management. That code seems to be okay, it is not bad. Some delays are very short and will only work with short wires.
Tell us how long the wires are between the Arduino and the sensors. If you use cables, what kind of cables are they ? If possible with a link to that cable. Which Arduino board do you use ? If you designed a Arduino-compatible board, may we see the schematic ?
Whatever you do, don't put a constant DC voltage in the soil.
P.S.: I did not show the link to the manufacturer's page for you, but for us. So we know what we are dealing with.
The schametic is exactly the one you see in the linked page:

But, replicated 2 times. using 2 more D outputs and 2 more Analog inputs
The code is the one from the same project. D0 LOW, D1 HIGH, measure Analog. D0 HIGH, D1 LOW, measure analog. Subtract, calculate equivalente resistor for the voltage and know resistor, and you get a value.
Relevant code in my own sketch is:
pinMode(0, OUTPUT); //Configuramos los pines digitales que alimentan el Watermark1
pinMode(1, OUTPUT);
pinMode(2, OUTPUT); //Configuramos los pines digitales que alimentan el Watermark2
pinMode(3, OUTPUT);
...
measure(1, 0, A0); //Tomar 10 medidas con positivo en 0 y negativo en 1. Recoger en Analog0
read1 = average();
measure(0, 1, A1); //Tomar 10 medidas con positivo en 1 y negativo en 0. Recoger en Analog1
read2 = average();
sensor = (read1 + read2) / 2; //Calcular el promedio de ambas
if (DEBUG) {
Serial.print ("R1= ");
Serial.print (sensor);
}
measure(3, 2, A2); //Tomar 10 medidas con positivo en 2 y negativo en 3. Recoger en Analog2
read1 = average();
measure(2, 3, A3); //Tomar 10 medidas con positivo en 3 y negativo en 2. Recoger en Analog3
read2 = average();
sensor = (read1 + read2) / 2; //Calcular el promedio de ambas
if (DEBUG) {
Serial.print (". R2= ");
Serial.print (sensor);
}
...
void measure (int phase_b, int phase_a, int analog_input)
{
for (i = 0; i < num_iteraciones; i++) {
// Read 1 pair of voltage values
digitalWrite(phase_a, HIGH); // set the voltage supply on
delayMicroseconds(25);
supplyVoltage = analogRead(analog_input); // read the supply voltage
delayMicroseconds(25);
digitalWrite(phase_a, LOW); // set the voltage supply off
digitalWrite(phase_b, HIGH); // set the voltage supply on
delayMicroseconds(25);
sensorVoltage = analogRead(analog_input) + 1; // read the sensor voltage. SUMO 1 para evitar divisiones por 0 cuando no haya resistencia alguna
delayMicroseconds(25);
digitalWrite(phase_b, LOW); // set the voltage supply off
if (supplyVoltage < sensorVoltage) sensorVoltage = supplyVoltage; //Si por error midio analogico > alimentacion, los iguala para evitar negativos
buffer[i] = (knownResistor * (supplyVoltage - sensorVoltage ) / sensorVoltage - zeroOhm) ;
}
}
...
long average() {
unsigned long sum = 0;
for (i = 0; i < num_iteraciones; i++) {
sum += buffer[i];
}
return (unsigned long)(sum / num_iteraciones);
}
I take 10 of these quick readings in a second, send them to SigFox and them put it all to sleep for 15 minutes, so there's never a constant DC voltage applied. Like I said I get the expected resistance values for these meters (300-80K) while soaking them in water on a workbench.... My issues are 1) When I put 2 together. 2) Lack of real soil humidity sensing.
Im using the 1.5m builtin cables that came with the sensor. No extension. Using a MKRFOX1200 board (3.3v logic)
Im also considering using a capacitive sensor like the "SoilWatch 10" that the same author (Van Der Lee) seems to start using now. Not sure how good it works
SoilWacht 10 : https://pino-tech.eu/soilwatch10/.
They are only short, and I don't know if it is possible to put the whole thing in the ground.
But it is capacitive, that should work reliable. It is not connected to the soil in any way.
The MKR FOX is a nice board. It uses the SAMD21 M0+ processor.
The circuit makes a path between the soil and the Arduino board GND, even more so if some pins are OUTPUT and LOW. But if all pins would be set to INPUT (high impedance state) there is still a current path to GND.
That path influences the other one.
Did you change the 1k5 resistors to 4k7 ?
I don't know why a sensor is not working. You could try another sensor a meter away from it.
The schematic and sketch show lack of electronics and programming skills ![]()
The diodes are not needed. The explanation for the diodes make no sense.
The digital pins are also not needed, since the analog pins can be digital pins as well (I don't know if that is also for the MKR FOX, I could not find a pinmapping picture).
In the sketch, the 25 µs delay after the analogRead() is not needed. The sample is taken, so there is no need to wait for something.
The 25 µs is very short. If the sensor has a capacitance, then the time is too short. It might work with the Arduino Uno, because the Uno can blast 40 mA out of pin, but the MKR FOX can not do that. Depending on the settings, it can only do 2m A ... 10 mA.
You don't show the full sketch. If there is a bug in the sketch, it is hard to detect. There is even a website for it: http://snippets-r-us.com/
This line can not be okay: if (supplyVoltage < sensorVoltage) sensorVoltage = supplyVoltage ;
That line fixes the wrong problem in the wrong way. It might be the cause that a sensor is not working. Did you add that line ? I can not find it in the Vinduino code.
There are a number of problems with that little piece of code. The overal structure is not okay, and there are a few minor mistakes. For example the function "average()" returns a unsigned long but the function declaration returns a long.
I wrote that the Vinduino code is not so bad. But now I took a better look at it, it is not good, it is below average.
What to do ?
1 ) Use a capacitive sensor. Forget all this silly annoying resistive soil sensor garbage.
2 ) Or fix all the problems. Use a circuit that is higher impedance. Make better code from scratch. Do many tests to tune the delay and the alternating current for the best result. Avoid pin 0 and 1 (there were some problems in the past to use them as digital pins ?) Use a single sensor per Arduino board. That should work for some time. When salts stick to the sensor closer to one wire than the other wire, you are still in problems after a year or a few years.
Supposedly, according to their website, the soilwatch sensors can be buried and are water tight. I have orderedd a couple and will be checking them shortly
Yes there's a path thru GND. But I tried 2 different things:
1.-Use a Digital IO for each ground. Like D8 is ground for Watermark 1 D9 is GND for watermark 2. Then when measuring WM1 I would set PinMode (8, OUTPUT); digitalWrite (8, LOW), read the watermark, and pinMode (8, INPUT). Same with D9 when measuring WM2. For some reason this didnt make any change
2.-Used a Logic Level N-Channel Mosfet to drive the 4K7 resistors to GND by using those D8 / D9 gates. Same thing, for some reason, I keep getting higher measured resistor values when the WMarks are in the same glass of water
Yes I did change the resistors to 4K7. Believe me I've been following ALL newer posts about that circuit and I've real all comments to those
The sensors ARE working. The only issue is when I get both at the same time in the same glass of water, or in the same area of wet soil. But there's nothing wrong in the circuit to measue individual Watermark sensors. It's the combination of 2 of them what is giving me a headache
Yes I know the sketch is not perfect, neother the circuit, actually in my circuit I removed the diodes and used the other method of turning the biasing digital outputs into inputs after reading so they would not affect the other way reading. Got the same reading on individual sensors, and same issue with dual sensors
I know the sketch is uncomplete but all the rest is related to initializing the sigfox radio, composing the SF message, and sending it to the network. I don't even use those sentences while in debug mode. All I do now is reading resistor values and show them on the console
Yes again I know the sketch may not be 100% in some cases, but the thing is I dont need to analyze the full correctness of this sketch now, I has worked for me for other projects, just getting an abnormal higher resistor measurement as soon as there's water path between both sensors
Not sure if the supplyVoltage < sensorVoltage sentence is mine or found it somewhere else, but it's needed as, even with exactly the same voltage on both pins, the accuracy of the ADC is limited and it may result in a slightly lower reading for the supply voltage than it should, resulting in a negative ohmic result which is by all means wrong as a result. That's not the issue here, it's just a quick fix to avoid a really bad result (negative resistance) due to a minor ADC unaccuracy (I saw it happening before that line)
Anyway, what Im looking here is for anyone who has REAL experience in installing these sensors in the ground and monitoring them for a long time to see if they've had these issues of lack of physical contact with the soil moisture, have you had them?
If I don't get a workaround for these sensors, I will try the SoilWatch 10
Thanks
Sorry, I have no REAL experience with two of those specific sensors next to each other ![]()
I am only expressing my concerns about the software and hardware. In my opinion it is not possible to have reliable results when everything is messy. To be able to fix the problems with two sensors, you should at least have the circuit and software working correct.
To make a circuit floating, every pin should be set as INPUT. An analog input is already a input, that is no problem. The wires connected to GND should be connected to pins instead. Those pins can be set LOW to act as a "GND" and can be set as INPUT to make them floating.
Even that is not 100% reliable, since all pins have internal ESD clamping diodes (inside the microcontroller). In a real situation with real soil, some voltage offset might happen and those diodes could still disturb a measurement of a nearby other sensor.
Well, I think I have mentioned almost all problems by now. I think this is going nowhere
I hope the capacitive sensors do work ![]()
Yes, since my first post to today my code evolved a bit.
For some reason, when I tried, a couple weeks ago, to drive grounds to each individual watermarks with a digital output, something failed.
Yesterday I tried Mosfets to tie them to ground. One WM wasn't being affected by the other in the same water, but the other was. Strange....
I swapped in hardware all D and An IO's from WaterMark 1 and WaterMark 2 and issue was still showing in the same side, thus discarding a software reading issue. Then, there had to be something in the watermark board (all it has is the resistors, Diodes but jumpered now, and sockets to Arduino and to watermarks). I had another board laying around, just put it in place this morning, used 2 digital IO's (configured as inputs while not in use) to drive the individual grounds for each Watermark, and now it seems to be working only maybe showing 5-8 ohh over when they are both put in the same water bowl, which is insignificant for a 0-100% reading of soil humidity. So I feel good now.
I still have the issue of our watermark not sensing the soil humidity after the ground gets too dry, it seems it gets "detached" from the soil and not in true contact with it anymore.
Thanks Koepel for your support!
When the sensor is totally dry inside, it can not measure the soil. The air humidity sensors work in a different way, they can often detect 10% relative humidity, which is very dry.
You could put sensors at the same location at different depths. Some soil moisture sensors consist of a stick with a number of sensors along that stick.
I did not fully read this page, but it tells something about the gypsum filled sensors that you use, about different soils and inaccuracy and waiting 24 hours and a number of sensors at different depths: How to evaluate soil moisture in the field | Integrated Crop Management
Yes, these sensors are designed to work within the soil, the gypsum block acts as a buffer, slowly absorbing (and then releasing) the soil moisture. Also the gypsum material only lets the water molecules enter into the electrodes area, keeping all the salts away, so only the pure water resistance is measures and salts do not affect the reading.
We usually put sensors at different levels, depending on the type of crop. Usually 1 and 2 ft deep.
Yes we follow the proper method for installing the sensors, we soak them for some days before installation, let them dry, and soak again right before installation.
We still have issues eventually. We were at one of these fields where the sensed humidity got stuck at 10-15% even during watering, we recovered the sensor, and we checked it was well installed and in full contact with the soil. But the soil around it had become so dry and hard, that the normal weekly irrigation wasn't able to get to it. It was like an impermeable wall, hard as stone. I guess a good rainfall would have penetrated it, but normal watering didn't. But it really sucks that the farm owner can't see his own watering cycles being registered in our system.
We placed it a little shallower and closer to the water dropper
The manufacturer of the Watermark sensor just recently released the calibration details to the public domain: 200SS
@edugimeno I use an analog switch to solve galvanic contact between sensors. See Vinduino schematic at Tindie.com or Github.
reinier:
The manufacturer of the Watermark sensor just recently released the calibration details to the public domain: 200SS@edugimeno I use an analog switch to solve galvanic contact between sensors. See Vinduino schematic at Tindie.com or Github.
Hi Reiner! Yes I was actually trying to get a hold of you on your blog's comments for these questions!
I know your schematic with the dual channel analog MUX and I actually ordered a couple of them, but haven't used them yet.
I finally managed to get a valid reading with 2 or more sensors without galvanic contact by driving the GND signal below the 4K7 resistors on each Watermark with a digital output in Arduino, setting it at Output and LOW while reading one sensor, and setting it back to INPUT after finishing with that sensor.
So far my benchwork tests look good, time to test in the real ground
My only issues are not getting any %hum increase at the sensors after the irrigation cycles, due to the soil getting too dry and hard so the water doesn't get into the sensor. We unburied the sensor and found it has a good contact with the soil but the area around is as hard as rock and water can't cross it.
I've ordered some SoilWatch 10 sensors too, after seeing you started using them in your latest Vinduino, to see if they have a better reading. What's your experience with them so far? Good reading? No issues burying them deep?
Also, what's your experience with homemade gypsum blocks? Are they as good as Watermark? WM's for me are expensive, around $50 each with shipping to Spain
Thanks!
Hi, I'm working with the 200W Waterwalk sensor, my code to read the sensor the next
digitalWrite (53, HIGH);
digitalWrite (52, LOW);
delay (2000);
supplyVoltage = analogRead (A15);
sensorValue = analogRead (A14);
voltage1 = (supplyVoltage * (5.0 / 1024.0));
voltage1F = ((0.5 * voltage1F) + 0.5 * voltage1);
voltage2 = (sensorValue * (5.0 / 1024.0));
voltage2F = ((0.5 * voltage2F) + 0.5 * voltage2);
Res1 = (((voltage1F * knownResistor) / voltage2F) -knownResistor);
digitalWrite (53, LOW);
digitalWrite (52, HIGH);
delay (2000);
supplyVoltage = analogRead (A14);
sensorValue = analogRead (A15);
voltage3 = (supplyVoltage * (5.0 / 1024.0));
voltage3F = ((0.5 * voltage3F) + 0.5 * voltage3);
voltage4 = (sensorValue * (5.0 / 1024.0));
voltage4F = ((0.5 * voltage4F) + 0.5 * voltage4);
Res2 = (((voltage3F * knownResistor) / voltage4F) -knownResistor);
Res = (Res1 + Res2) / 2;
ResR = (0.5 * Res) + (0.5 * ResR);
I am using the same circuit of the figure that I publish in the post but change the resistance by 20k and I am doing it is to measure the resistance of the sensor to pass it to Kpa and know the humidity of it.
But I have many problems in the measurements of the resistance and its variation that affects the measure kpa formula.
if (ResR <8000) {
R = ResR / 1000
Kpa = (- 3.213 * R-4.093) / (1.0 -0.009733 * R - 0.01205 * DS181R);
}
else if (ResR> 8001) {
R = ResR / 1000;
Kpa = -2,246-5,239 * R * (1.0 + 0.018 * (DS181R-24.0)) - 0.06756 * (R * R) * ((1.0 + 0.018 * (DS181R-24.0)) * (1.0 + 0.018 * (DS181R- 24.0)));
I would like your opinion of what can be done to the code or circuit to know what I am failing
Thank you
Im not sure what the issue could be but when I followed the schematic and sketch from the vinduino project, it measured correctly.
I mean, I put several test resistors in the Watermark plug, and the measured value was spot on. Why don't you get back to the exact schematic and sketch from Reineer? It worked for me.
I don't know why you changed the bias resistor by 20K instead of 4K7, is there an specific reason for it? Not sure if this would be affecting the linearity.
I don't use Kpa as a final output, I use %humidity (0-100) and it shows a reasonable value for dry-mid-wet conditions. The formula is different for % but I think I got it from Vinduino pages too
Remember you can't use a multimeter to compare the measured resistance in the watermark sensors, as soon as you plug the multimeter in, the value drifts pretty quicky due to electrolysis. You can only compare with fixed resistors
I am working with the vinduino scheme as we work the conclusion with a higher resistance would be more accurate the measure of the resistance of the sensor, but I do not know if it was the reverse I am not sure if the code is the same compared to the vinduino. what I am looking for is precision that the resistance changes are not so great in the measurements
Im not so sure but my guess is that different sampling resistors give extended measurement accuracy at different sensor ranges. Like, if you want precision in the 0-1000 Ohm, or if you want precission in the 100K-500K...it would imply different sample resistors (again, my guess)
I saw that Mr Reiner propossed a 4K7 resistor and I stuck to it. To me it's reading well.
Have you tried reading fixed resistors? You should have a good
1)Accuracy (read a value that's close to the marked value in the resistor)
2)Repeatability (sucessive readings show a similar value)
If that works well, the reading process (hardware and software) should be valid. Then you would work with the Kpa formula
hello,i'm suhaila, new member in this forum.. I had some problem with the circuit that i had made. the circuit was originally from the 200SS.. So, my problem is i dont know how to put the temperature probe on the breaboard.. can anyone explain.. thank you..
Hi,
I'm using the same sensor with arduino "mkr 1300 wan" but without success.
I use a simple voltage divider like this:

Z2 is my 22k resistor and Z1 is my watermark sensor.
So:
void setup() {
Serial.begin(9600);
}
void loop() {
float v_in = 3.26;
float pin_scale = 1023.0;
float res = 22000.0;
digitalWrite(6, HIGH); //MY POWER PIN
digitalWrite(7, LOW); //MY GND
delay(1000);
float val = analogRead(A6);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
float v_out = val*(v_in/pin_scale);
float rwm = res*((v_in-v_out)/v_out);
float cb=0.0;
float soil_temperature = 22.0;
if (rwm > 0 && rwm <= 1000) {
cb = 20 * ((rwm / 1000) * (1 + 0.018 * (soil_temperature - 24)) - 0.55);
} else if (rwm > 1000 && rwm <= 8000) {
cb = -((-3.213 * (rwm / 1000) - 4.093) / (1 - 0.009733 * (rwm / 1000) - 0.01205 * soil_temperature));
} else if (rwm > 8000) {
cb = -(-2.246 - (5.239 * (rwm / 1000) * (1 + 0.018 * (soil_temperature - 24))) - 0.06756 * pow((rwm / 1000), 2) * pow((1 + 0.018 * (soil_temperature - 24)), 2));
} else {
cb = 0;
}
Serial.print("val : "); Serial.println(val);
Serial.print("v_out: "); Serial.println(v_out);
Serial.print("rwm : "); Serial.println(rwm);
Serial.print("cb : "); Serial.println(cb);
Serial.print("% : "); Serial.println(map(cb, 0, 200, 100, 0));
Serial.println("");
}
RESULT:
val : 753.00
v_out: 2.40
rwm : 7888.45
cb : 44.73
% : 78
val : 620.00
v_out: 1.98
rwm : 14300.00
cb : 87.31
% : 57
val : 721.00
v_out: 2.30
rwm : 9214.98
cb : 54.12
% : 73
The oficial page:
".... Note that a fully wet sensor measures 550 Ohms... " < but this is false.
CB 0 => VERY WET
CB 200 => VERY DRY
Calibration table:
CB Ohms
0 550
1 600
2 650
3 700
4 750
5 800
6 850
7 900
8 950
9 1000
10 1100
11 1280
12 1460
13 1640
14 1820
15 2000
16 2200
17 2400
18 2600
19 2800
20 3000
21 3200
22 3400
23 3600
24 3800
25 4000
26 4200
27 4400
28 4600
29 4800
30 5000
31 5200
32 5400
33 5600
34 5800
35 6000
36 6160
37 6320
38 6480
39 6640
40 6800
41 6960
42 7120
43 7280
44 7440
45 7600
46 7760
47 7920
48 8080
49 8240
50 8400
51 8560
52 8720
53 8880
54 9040
55 9200
56 9350
57 9500
58 9650
59 9800
60 9950
61 10100
62 10250
63 10400
64 10550
65 10700
66 10850
67 11000
68 11150
69 11300
70 11450
71 11600
72 11750
73 11900
74 12050
75 12200
76 12335
77 12470
78 12605
79 12740
80 12875
81 13010
82 13145
83 13280
84 13415
85 13550
86 13685
87 13820
88 13955
89 14090
90 14225
91 14360
92 14495
93 14630
94 14765
95 14900
96 15035
97 15170
98 15305
99 15440
100 15575
101 15700
102 15825
103 15950
104 16075
105 16200
106 16325
107 16450
108 16575
109 16700
110 16825
111 16950
112 17075
113 17200
114 17325
115 17450
116 17575
117 17700
118 17825
119 17950
120 18075
121 18200
122 18325
123 18450
124 18575
125 18700
126 18825
127 18950
128 19075
129 19200
130 19325
131 19450
132 19575
133 19700
134 19825
135 19950
136 20075
137 20200
138 20325
139 20450
140 20575
141 20700
142 20825
143 20950
144 21075
145 21200
146 21325
147 21450
148 21575
149 21700
150 21825
151 21950
152 22075
153 22200
154 22325
155 22450
156 22575
157 22700
158 22825
159 22950
160 23075
161 23200
162 23325
163 23450
164 23575
165 23700
166 23825
167 23950
168 24075
169 24200
170 24325
171 24450
172 24575
173 24700
174 24825
175 24950
176 25075
177 25200
178 25325
179 25450
180 25575
181 25700
182 25825
183 25950
184 26075
185 26200
186 26325
187 26450
188 26575
189 26700
190 26825
191 26950
192 27075
193 27200
194 27325
195 27450
196 27575
197 27770
198 27825
199 27950
MY sensor is underwater, my resistence must be close to 550 ...but is wrong.
By table:
48 8080
49 8240
50 8400
51 8560
52 8720
53 8880
My case:
rwm : 8128.52
cb : 47.45
It's very close... but is underwater (100% water) and 47cb is close to 77% of water instead of 100%
1 second measuring the resistance is probably too long. Your measured resistance drifts pretty quickly if you keep the power to the sensor more than a few milliseconds. You can use a normal multimeter to measure resistance and you will see how quickly it starts to drift away
Also there's a better method posted somewhere that alternates measurements in opposite polarities, and calculates the average of them all, thus minimizing the possible effect of electrolysis and temporary erractic readings
Also your Vin voltage should be actually measured in real time by an analog pin instead of being pre-programmed
BTW I've never got 550 for a totally wet sensor but values closer to 350-370 ohms in most sensors