José Moreira

Logging soil moisture on the bonsai bench

A capacitive sensor, an ESP32 and a chart that confirms I water too much.

Watering is the skill everyone says you learn by feel. I wanted numbers, so a cheap capacitive sensor went into the juniper pot.

const int SENSOR_PIN = 34;
const int DRY = 2800, WET = 1200;   // calibrated in air and in a glass of water

int moisturePercent() {
  int raw = analogRead(SENSOR_PIN);
  return constrain(map(raw, DRY, WET, 0, 100), 0, 100);
}
Soil moisture over two weeks (%)Soil moisture over two weeks (%)0%22%44%66%88%135791113JuniperOlive

What the chart says

  • The juniper dries in about four days in early summer.
  • The olive happily goes a full week.
  • I had been watering both every two days.

Placeholder post — data is illustrative.