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?
Best Answer
That active aspect of that sensor looks like plain-old HASL (hot-air solder leveled) FR4 PCB.
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.
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.