I have a recurring problem of forgetting to water my ficus until the soil is so dry the plant separates from the pot. My ficus deserves better, and better it shall get.

Luckily I had the following parts in a drawer:

Since the soil sensor is so simple, plan is to solder up the power, ground, and an analog output. 5-10 minutes later it’s all hooked up.

Arduino Nano board close up with power light in green and built in LED lit up orange to show when soil is dry

I’ll note a bit of bad soldering in the image above. And old use of this Nano had a small bit of metal and solder that I was unable to desolder or wick up. The orange light is lit up to show what it looks like when the ficus needs watering.

Here’s the script in its entirety here.

const int AIR_VALUE = 700;
const int WATER_VALUE = 350;
const int LOW_MOISTURE_CUTOFF = 15;

int soil_moisture_value = 0;
int soil_moisture_percent = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  soil_moisture_value = analogRead(A0);
  soil_moisture_percent = map(soil_moisture_value, AIR_VALUE, WATER_VALUE, 0, 100);

  Serial.println(soil_moisture_value);
  Serial.print(soil_moisture_percent);
  Serial.println("%");

  if (soil_moisture_percent < LOW_MOISTURE_CUTOFF)
  {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
    digitalWrite(LED_BUILTIN, LOW);
  }

  delay(2000);
}

And lastly, an image of the ficus, finally able to let me know if it needs water.

Low angle photo of my ficus on a desk with wires and circuit boards around demonstrating how the Arduino Nano is wired to the soil sensor in the green ceramic pot