However, I have an issue with them: Some of them get stuck on a wet value over time, even if the soil is very dry. Wiggling on them or removing and putting them out and in causes the value to jump by a huge marging from a wet to a dry state. So there is definitely no water inside the PCB or sensor. Since the soil around the sensor is completely dry, I doubt that there is a pocket of moisture or condensation around the sensor.
Any idead what could cause this behaviour?
Accumulation of crud to the surface of the sensor, in particular anything that's conductive. Salts, basically. You could try periodically retracting the sensors, cleaning them and re-inserting them, preferably not in the exact same hole.
Such are the woes of using simple/cheap soil moisture sensors. There's not a whole lot you can do about this.
Not really; I'd look at e.g. commercial agricultural or geophysics systems and see how they solve the problem. I assume they use sensors made out of more sturdy probes, spaced wider apart (e.g. several centimeters/inches) and then rely in some form of resistance measurement. It's conceptually similar to what you have now, but due to the larger distance between the probes, the impact of accumulation of crud to the probes will probably be a little lower.
The material of the probes will also be selected more carefully in commercial systems. An entry-level option would be stainless steel. The probes you have now are basically just copper, which will corrode and form copper salts that spread out in the direct vicinity of the sensor, affecting its electrical properties.
With the sensors you have now, you could try something with a retractable probe that is inserted into the soil only whenever a measurement is taken and is then pulled out across a cleaning pad, and replace the probe periodically.
An alternative approach would be some kind of indirect measurement that doesn't rely on physical contact of a probe with the actual soil, but you'd have to hit the books to take stock of sensing concepts that would answer to your requirements.
Overall the easiest way to make something robust in my view would be to make a sensor frontend yourself with stainless steel probes, a constant current source and an amplifier. It's a nice project for a couple of rainy Sundays. If you're new to electrical engineering, make that a couple of rainy weeks/months.
So I might have made a little breakthrough concerning the issue.
I have put sensors in various soil types and watched the issue, testing specifically for salts and other dirt. The issue also happens if there are no salts or anything in the soil, like coco soil.
But what I have noticed is, that although the soil is already fully dry, when pulling out the sensor it is still a little wet/moist.
Weirdly, if I pull the sensor out, it instantly goes to almost zero moisture and when I dampen it with a spray bottle, it only reacts a little to it.
However I though, maybe the sensor traps the moisture and experimented with a cotton cloth and a teabag put tightly around the sensor. So that way, the moisture cannot stuck to the surface that easily and gets soaked away into the soil better.
I tested it with 4 sensors: 2 normally and two inside teabags. The results were pretty impressive. Starting with fully wet soil both showed 100% moisture, but over the next days the teabag went down WAY faster in moisture measurment. Today, they show 30% moisture while the other ones still show 90% although the soil is only little damp. Pulling all of them out it shows 0% moisture, putting them back in brings the teabag ones back to 30% and the other ones to 30% too. Amazing.
OK, sounds nice. To be honest, I'm afraid there are fundamental flaws with this sensor setup that prevent it from working well in the long term, but if the teabags make a difference, by all means go for it. My prediction is that the teabag approach will also fail, although it may take a little longer than without them.
What is the reason that you are no fond of the sensor type?
There are many sensor types and the capacitive types are recommended the most, in particular when dealing with vegetables for food
Yes, pretty much. I already have 50 or something sealed sensors, mostly doing batches of 10 at once. I want to build a little ESP32 based automatic vegetable groth project with them but have issues mainly with the sensors that get "stuck" with their values and the ESP32 sometimes doesnt go do deepsleep / waking up after a couple of weeks.
My workflow for the sealing is:
Sealed the edges with a small brush and epoxy, let it dry 24h
Calibration: Measure the sensor values fully dry and fully wet, putting the numbers on the back of the sensor
Unsolder the connector
Solder cables to it
Put on headshrink, shrink only the bottom. Put a little bit of epoxy in it to seal the heatshrink (filling it more often caused leaks, so epoxy was running down the sensor), let it dry
Sealed the edges again and filled the heatshrink half way with epoxy, then shrinked it completely so the epoxy covers all electronics, let it dry 24 hours
You've quite eloquently explained that yourself in #11 by going over some of the measures needed to make these sensors perform reliably in the short term. In the long term, I don't feel what you're doing will actually make them work in a real-world plant-growth environment. It may be sufficient for potted plants in your living room or some other relatively dry and clean environment (although even there, the sensors will likely physically degrade to the point of becoming inoperable within a few months), but not an actual horticultural environment.
Mind you, maybe it's all totally acceptable given the low cost of these sensors. If you consider them as a consumable that needs to be replaced every few months anyway. But then the whole preparation/calibration procedure sounds rather tedious.
Note the operating frequency. 1.5MHz......
It is a "basic" TLC555 circuit, the capacitance, not just of the sensors but the PCB tracks and anything placed above or below the circuit can influence the output.
Including CONDENSATION, CORROSION.
So when you seal it up, I would make sure it is 100% DRY.
Any instability in the operating frequency will cause output anomalies.
A great, lets have fun and try it out product.
A lousy, lets get more than a couple of days accurate performance out of it, its not designed for that purpose.
If it was it would come already hermetically sealed.
Sorry.. Tom..
PS. Yes I do have some of those sensors, for fun...
As soon as I remove the sensor from the soil, even those who are in wet soil for months now, it instantly jumps to a low moisture value (0-5%) as it would have never been in water. I doubt that moisture that entered the sensor causes the sensor to get stuck over time, since that moisture would not come out in the second I remove the sensor from the soil. It was my speculation too though, which was the reason I changed the sealing process to sealing the edges twice.
Right now I have the feeling that it is condensation that gets stuck to the surface and not the inside of the PCB, but of course I can be wrong.
The sealing of the the electronics on top of the sensor does not really change the values of the sensor. If I connect the sensor of the picture of post #11 right now, I do still get the same values. I wanted to have the calibration data sealed in so I can compare it every couple of months.
I would still like to understand what causes the accuracy to go down.
I doubt that it is salts or crud since even with coco soil that has been cleaned, it happens.
I also doubt that it is moisture going into the sensor since it jumps back to 0 as soon as it is removed from the soil.
Furthermore I also doubt it is caused by the electronics becoming unreliable because I have tested various measurment intervals between every 5 minutes to every 12 hours over 2 months, while the electricity to the sensor gets cut off by a mosfet between the measurments. Both having the same results.
My current opinion is a moisture trap around the sensor that could be avoided by a water absorbing barrier that transfers the water to the soil surrounding it, but it will probably take a couple of more months to see if that helps.
It could be something totally different too though.
There could be several unknown issues that could cause it to act like that.
Bad solder joint on the cable to PCB.
Bad solder connections on the PCB during manufacturer.
Thermal stress on PCB caused a crack in component or trace.
Epoxy isn't flexible enough and is causing mechanical stress on PCB/components with temperature causing cracks.
Notice the very tiny trace near the edge of the board.
If that trace cracks it will cause the readings to get stuck
That is a poor PCB layout issue and I would expect some to have manufacturing defects.