Design and Implementation of Arduino-Based PID Control System for Water Level Regulation Using Ultrasonic Sensors

  • Mas Efendi Magister Student in Mechanical Engineering, Universitas Riau, Indonesia
  • Feri Candra Informatics Engineering Department, Universitas Riau, Indonesia

Abstract

Water resource management is a critical aspect of various sectors, including agriculture, industry, and household applications, where maintaining optimal water levels is essential for efficiency, sustainability, and safety. Traditional water level control methods often rely on manual operations, leading to inefficiencies, resource wastage, and potential system failures. To address these challenges, this study presents the design and implementation of an automated water level control system using a Proportional-Integral-Derivative (PID) controller, an HC-SR04 ultrasonic sensor, and an Arduino Uno microcontroller. The system is designed to enhance accuracy and reliability in liquid level regulation, particularly in industrial and domestic settings. By systematically tuning the Proportional Gain (Kp), Integral Gain (Ki), and Derivative Gain (Kd), the optimal parameter values were determined as Kp = 20.0, Ki = 11.0, and Kd = 1.0. Experimental results demonstrated that the proposed system achieves stable water level regulation with rapid response times and minimal deviations. This research contributes to the advancement of automated liquid control technologies, offering a cost-effective and efficient solution for real-world water management applications.

##Keywords:## Water level control, PID controller, Arduino uno, Ultrasonic sensor, Automation.
Published
Mar 30, 2025
How to Cite
EFENDI, Mas; CANDRA, Feri. Design and Implementation of Arduino-Based PID Control System for Water Level Regulation Using Ultrasonic Sensors. Journal of Ocean, Mechanical and Aerospace -science and engineering-, [S.l.], v. 69, n. 1, p. 57-64, mar. 2025. ISSN 2527-6085. Available at: <https://isomase.org/Journals/index.php/jomase/article/view/527>. Date accessed: 03 june 2026. doi: http://dx.doi.org/10.36842/jomase.v69i1.527.

References

[1] Zulkifli, C.Z., Shamsuddin, S.M. & Abdullah, M.R. (2022). IoT-based water monitoring systems: A systematic review. Water, 14(22), 3621. https://doi.org/10.3390/w14223621.
[2] Almetwally, S.A.H., Hassan, M.K. & Mourad, M.H. (2020). Real-time internet of things (IoT) based water quality management system. Procedia CIRP, 90, 478–485. https://doi.org/10.1016/j.procir.2020.03.107.
[3] Mohana Priya, R., Sathyamoorthy, M., Surya, S. & Gopal, V.V. (2021). IoT based smart water monitoring & distribution system for apartments. International Journal of Trend in Scientific Research and Development, 4(1), 41133. www.ijtsrd.com/papers/ijtsrd41133.pdf.
[4] Getu, B.N., Khaimah, A. & Al Khaimah, R. (2016). Water level controlling system using PID controller. Research India Publications.
[5] Anggara, B. P., Ma’arif, A. & Abu, N.S. (2023). Design of a liquid tank filling control system using PID. Buletin Ilmiah Sarjana Teknik Elektro, 5(3), 367–375. https://doi.org/10.12928/biste.v5i3.8915.
[6] Yumurtaci, M. & Verim, Ö. (2020). Liquid level control with different control methods based on Matlab/Simulink and Arduino for the control systems lesson. International Advanced Researches and Engineering Journal, 4(3), 249–254. https://doi.org/10.35860/iarej.750664.
[7] Zhu, F., Zhang, L., Hu, X., Zhao, J., Meng, Z. & Zheng, Y. (2023). Research and design of hybrid optimized backpropagation (BP) neural network PID algorithm for integrated water and fertilizer precision fertilization control system for field crops. Agronomy, 13(5), 1423. https://doi.org/10.3390/agronomy13051423.
[8] Pereira, T.S.R., de Carvalho, T.P., Mendes, T.A. & Formiga, K.T.M. (2022). Evaluation of water level in flowing channels using ultrasonic sensors. Sustainability (Switzerland), 14(9), 5512. https://doi.org/10.3390/su14095512.
[9] Ahfas, A., Hadidjaja, D., Syahrorini, S., & Jamaaluddin, J. (2021). Implementation of ultrasonic sensor as a chemical percol fluid level control based on Atmega 16. IOP Conference Series: Materials Science and Engineering, 1098(4), 042046. https://doi.org/10.1088/1757-899X/1098/4/042046.
[10] Ma’arif, A., Iswanto, N.M., Raharja, P.A., Rosyady, A. R.C., Baswara, A.C., & Nuryono, A.A. (2020). Control of DC motor using proportional integral derivative (PID): Arduino hardware implementation. In Proceeding - 2020 2nd International Conference on Industrial Electrical and Electronics, ICIEE 2020 (pp. 74–78). IEEE. https://doi.org/10.1109/ICIEE49813.2020.9277258.
[11] Rahmadini, V.F., Ma’arif, A. & Abu, N.S. (2023). Design of water heater temperature control system using PID control. Control Systems and Optimization Letters, 1(2), 111–117. https://doi.org/10.59247/csol.v1i2.41.
[12] Kadry, S. & Rajinikanth, V. (2021). Design of PID controller for magnetic levitation system using Harris Hawks optimization. Jurnal Ilmiah Teknik Elektro Komputer dan Informatika, 6(2), 70. https://doi.org/10.26555/jiteki.v6i2.19167.
[13] Suseno, E.W. & Ma’arif, A. (2021). Tuning of PID controller parameters with genetic algorithm method on DC motor. International Journal of Robotics and Control Systems, 1(1), 41–53. https://doi.org/10.31763/ijrcs.v1i1.249.
[14] Cahya, A.A. & Puriyanto, R.D. (2023). The design of rice milling and screening systems using the DC motor PID method. Control Systems and Optimization Letters, 1(1), 1–6. https://doi.org/10.59247/csol.v1i1.2.
[15] Yumurtaci, M. & Verim, Ö. (2020). Liquid level control with different control methods based on Matlab/Simulink and Arduino for the control systems lesson. International Advanced Researches and Engineering Journal, 4(3), 249–254. https://doi.org/10.35860/iarej.750664.
[16] Do?an, I. (2022). PID-based practical digital control with Raspberry Pi and Arduino Uno. Elektor International Media.
[17] Sinha, C. & Gupta, P. (2023). Smart irrigation system using Arduino. International Journal of Scientific Research in Engineering and Management, 7(9), 1–11. https://doi.org/10.55041/IJSREM25793.
[18] Ali, M., Afandi, A.N., Parwati, A., Hidayat, R. & Hasyim, C. (2019). Design of water level control systems using PID and ANFIS based on firefly algorithm. Journal of Electrical Engineering, Mechatronic and Computer Science, 2(1), 2804. https://doi.org/10.26905/jeemecs.v2i1.2804.
[19] Kvascev, G.S. & Djurovic, Z.M. (2022). Water level control in the thermal power plant steam separator based on new PID tuning method for integrating processes. Energies (Basel), 15(17), 6310. https://doi.org/10.3390/en15176310.
[20] Zhu, F., Zhang, L., Hu, X., Zhao, J., Meng, Z. & Zheng, Y. (2023). Research and design of hybrid optimized back propagation (BP) neural network PID algorithm for integrated water and fertilizer precision fertilization control system for field crops. Agronomy, 13(5), 1423. https://doi.org/10.3390/agronomy13051423.
[21] Guo, Y. & Mohamed, M.E.A. (2020). Speed control of direct current motor using ANFIS-based hybrid P-I-D configuration controller. IEEE Access, 8, 125638–125647. https://doi.org/10.1109/ACCESS.2020.3007615.
[22] Hidayat, M.R., Sambasri, S., Fitriansyah, F., Charisma, A. & Iskandar, H.R. (2019). Soft water tank level monitoring system using ultrasonic HC-SR04 sensor based on ATMega 328 microcontroller. In Proceeding of 2019 5th International Conference on Wireless and Telematics, ICWT 2019 (pp. 1–5). IEEE. https://doi.org/10.1109/ICWT47785.2019.8978229.