Soil probe won't give 1023 range of resistance values

Hey there,

I'm a noob. I've been making a pot-plant watering alarm which operates on soil resistance.

Thing is, when I make the basic potentiometer project and use the pot as a source of resistance, I get the full 1023 values out of the analog pin. As soon as I swap to my probe on the same inputs, something goes wrong. Values that should be 1023 never get above 450 and more likely hover around 350.

The probe itself is pretty simple - one wire to ground and another to A0. The ends are stuck in the ground a certain depth and distance apart (still figuring that out - was thinking of using a 1/4" TS plug for that).

I tried replacing my probe with the little leads that come with the arduino. No change. But the same code works with a pot.

What am I missing here?


You are not getting the full 1023 reading because the resistance of the soil will cause a voltage drop.
The lower the soil resistance, the lower the voltage drop and the higher the ADC reading will be.

BTW, don't you mean one probe goes to supply (not ground) and the other to A0?

I just tried setting it up the same as the Photoresistor project and got joy.

I assume the resistor is there to limit the current that comes in to the AO Pin when resistance is low? maybe?



If you mean down to ground then it acts not only as a voltage divider, but also "discharges" the voltage on the A0 pin as both the probes and the ADC inputs are high impedance.

You should have two conductors in the soil, and the soil between them acts as a very high resistance. One of the conductors should be connected to a resistance that is roughly similar to the expected resistance between the probe conductors. The two resistances in series give you a voltage divider. One end should be connected to logic HIGH and the other to logic LOW, and it doesn't particularly matter which is which. The mid point of the divider then connects to the analog input. The value here enables you to calculate the ratio of the two resistors in the voltage divider and since you know the value of the resistor, you can calculate the resistance across the probe.

As long as you have the probe connected like this you ought to get an analog input reading that varies as the soil conductivity varies. The normal range of values you would expect to see would only be a small subset of the whole range 0 .. 1023 but if the probe was open circuited or short circuited then you would expect to see the extreme values.