3
\$\begingroup\$

I'm not sure what happened but all of a suden the moisture sensor I bought is acting strange. When I place it in soil and measure the value once per second, it decreases in value pretty quickly about 3 points downwards every 5 seconds.

When I am holding the sensor in the air, it reads 1023. When I put it in water, it reads around 400. When I place it in soil, it starts at about 700 and then starts decreasing, meaning it is getting wetter. How can that be possible if I didn't water the soil? Something is happening with it.

EDIT: Upon just jiggling the wires that connect the moisture sensor to the arduino...the values jumped down about 50 points. Jiggling more makes it jump around more. Is that normal?

\$\endgroup\$
8
  • \$\begingroup\$ Well, a review said that theirs got corroded. \$\endgroup\$ – Passerby Nov 15 '13 at 8:53
  • \$\begingroup\$ First we have to figure out hot it is working. Do you have any clue on that? resistivity? \$\endgroup\$ – Blup1980 Nov 15 '13 at 10:21
  • \$\begingroup\$ Your description doesn't indicate if the sensor reading eventually stabilize. Does the trend of going down about 3 points every 5 seconds eventually come to a fixed reading? \$\endgroup\$ – mikeY Nov 15 '13 at 16:40
  • \$\begingroup\$ @Passerby I doubt mine is corroded since I received it only a few days ago and just started using it. \$\endgroup\$ – Matthew Berman Nov 15 '13 at 17:03
  • \$\begingroup\$ @mikeyY yes, it does seem to stabilize but only after 8 minutes or so. It just seems very inaccurate. Even when it stabilizes is fluctuates 10 points in either direction. \$\endgroup\$ – Matthew Berman Nov 15 '13 at 17:04
3
\$\begingroup\$

That active aspect of that sensor looks like plain-old HASL (hot-air solder leveled) FR4 PCB.

enter image description here

Basically, that construction is pretty much never going to be that reliable. Aside from the fact that the FR4 material itself will absorb water and change it's internal leakage, you're going to have all sorts of fun electrochemical corrosion issues with the electrode surfaces, particularly if you leave the sensor powered.

Basically, that sensor works by measuring the resistance between the two "pins" of the PCB stake.
It does this by applying a voltage across the pins, and measuring the current flow.

However, this is also going to lead to the metal from one of the pins being eaten away by galvanic action.

Basically, that sensor is a toy. It's not useful in any real application.


If you want to squeeze as much life out of the thing as possible, there are a few things you can do.

  1. DO NOT leave the sensor powered. When you want to take a reading, power the sensor for maybe a few seconds, and take your readings. Then power it off again. Don't take readings too often.
  2. Periodically reverse the pins of the electrical connection between the readout board and the "stake" board. Since only one terminal will be eaten away at a time, this should spread the decay out a bit.
  3. Be aware that ANY mechanical disturbance of the "stake" board will probably cause a large shift in readout value. Your "jiggling the wires" causing a shift in values probably came from the mechanical force transmitted to the PCB through the wiring.

Proper systems for this sort of thing use a AC bias on the sensor, which minimizes galvanic corrosion, but there aren't any easy ways to hack something like that in to this device.

Real soil moisture sensors are capacitive, and therefore immune to the corrosion issue, but that much more complex and expensive.

\$\endgroup\$
1
  • \$\begingroup\$ Wow, this is a great answer. Two questions: 1) Is the 2 galvanized nail technique more accurate/longer lasting? 2) What's the next step up for getting something more accurate? Can you point me to a link that will have a decent soil moisture sensor for sale? \$\endgroup\$ – Matthew Berman Nov 16 '13 at 3:02
1
\$\begingroup\$

A decreasing value doesn't necessarily mean "wetter". It means that the voltage that is measured by the processor is getting lower.

I infer from the rest of your question that this is a resistive sensor, so there is a fixed resistance connected to a positive voltage at one end and the other end is connected to one of the probes. The other probe is connected to 0V. The processor measures the voltage at the junction. This is a potential (or voltage) divider.

So, the intention is that more water means less resistance, means less voltage, and a fall in the reading of the ADC of the processor.

However, there could be other effects happening. For example the voltage that is present between the two probes could be changing something chemically within the soil or on the surface of the probe to make it gradually more conductive.

\$\endgroup\$
3
  • \$\begingroup\$ I suppose that is possible but I would have thought that a probe specifically for soil moisture would have accounted for that. \$\endgroup\$ – Matthew Berman Nov 15 '13 at 17:05
  • \$\begingroup\$ Now it seems to be increasing slowly, constantly. This is very frustrating because I'm trying to get an accurate reading. \$\endgroup\$ – Matthew Berman Nov 16 '13 at 2:42
  • \$\begingroup\$ I'd imagine it is a really simplistic probe, for which you'll have to do quite a lot of work to make it correspond with what you actually want to measure. Sorry! \$\endgroup\$ – Martin Thompson Nov 17 '13 at 15:38
0
\$\begingroup\$

How often are you reading from the sensor? I have had a similar problem before, except with a temperature sensor. What helped me, was adding a bigger delay between reading from the analog pin. This way, the sensor ha more time to update it's reading, and you should start getting much more stable values.

Otherwise, Its a long shot, but make sure that your arduino is getting the required voltage. The analog value is of course relative to the arduino's ref voltage, so if that is dropping lower then 5 volts, then your reading will also start slowly dropping.

\$\endgroup\$
1
  • \$\begingroup\$ I have to assume my arduino is getting the required voltage. I plugged it into my USB on my computer like normal. \$\endgroup\$ – Matthew Berman Nov 16 '13 at 1:32
0
\$\begingroup\$

From what I can come up with, one possible reason would be the corrosion of the sensor. Because it is so cheap, there isn't a guarantee that it will last very long. From reading some of the customer reviews on amazon, one person said that their's oxidized within a week... obviously not ideal. If you are looking for a different sensor, I've used this soil moisture sensor for 3 years and it hasn't corroded yet. Although it was a little more expensive, I have been pretty satisfied with it's reliability. Hope this helps!

\$\endgroup\$

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.