Automatic Plant Watering Based on Soil Moisture Sensor and PID Control
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.
Authors
- Iswanto Suwarno (ORCID: https://orcid.org/0000-0001-8459-3920)
- Nia Maharani Raharja (ORCID: https://orcid.org/0000-0002-0786-9409)
- Widyasmoro Widyasmoro (ORCID: https://orcid.org/0009-0000-0762-1975)
- Muhammad Hafid Alkarim (ORCID: https://orcid.org/0009-0007-4279-6392)
- Sulistyo Nugroho (ORCID: https://orcid.org/0009-0002-4771-0379)
Institutions
- Sunan Kalijaga State Islamic University Yogyakarta (ID)
- Muhammadiyah University of Yogyakarta (ID)
- University of Sarjanawiyata Tamansiswa (ID)
Publication Details
- Journal
- Science Engineering and Technology
- Published
- 2026-11-13
- DOI
- https://doi.org/10.54327/set2027/v7.i1.373
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Universitas Muhammadiyah Yogyakarta