Accuracy of HC-SR04 Ultrasonic Servo in Servo-Scanned 2D Ranging
DOI:
https://doi.org/10.33394/j-ps.v14i3.19813Keywords:
Ultrasonic sensor, HC-SR04, Measurement accuracy, Arduino-based ultrasonic radarAbstract
This study evaluates the measurement accuracy of the HC-SR04 ultrasonic sensor configured as a low-cost two-dimensional servo-scanned ultrasonic ranging system using an Arduino Uno and micro-servo scanning. Unlike prior studies that typically investigate angle, distance, or material effects separately, this work presents an integrated experimental framework that simultaneously examines the combined influence of scanning angle, object distance, and surface characteristics under dynamic scanning conditions. Experiments were conducted at five angles (40°, 75°, 90°, 105°, 150°), four distances (15, 30, 45, and 60 cm), and three materials (brass, wood, plastic), with five repetitions per condition. Performance was assessed using mean absolute error (MAE) and standard deviation. The results show that measurement accuracy varies systematically with scanning geometry. The lowest errors occur near 90°, with average MAE values of approximately 0.5–0.7° for brass, 2–3° for wood, and 4–5° for plastic. At extreme angles (e.g., 150°), errors increase significantly, reaching up to ~1.5° (brass), ~5° (wood), and >8° (plastic). Across distances, MAE increases from 15 cm to 60 cm, indicating reduced accuracy at longer ranges. Material effects are also pronounced, with brass consistently yielding the lowest error and plastic the highest. These trends are consistent with the expected influence of reflection geometry and signal attenuation, although echo strength was not directly measured. Overall, reliable operation is observed within 75° < θ < 105° and 15–45 cm. These findings provide experimentally grounded insights for improving the performance of a low-cost ultrasonic servo-scanned ultrasonic ranging system in short-range applications.
References
Abdelhadi, H. (2004). Ultrasonic evaluation of surface roughness using normal incidence pulse-echo. NDT & E International, 37(6), 479–485. https://doi.org/10.1016/j.ndteint.2004.03.002
Abreu, D., Toledo, J., Codina, B., & Suárez, A. (2021). Low-cost ultrasonic range improvements for an assistive device. Sensors, 21(12), 4250. https://doi.org/10.3390/s21124250
Ali, H. S., Rahman, A. A., & Kamarudin, M. N. (2021). Analysis of error characteristics in low-cost ultrasonic distance sensors. Sensors, 21(9), 3108. https://doi.org/10.3390/s21093108
Barshan, B., & Kuc, R. (1992). Differentiating sonar reflections from corners and planar surfaces by employing an intelligent sensor. IEEE Transactions on Instrumentation and Measurement, 41(3), 368–372. https://doi.org/10.1109/19.143235
Blum, J., et al. (2010). Analysis of ultrasonic sensor accuracy for distance measurement in robotics. Measurement, 43(9), 1239–1246.
Borenstein, J., & Koren, Y. (1995). Error eliminating rapid ultrasonic firing for mobile robot obstacle avoidance. IEEE Transactions on Robotics and Automation, 11(1), 132–138.
Busaeed, S., Katib, I., Albeshri, A., Corchado, J. M., Yigitcanlar, T., & Mehmood, R. (2022). LidSonic V2. 0: A LiDAR and deep-learning-based green assistive edge device to enhance mobility for the visually impaired. Sensors, 22(19), 7435. https://doi.org/10.3390/s22197435
Carullo, A., Ferraris, F., Graziani, S., Grimaldi, U., & Parvis, M. (2002). Ultrasonic distance sensor improvement using a two-level neural network. IEEE Transactions on Instrumentation and Measurement, 45(2), 677–682.
Carullo, A., & Parvis, M. (2001). An ultrasonic sensor for distance measurement in automotive applications. IEEE Sensors Journal, 1(2), 143–147.
Chaix, J. F., Garnier, V., & Corneloup, G. (2006). Ultrasonic wave propagation in heterogeneous solid media: Theoretical analysis and experimental validation. Ultrasonics, 44(2), 200–210. https://doi.org/10.1016/j.ultras.2005.11.002
Drinkwater, B. W., & Wilcox, P. D. (2006). Ultrasonic arrays for non-destructive evaluation. NDT & E International, 39(7), 525–541.
Elfes, A. (1987). Sonar-based real-world mapping and navigation. IEEE Journal of Robotics and Automation, 3(3), 249–265.
Feng, C., et al. (2019). Performance evaluation of ultrasonic sensors for distance measurement under varying conditions. Measurement, 141, 1–10.
Firdaus, R. A., Khoiro, M., & Rahayu, V. (2022). Two-dimensional simulation of electromagnetic waves on metal materials using the FDTD method, in Journal of Physics: Conference Series, 2392, 012037.
Firdaus, R. A., Winarno, N., & Afifah, R. M. A. (2019). The effect of conductivity and permittivity on propagation and attenuation of waves using FDTD. Materials Physics and Mechanics, 42(5), 617–624.
Fox, D., Burgard, W., & Thrun, S. (1999). Markov localization for mobile robots using ultrasonic sensors. Artificial Intelligence, 114(1–2), 125–157.
Hauptmann, P., et al. (2002). Ultrasonic sensors in air: Propagation and attenuation. Ultrasonics, 40(1–8), 33–37.
Hodson, T. O. (2022). Root mean square error (RMSE) or mean absolute error (MAE): When to use them or not. Geoscientific Model Development, 15, 5481–5495. https://doi.org/10.5194/gmd-15-5481-2022
Islam, M., Lee, T. S., & Kim, S. H. (2019). Development and testing of a surface roughness measurement device based on aerial ultrasonic reflections. Paddy and Water Environment, 17(3), 485–494. https://doi.org/10.1007/s10333-019-00731-7
Kirjanów-Błażej, A., Jurdziak, L., Błażej, R., & Rzeszowska, A. (2023). Calibration procedure for ultrasonic sensors for precise thickness measurement. Measurement, 214, 112744.
Korosteleva, M., Korchagin, V. S., & Plaksin, A. V. (2025). Influence of environmental factors on the accuracy of the ultrasonic rangefinder in a mobile robotic technical vision system. Electronics, 14(7), Article 1393. https://doi.org/10.3390/electronics14071393
Kuc, R. (1997). Biologically inspired sonar recognition for mobile robots. IEEE Transactions on Instrumentation and Measurement, 46(1), 66–73.
Lee, D. K., In, J., & Lee, S. (2015). Standard deviation and standard error of the mean. Korean Journal of Anesthesiology, 68(3), 220–223.
Li, X., et al. (2018). Improving ultrasonic sensor accuracy using signal processing techniques. Measurement, 116, 1–10.
Mocanu, B., Tapu, R., & Zaharia, T. (2016). When ultrasonic sensors and computer vision join forces for efficient obstacle detection and recognition. Sensors, 16(11), 1807. https://doi.org/10.3390/s16111807
Muñoz, A., et al. (2014). Ultrasonic sensor-based distance measurement system with improved accuracy. Sensors, 14(7), 12213–12230.
Panda, K. G., Agrawal, S., & Barai, P. K. (2016). Effects of environment on the accuracy of the ultrasonic sensor operating in the millimeter range. Perspectives in Science, 8, 574–576. https://doi.org/10.1016/j.pisc.2016.06.024
Parrilla, M., et al. (2016). Environmental effects on ultrasonic sensors. Sensors, 16(12), 2102.
Peremans, H., Audenaert, K., & Van Campenhout, J. (1993). A high-resolution sensor based on tri-aural perception. IEEE Transactions on Robotics and Automation, 9(1), 36–48. https://doi.org/10.1109/70.210790
Purwanto, H., Riyadi, M., & Astuti, D. W. W. (2019). Comparison of HC-SR04 and JSN-SR04T ultrasonic sensors for distance measurement. International Journal of Electrical and Computer Engineering, 9(6), 5263–5270.
Rahman, M. A., Islam, M. S., & Hasan, M. R. (2020). Performance evaluation of an ultrasonic sensor under different environmental and operational conditions. Measurement, 149, 106987. https://doi.org/10.1016/j.measurement.2019.106987
Sabatini, R., Richardson, M. A., & Gardi, A. (2015). Airborne ultrasonic sensors for obstacle detection: Measurement uncertainty and error analysis. Measurement, 68, 345–357.
Schmidt, A., & van der Zwaan, M. (2018). Material-dependent ultrasonic reflection and its effect on distance measurement accuracy. Ultrasonics, 84, 1–10.
Shoval, S., & Borenstein, J. (2001). Using ultrasonic sensors to detect edges and corners. IEEE Transactions on Robotics and Automation, 17(2), 169–176.
Stoner, J. L., Felix, R., & Blank, A. S. (2023). Best practices for implementing experimental research methods. International Journal of Consumer Studies, 47(4), 1579–1595.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Ayunita Haq, Rohim Aminullah Firdaus, Muhimmatul Khoiro, Endah Rahmawati, Nanang Winarto

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).

This work is licensed under a Creative Commons Attribution 4.0 International License.

