Measure how wet the soil is, and switch a small pump on through a relay to water a plant in short bursts, with limits that cap how much it can water.
Free. Make an account and you come straight back to start it.
The capacitive sensor reads the soil, and your sketch turns it into 0–100 % using your own dry and wet readings.
Look at the sensor. The long flat part goes into the soil. Above the white line are the chip and the connector, which must never get wet.
Check: You can point to the line.
raw 412 moisture 41 %