Automatic Plant Watering Based on Soil Moisture Sensor and PID Control
DOI:
https://doi.org/10.54327/set2027/v7.i1.373Keywords:
automatic watering, soil moisture, PID control, ON/OFF control, Arduino, Tinkercad, ScilabAbstract
This study presents the design and simulation of an automatic plant watering system based on a soil moisture sensor and Proportional-Integral-Derivative (PID) control, implemented on an Arduino Uno in the Tinkercad circuit simulator and analysed numerically in Scilab. The objective is to provide a documented and reproducible software-in-the-loop baseline for closed-loop soil moisture regulation. The simulated plant couples a first-order direct current (DC) pump/motor model with a first-order soil water-balance model that includes irrigation input, evaporation, and drainage; the PID output is converted into an 8-bit duty-cycle command, which the Arduino firmware realises by relay ON/OFF switching and the Scilab model applies as a continuous average pump drive. With the baseline gains Kp = 5.0, Ki = 0.8, and Kd = 0.1, the response from 30% to a 60% setpoint reached 90% of the step in 4.13 s, peaked at 77.43% (an overshoot of 29.06% of the setpoint), settled within ±2% after 42.83 s, and ended 0.10 percentage points from the setpoint at 60 s. In three further scenarios (20% to 50%, 40% to 70%, and a ±1% sinusoidal sensor disturbance), the overshoot ranged from 24.21% to 35.95% and the settling time from 39.73 s to 46.95 s. Under identical model conditions, a hysteresis ON/OFF controller overshot by 38.40% and sustained a limit cycle between 58.90% and 67.48%; PID reduced the overshoot by 24.3% and the integral absolute error by 20.6% and removed the persistent offset, at the cost of a 13.2% longer rise time. A gain-sensitivity analysis showed that the overshoot is caused mainly by integral action and can be eliminated with a smaller integral gain. All results are obtained from simulation without hardware validation.
Downloads
Downloads
Published
Issue
Section
Categories
License
Copyright (c) 2026 Widyasmoro Widyasmoro, Iswanto Bin Suwarno, Sulistyo Nugroho, Nia Maharani Raharja, Muhammad Hafid Alkarim

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website, social networking sites, etc).

