Facing an issue with moisture sensor reading

Currently have an Arduino Uno R3 reading a basic Moisture sensor using the code

moisture = analogRead(A2);

And originally, we could see that value being output up as far as 1023, which lines up with any tutorials on the moisture sensors with Arduino. I need that to be output as moisture percentage, so using a standard formula and a map, I was able to get a fairly accurate reading of the moisture percentage. And all was well.

We tried it yesterday again, and noticed the percentage was off. From trouble shooting, I seen that the sensor is now only maxing out at 730, down from 1023 and that's throwing off the calculation for the percentage.

The other odd thing we noticed is when we unplug the USB connection from the board to the laptop and then plug it back in, 1023 briefly appears on the output before going back to maxing out at 730 again. This happens consistently.

Anyone ever faced an issue like this? Would it be an issue with the moisture sensor itself possibly? Can't understand why it's not going up as far as 1023 anymore. Any help appreciated

First thought is a possible power supply voltage issue?

Would there be any way to verify that? Nothing else seems out of the ordinary

1 Like

It is possible the sensor was damaged, try another to validate your system. But first thing measure the voltages, they are critical I do not have a clue as to what sensor you are using or what its specifications are. Posting that would help others help you. If there is more then the sensor connected post an annotated schematic showing all connections, power, ground, and power sources. It could also be a loose wire, fairly common with a pin board.

Did you try to thoroughly clean the sensor?

Please post a link to the moisture sensor product page.

If you search this forum, you will find many complaints about soil moisture sensors, such as corrosion, erratic readings, short lifetime, etc.

Many people conclude that moisture sensors on the hobby market are not worth the trouble.

If voltage at the Uno’s and sensor’s +V pins remain steady under all conditions then I think that should rule that first guess out.

But could you describe the application? The only moisture sensors I’ve ever used have been ‘damp detectors’, consisting of blotting paper placed under potential household leak/flood locations. All used basic circuitry, no Arduino, to detect when a resistance went from >20M ohms to say <100K and have worked reliably for decades. But if your app is soil-related that’s another, er, can of worms.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.