Simple soil moisture sensor enhanced

Dear all,

I’m currently using this simple soil moisture sensor (see attachment 1)

1.png.

But since vases are really big, the value differs from top/bottom, center or edge.
For this reason I was thinking about having 1 or 2 additional sensors per vase and than calculate the average. Unfortunately this implies using several analog pins (I have already increased the number using two additional MCP3008).
I was thinking, would it be possible to do a connection like this (see attachment 2).

2.png

By “multiplying” the single sensor, doing one reading, the resulting value should be the highest of all the three…

Does this make any sense?
Any additional suggestions please?

Thank you,
dk

yes very well possible.
You should not place 5V continuously on every pin, but connect them to a digital(output) pin of the arduino.

Then you get a loop like this

moistMin = 1024;
moistMax = 0;
avg = 0;
for (int p=0; p<pinCount; p++)
{
  digitalWrite(pin[p], HIGH);
  val[p] = analogRead(A0);
  moistMin = min(moistMin, val[p]);
  moistMax = max(moistMax, val[p]);
  avg += val[p];
  digitalWrite(pin[p], LOW);
}
Serial.print(moistMin);
Serial.print("\t");
Serial.print(avg/pinCOunt);
Serial.print("\t");
Serial.println(moistMax);

Thank you robtillaart for your reply.

Yes, actually I’m already using one digital pin which I turn on and off and read the analog value of 3 different pins…

Ok, so this is the new alternative using your code (having 2 vases with three probe per vase):

3.png

I read three times analog 0 and each time I turn on/off one digital pin at time and than do the average of the readings.

What about this design instead:

4.png

I read once the analog value of 0 that should be the highest value of the three and there fore the most humid point of the vase.

What do you think?
Thank you,
dk

with design 2 you cannot discriminate which sensor you read.

design 1 uses digital 0 and 1 which are the Serial port, You should not do that unless you do not use Serial at all, not even for debugging.

Thank you Rob for the reply.

I will try both the designs and see the results (yes actually I put numbers of digital pin just picking the first three, you are right). I think that long wires to the sensors will have an effect on the result. Probably moistMin = 1024; should be reduced I guess that connecting the wires together I will have a lower value than 1024.

Thank you, dk

I prefer a capacitive sensor to measure the moisture.

When the soil resistance is measured, at least use an alternating current. With the 10k resistor to ground, it could be influenced by metals oxide and salt or salt crystals around the nails or pins. I would also protect the input of the Arduino with a resistor and perhaps clamping diodes.

When you have some good results with the schematics above, try connecting the 10k to an output of the Arduino, and measure the resistance in both ways, with that output pin to HIGH and LOW.

Normal size nails will be too small to measure the moisture near the surface. Or do you use one of those circuit board 'forks' ? (there are many on Ebay). It is also possible to use two strips of conductive rubber.