Capacitive Soil Moisture Sensor v1.2 inconsistent

Hi everyone,

I have tried so many tutorials and versions of using a capacitive soil moisture sensor v1.2 but I do not get accurate and consistent results. The code seems simple as it uses analogRead() which I understand. I also know how to map the values so calibration is not the issue for me. I think it might be converting the signal back from the sensor or supplying the sensor with the correct type of current i.e. battery powered. Perhaps a converter may be the best solution? Can anyone please direct me into a tutorial that works and that will guide me to have accurate results?

I have multiple microcontrollers to play around with such as:
Arduino Uno, Arduino Nano, Arduino Duo, Arduino Mega, Esp32, Esp8266 12e, Esp8266-01...

I have about 10 of these Capacitive Soil Moisture Sensors v1.2

Eventually I would like to be able to have each have a reading from different locations in my house and send it via MQTT to my server. The server and MQTT is already running and functional, I just need guidance in getting the soil moisture sensor to give accurate readings.

It would be beneficial if I could get the sensors to be powered by a battery and using the esp8266-01 as it is small, compact and energy-efficient, but I'm willing to give all of my boards a go until I get stable results.

Thank you,
Jason

I will take a SWAG and say you have problems with the 5V either wrong voltage or electrical noise. I could not find the schematic for this sensor but similar devices do not have any real control over the voltages it uses internal. Start with the Arduino, they have a stable 5V if not being powered via the USB but by Vin with 8 to 12V. The reason for this is the onboard regulator does a good job and is properly decoupled for a stable output. Let us know how you do!

I power the sensor straight from a digital pin of a 3.3 v / 8 mhz Pro Mini. Set pin high, give the sensor 200ms to „warm up“, take readings, set pin low. I average 3 readings using a for-loop. Results are very stable.

Neither does anyone else on this forum. Measuring soil moisture is quite popular and seems like a simple project, but it is not simple. In addition, the dozens of sensors on the hobby market are mostly worthless, tend to corrode quickly, and worse, usually give misleading results.

Edit: one forum member reports positive results with a soil moisture sensor. See below.

The ONLY way to get accurate moisture content of arbitrary soil samples is to weigh the soil, bake out the moisture, and weigh it again.

1 Like

Your link to Amazon is not much help, where does it tell you it will run on 3.3V similar looking ones I found needed 5V. jremington is correct, what tolerance are you wanting/expecting and what sensor will give you that?

With all due respect sir: Electrode based sensors do corrode; capacitive sensors which the OP refers to do not (at least not quickly). Cover the electronics with two layers of clear nail polish and you'r good to go.

Image shows soil moisture over 2-week period (sent to iPad using Blynk). You can tell where it rained - smaller bumps - and where I watered - steep increases. Data is stable, sensor been running outside for months.

Fwiw: Sensor is battery driven and sleeps 3 hrs between reads. Use Pro Mini with RF transmitter to send data to base – low energy needs. Green line up top is battery level. Blue line is RF amplification level needed to reach base (Wemos D1). From base wifi->Blynk->iPad. Does what it should.

1 Like

And how, exactly, did you verify that the readings mean anything useful, other than that the soil is drying up? No one needs a sensor to know that soil dries.

Sir: I have a roof terrace with plants. Sometimes it rains. Sometimes it doesnt. Sometimes I need to water. Sometimes I don‘t. Maybe nobody needs a soil moisture sensor. Mine tells me when my plants need watering. So I kinda like it for that.

1 Like

I'm glad you are happy! You seem to be a rather unique contributor on this particular forum topic, so I've edited my post to reflect that.

1 Like