Soil Sensor readings are not working properly


today I tried to calibrate my soil sensor:

Glass of water: 896
Not immersed in soil: 241

Any now I grabbed some very very dry soil and repeated the readings including going up on the z axis and
into the same spot again. What I read was quite frustrating, these were values from 644 to 772, so a great measurement error range. This tool is not usable like this.

Did anyone make any other tests / calibrations?
Is anyone using it anyways?

Thanks, Best Regards!

@rory or @Gabriel: Did you ever use that tool to water based on the readings?

I am not sure if you have something like the Sparkfun sensor, but if you do, read this:

Down a bit in the doc is a section on callibration…

Hey @Intelbotfarmer thanks for the link, but I know how to calibrate.

I have written above that the thingi is outputting to much varying values when I try to calibrate it and I would like to know if someone is using it. As no one is answering even not FB personnel, I guess that is the truth… would be horribly sad though…

Sorry for being too basic, but after reading that portion of the link, it became apparent that calibrating these can be tricky and i thought it was good info for all folks.
Having said that…
How many volts are you feeding the sensor? It looks like there can be a lot of variance at different voltages (3 vs. 5)
Also, the device is pretty cheep (~$5), maybe buy another just to rule out a bad parts. And if you have had it running with power constantly, that sounds like it can shorten the lifespan.
A quote from the Sparkfun page on the devices says “One commonly known issue with soil moisture senors is their short lifespan when exposed to a moist environment…” So, just keep it away from moisture… :slight_smile:

By the way, I think the FB folks might be swamped, as I think they are on the eve of the XL shipments.

But this variance you would only notice if you change the supply voltage. I keep it constant and only trigger multiple readings which are different each time…

@Gabriel @roryaronson do you productively use the soil sensor? Could you explain my variances?

1 Like

As with all sensors, there will be variance between readings. Variances could come from a variety of places such as:

  • Variances in the soil (water content, temperature, soil composition)
  • Variances in the environment (humidity)
  • Variances in the test method (depth inserted into the soil, time the sensor is left in the soil, contact between the soil and the sensor [which will change every time the sensor is moved any distance in any direction], etc)
  • Variances in the sensor itself/hardware (sensor degradation/corrosion over time, manufacturing differences, build-up of soil on the sensor, supply voltage, resistance in the output signal line, connection between the UTM and the tool etc)

Your soil sensor sounds like it is working properly (high values when submerged in water, low values when in the air, and readings in-between when in soil).

Because the Arduino will output an analog reading between 0 and 1023, perhaps you are expecting the range of values between measurements to be within a few whole numbers. For example: 542, 546, 543. This is an unrealistic expectation due to all the possible variances.

Instead, dividing the output by 100 and rounding to the nearest whole number provides a more realistic interpretation of the data. This would have given you outputs of 9 in water, 2 in air, and 6 to 7 in your soil.

Hopefully that sheds some light on what you can expect from the sensor. Oh, it is also important to keep in mind that the sensor included in the kits is an inexpensive hobby sensor. There are of course much more expensive sensors and testing equipment that could provide more consistency and accuracy.

Yes I do agree rory, but I am talking of totally different values than you!

Considering those two posts @roryaronson, I have a variation of (772-644)= 128 from one measurement to the other without changing anything but retracting, inserting it to the same depth and measuring again. If we consider something from 644 (0%) dry to 896 (100%) total wet this measurement error is (896-644)=252 ; 252/128 = 51%?!?!?

Yes is it inexpensive but totally unusable in this implementation, so what is it good for?!

I would say it is good for:

  1. allowing FB dev team to add a very inexpensive moisture sensor to the FB, even if it is sub-par
    a) This allowed the development of the mechanisms to get soil moisture data
    b) It gives the open-source maker community the option to develop better tools (at a bit higher cost) without having to design in all the supporting infrastructure. Just swap out the cheap one and put your own in.
    c) I think, looking at all the data, that even the cheap one can be calibrated to 3 levels, “dry”, “moist” and “wet” or even just two, “dry” and "wet"
    Just my 2 cents.

Also, you can greater range if you feed it 5v instead of 3.
Maybe try that and see if it helps

The question is really wether these totally different values (as I wrote 50% off!) are due to different resistances on the UTM or rather because of the shitty sensor. The problem of the UTM is, that the resistance of the electrical connection is depending on so much (moisture, contact at exactly that “fit”) that it is questionable if it really can be used for analog data. For digital for sure…

This will only increase the range of the output but also the offset due to the same problems…

This can make a big difference in measurements because the soil sensor will likely leave a hole in the soil after being inserted the first time. Thus, subsequent insertions will result in completely different contact with the soil and therefore different readings. You can imagine if you inserted/retracted in the same location over and over, eventually the sensor would push away all the soil and no longer contact it at all.

If you’re looking to take multiple measurements in the same location within a short time period, have your FarmBot keep the soil sensor in place with a Wait command and then take the next reading. Or, vary the exact location the sensor is inserted by about a centimeter so that you have more consistency in the amount of soil contact created during subsequent insertions.

1 Like

Hey rory, thanks for the reply! I am currently looking into a capacitive soil sensor with a nodemcu and openhab, but maybe I´ll try on the weekend again. It was just so frustrating that I did not want to spent more time on this soil sensor… do you productively use it on your own?!

I have the same problem, but my value range is even bigger…
I measure at the same location with several measurements within 5 min values between 400 and 750.
With these ranges I can never find out if the soil needs to be watered or not :frowning:
Is there any update on this topic, e.g. a better sensor that could be used?


1 Like

@roryaronson any suggestion?

@mbuchberger1967 are you having your FarmBot stay in the position with the soil sensor inserted for each measurement, or are you having it retract the sensor and then come back and insert in the same location 5 minutes later for the second reading?

Due to your conditions, you may need to lower your mentally calculated precision of the sensor. Instead of dividing by 100 and rounding to a whole number (for a result between ~2 and ~9), it may be more true-to-life to divide by 200 and round to a whole number (for a result between ~1 and ~4) with one being very dry/not in soil, 2 being dry, 3 being moist, and 4 being very wet.

I’ve been looking into capacitive soil sensors as well as, which we’ll probably develop for future versions of Genesis. As always, stay tuned! Things around here are always getting better :slight_smile:

Hi guys,

I have never had the soil sensor work correctly. I have had the sensor connected and in the soil. Check the value 5 times in a minute and it ranges across the full range of analog values.

I also hooked up an arduino to the analog pins on the farmbot board and fed it varying values. They did not correspond with the values that came up on the web app in any way. They bounced all over the place despite going straight to the pin. I also tried it connected to a range of different pins just in case the pin map was incorrect but it wasn’t.

Any suggestions?


Is it a problem with the software?

Sounds like something I’d like to investigate :slight_smile:

As I don’t yet have a full bot ( only a Raspberry Pi cabled to a Farmduino v1.4 )

  • "the farmbot board" ? ( the Raspberry Pi . . or the Farmduino . . or ? )
  • which pin numbers were tried on that board ? ( ? pics ? )
1 Like

Hi john,

Hooked it up to the farmduino 1.4.

Pics are on this thread. Tried pretty much all the analog pins there.

I’m no electronics expert but I’m pretty sure I hooked it up correctly. I had an output from an analog pin on the arduino, increasing in value every 30 seconds. The sketch worked correctly with an LED so I know it was working as planned. Values bounced all over the place.


1 Like

@markgregory8, thanks.

The Genesis Pinout References seem to say that one should refer to A1 input as pin 1 ( Analogue ) in the WebApp . . what do you think ?

Getting a bit late for me here now but will test this more tomorrow :expressionless: