Research Article | | Peer-Reviewed

Detection and Visualization of Distant Objects: A System Design Using Arduino and Processing Software

Received: 5 October 2025     Accepted: 20 October 2025     Published: 7 April 2026
Views:       Downloads:
Abstract

A detection system is an electronic device that uses electromagnetic waves to determine the altitude, range, direction, or speed of objects, whether moving or stationary. In contrast, ultrasonic waves are used instead of electromagnetic waves in ultrasonic detection system. It has many advantages. Its low power consumption, low cost, and ease of implementation and use make it well-suited for various applications, including security systems, object detection and avoidance systems in robotics. In this paper, a low-cost ultrasonic detection system using Arduino microcontroller and processing software was developed. This system makes measurements of distance, direction or speed of both moving and fixed object. The ultrasonic sensors measure the distance to target objects using non-contact technology. They provide accurate distance measurement without causing damage and are easy to use. The sensor receives signals in analog form, which are then converted to a digital format and processed by a microcontroller. The detection distance of the proposed system is tested up to 400 cm for different types of objects: fabrics and aluminum. The distance error between the system and the objects were determined. The results obtained for all types of objects prove that a very low error can be achieved using the proposed design.

Published in Journal of Electrical and Electronic Engineering (Volume 14, Issue 2)
DOI 10.11648/j.jeee.20261402.13
Page(s) 91-98
Creative Commons

This is an Open Access article, distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution and reproduction in any medium or format, provided the original work is properly cited.

Copyright

Copyright © The Author(s), 2026. Published by Science Publishing Group

Keywords

Arduino UNO, Ultrasonic Sensor, HC-SR04, Arduino IDE (Integrated Development Environment), Object Detection, Processing IDE

1. Introduction
Managing human health and safety in various environments where hazards are present, requires the implementation of protective devices. The Ultrasonic object detection system is one of the most reliable technological solutions for enhancing safety. The ultrasonic system uses electromagnetic waves for detection. It provides informations about a moving and fixed object such as distance, depth, direction, speed, etc. .
The fundamental principles of ultrasonic system are unique, transmitting and receiving electromagnetic waves. Indeed, when this signal hits an object, it is reflected in many directions. This reflected signal or echo is received by the system’s antenna which delivers it to the receiver, where it is processed to determine the geographical statistics of the object.
The distance is determined by calculating the time taken for the signal to travel from the detection system to the target and back. The target’s location is measured as an angle, from the direction of maximum amplitude echo signal. To measure the range and position of moving objects, Doppler Effect is used . Furthermore, the ultrasonic wave placed beyond the audible frequency range (20Hz to 20,000Hz) is the key point of the operation of the ultrasonic system. Each ultrasonic system must include ultrasonic detector (sensor) that operates as a transformer of ultrasonic waves to electrical form and vice versa . The wavelengths emitted by the system vary from millimeters to meters, capable of penetrating smoke, fog, and not depending on sunlight .
Ultrasonic sensors offer significant advantages, including low cost, an extensive sensing range, and superior robustness in changing environments compared to alternative technologies. Furthermore, their detection range can be readily extended by adjusting signal attenuation and circuit sensitivity . One of the most important capabilities of ultrasonic detection system is to perform monitoring both day and night, which provides a significant contribution to defense and security . In the other hand, the ultrasonic detection system covers a wide range of applications in many fields including civil, military, aeronautical, maritime and meteorological. In addition, the ultrasonic system is used to observe the weather and monitor the sea.
This study designs and implements a low-cost, ultrasonic object detection and visualization system using an Arduino board and Processing software. The system rotates 4-meter path with a 180-degree angular range, scanning in both directions. The distance and measurement error were then calculated.
2. Hardware and Software Components
A brief description of the Hardware and software components used in the implementation of the design is covered in this section.
2.1. Hardware
The following are the hardware components required to design the system.
1) Arduino UNO
2) Servo Motor (SG90)
3) Ultrasonic Sensor (HC-SR04)
4) Jumping Wires
5) Breadboard
6) Buzzer
7) LED (light-emitting diode)
2.1.1. Arduino UNO
Arduino Uno is a physical computing platform that released under an open-source license and based on a simple microcontroller board. known for its versatility, accessibility and user-friendliness, in electronics projects and prototyping. The Arduino Uno microcontroller board operates on a 5 VDC power supply. Its core components include 14 digital I/O pins, 6 analog inputs, serial communication interfaces (UART), a USB-B port for both programming and power, a 2.1 mm DC power jack, a 16 MHz quartz crystal oscillator, and a reset button.
However, it can work efficiently without this connection according to the application requirements . Another, significant benefit of the Arduino Uno is the use of a development environment called Arduino IDE.
2.1.2. Ultrasonic Sensor (HC-SR04)
The HC-SR04 ultrasonic sensor is perfect for a wide range of applications, including obstacle detection, distance measurement, object tracking, and proximity sensing. It can be effortlessly integrated with microcontrollers such as Arduino and Raspberry Pi, as well as other embedded systems. Its performance is not influenced by sunlight or dark materials.
The HC-SR04 ultrasonic sensor has four pins: VCC (Voltage at the Common Collector), GND (ground), TRIG (trigger), and ECHO (echo signal).
To take a measurement, send a 10-microsecond, 5 V pulse to the 'Trig' pin. This triggers the sensor to emit eight 40 kHz ultrasonic pulses. The sensor then measures the time for the echo to return and represents it as the duration of a "high" signal on the 'Echo' pin, which corresponds directly to the distance.
2.1.3. Servo Motor (SG90)
The SG90 servo motor is a compact, lightweight, and cost-effective electrical device commonly used in CNC machines, robotics, automation, and hobbyist projects .
A servo system, is a feedback control loop designed to regulate one or more parameters within the system. In the case of a servomotor, which works as a linear rotary actuator, the controlled parameters typically include acceleration, speed, and/or position.
In this work, a servomotor (±180° rotation range) is used alongside the Arduino board and ultrasonic sensor for position determination.
2.2. Software Requirements
The software part of the sensor system is crucial, for displaying data and creating an intuitive user interface, to understand the information. Essentially two software platforms work in synergy with the hardware: the Arduino Integrated Development Environment (IDE) and the Processing IDE.
2.2.1. Arduino IDE
The Arduino IDE is an open-source software. This platform is used to write, compile and upload code to Arduino boards. Then it includes a USB interface for connection to computers to facilitate code uploading and serial communication.
2.2.2. Processing IDE
The Processing IDE is an open-source software. It is a platform crafted for programming, using only a small amount of code. At its essence processing is rooted in the Java programming language. In fact, this is different from other languages which tend to prioritize only text processing such as Arduino Processing which is also equipped with an IDE.
Furthermore, processing provides a graphical user interface for simplifying the compilation and execution stage. It also offers an environment for crafting visual experiences. Indeed, the system displays detected objects on the GUI, showing their distance from the sensor and height from the ground. If the sensors fail to detect an object, no data is shown.
Figures 1 and 2 gives the screenshot of different sets of sensor system based GUI.
Figure 1 shows the green lines which depicts that no object is kept infront of the sensor or it is may be outside the range with angle mentioned as 34°.
Figure 2 shows the object detected in red color with the range in 14 cm and angle at 52°.
Figure 1. No object detected.
Figure 2. Object detected.
2.2.3. Tinkercad
Tinkercad is a free software of-charge, online, easy-to-use app for 3D design, electronics, and coding. It is used for developing and simulating applications in a simple and interactive graphical environment. This work, is an introduction to this software, based on an assembly components, the results of which are then compared to those obtained theoretically and experimentally. In addition to its ability to simulate microcontroller-based assemblies, it is also capable of simulating the behavior of an Arduino board and its interactions with surrounding components. So Tinkercad simulations are easier to set up, faster, cleaner, cheaper to use, and allow the user to run experiments without the risk of damaging the machine.
3. Theoretical Analysis
Tinkercad was used to create the schematic diagram for the hardware design. This is enables us to test and retrieve simulation results in real time. Figure 3 shows our simulated assembly.
Figure 3. Electronic Circuit of Ultrasonic system in Thinkercad.
The Global electronic simulation circuit and the list of project component obtained with Tinkercad are represented in Figure 4 and Table 1.
Figure 4. Global electronic simulation circuit.
Table 1. Project component.

Component List

Name

Quantity

component

U1

1

Arduino Uno R3

DIST1

1

Ultrasonic Distance Sensor (4-Pin)

SERVO1

1

Positional Micro Servo

PIEZO1

1

Piezo

D1

1

Red LED

D2

1

Green LED

4. Experimental Analysis and Results
4.1. Experimental Setup
We successfully implemented a low-cost ultrasonic detection system with good performance (Figure 5).
Figure 5. Experimental Setup.
Although the ultrasonic system can detect objects up to 400 cm away, a specific, shorter distance was chosen to trigger the alarm in this research.
4.2. Testing of Ultrasonic Detection System
The ultrasonic system detects objects and relays a signal to the Arduino board, which interfaces with the processing software. Upon detecting an object within a predefined distance, the system activates a buzzer and LEDs as an alarm. The system's performance was evaluated under various conditions, successfully measuring distances of up to 400 cm. The implementation results are presented in Figures 6 and 7.
Figure 6. The system does not detect any object.
Figure 7. The system detects object.
4.3. Results and Discussions
The system integrates an ultrasonic sensor with a servomotor, both controlled by an Arduino microcontroller. This configuration enables the system to measure the distance to a nearby object.
The object distance is calculated by the following equation:
distance (Cm)=340 *travel time2
Where, 340 is the speed of sound waves.
Total distance is divided by 2 because signal travels from HC-SR04 to object and returns to the module HC-SR-04.
Conversely, the system's performance for a specified obstacle is measured by calculating the error.
The error was determined according to the following relation:
Error=real distance -measured distance real distance  *100%
Where the real distance is the manually measured distance between the object and the system, while the measured distance is the value obtained by the system itself.
In this work, fabric and aluminum were selected as the materials for this investigation owing to their prevalence in various applications. Measurements were taken at distances from 50 to 400 cm and at angles ranging from 0 to 180 degrees.
4.3.1. Fabrics Obstacle
This material is soft as the ultrasonic waves when incident on it some waves pass through the material, and some of the waves reflect back.
The values of real distance, measured distance and error for this material are represented in table 2.
The table above shows errors in the measured distance from the obstacle to the detection system.
The measured error ranges from 0.5% to 2%, which can be attributed to atmospheric particles and other factors.
We can notice also that the error decreases when the object is very far to the system.
Table 2. Experimental Results (fabrics obstacle).

Real distance (cm)

Measured distance (cm)

Error %

50

49

2

100

99

2

150

148

1.33

200

198

1

250

248

0.8

300

298

0.67

350

349

0.29

400

398

0.5

Figure 8. Relation between measurement and actual distance for fabrics obstacle.
Figure 8 illustrates the variation of the measured distance as a function of the actual distance.
This graph indicates a slight discrepancy between the manually measured distance and the value from the processing software. Potential causes for this minor difference include the calculation formula, approximation methods, sensor error, temperature, and ray splitting .
4.3.2. Aluminum Obstacle
For the aluminum obstacle, the results of the distance measurements are summarized in Figure 9 and Table 3. The recorded percentage error for these measurements was under 2.6%.
Table 3. Experimental results (Aluminum obstacle).

Real distance (cm)

Measured distance (cm)

Error %

50

49

2

100

98

2

150

154

2.6

200

205

2.5

250

254

1.6

300

293

2.3

350

356

1.71

400

401

1

Figure 9. Relationship between measured and actual distance (aluminum obstacle).
Also, it can be noticed that the percentage error of most measurements is larger than the measurements in case of fabrics obstacle. The observed variation error rates with fabrics obstacles are not anomalous but are a direct consequence of many factor. Thus, the speed of ultrasonic waves depends on the medium crossed . Furthermore, the variation detection of aluminum and fabric is a predictable outcome of physics, rooted in the principles of acoustic reflection and attenuation . Indeed, Ultrasonic sensors operate by emitting a pressure wave and measuring the time for its echo to return.
Figure 7 plots the measured distance against the actual distance for an aluminum obstacle. We spotted that there is a considerable error in the measured distance as compared to the actual distance.
Several reasons could lead to this error such as the alter of temperature, random noises and wind speed. Indeed, these reasons affect the ultrasound wave.
The low percentage error in the measured distance confirms that the proposed design is functioning properly and is suitable for many applications.
5. Conclusion
This article presents the design and experimental implementation of an ultrasonic detection system for distance measurement. This system helps in detection of object which is at a distance of around 4 meters and also calculates the distance at an angle of 0 to 180 degrees. While the presented system successfully demonstrates the core functionality and robust performance of the Arduino-based ultrasonic system, several avenues for future research could build upon these promising results. To enhance its capabilities, subsequent work could focus on integrating more advanced algorithms for dynamic object tracking and classification, moving beyond static distance measurement. Furthermore, validating the system's performance in more complex and noisy environmental condition, such as outdoor settings with wind or rain, industrial environments with acoustic interference or varying temperatures, would be crucial for real-world deployment. Additional research could also explore the optimization of the system for power efficiency to enable long-term, battery-operated applications, as well as the potential for sensor fusion, combining ultrasonic data with inputs from infrared, LIDAR, or camera systems to create a more comprehensive and robust perceptual framework.
Abbreviations

IDE

Integrated Development Environment

LED

Light-Emitting Diode

VCC

Voltage at the Common Collector

GND

Ground

TRIG

Trigger

Conflicts of Interest
All authors declare that they have no conflicts of interest.
References
[1] Y. Dewanto, “Sistem radar sebagai alat indikasi sasaran bergerak,” Berita Dirgantara, vol. 15, no. 2, pp. 72-83, 2014.
[2] I. Ciuffreda, S. Casaccia, G. Marco Revel, AMulti-Sensor Fusion Approach Based on PIR and Ultrasonic Sensors Installed on a Robot to Localise People in Indoor Environments, Sensors 2023, 23, 6963.
[3] Akshaya U Kulkarni, Amit M Potdar, Suresh Hegde, Vishwanath P Baligar, 2019 1st International Conference on Advances in Information Technology.
[4] A. Emmanuel Onoja, A. Maryam Oluwadamilola,” Embedded System Based Radio Detection and Ranging (RADAR) System Using Arduino and Ultra-Sonic Sensor, Vol. 2, No. 5,(2017), pp. 85-90.
[5] A. H. Wahyudi, Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 8, no. 2, pp. 801-804, 2021.
[6] Shengbo Eben Li, Guofa Li, Jiaying Yu, Chang Liu, Bo Cheng, Jianqiang Wang, Keqiang Li, Mechanical Systems and Signal Processing, Vol. 98 (2018), pp. 173-189.
[7] S. Mubeen, K. Thota, N. Are, B. Sai Krishna, A. Pavan Reddy, Design of RADAR Detection System Management with MATLAB, IJRASET, vol. 10, no. 11, pp. 723-727, 2022.
[8] V. Yoganand Bharadwaj, S. Muddasani, M. Rudra, P. Mudavath, M. Saleh Mashkour, B Rajalakshmi, G. Nijhawan, D. Kumar Yadav, E3S Web of Conferences, Disaster zone human and animal detection using sonar 507, 01010 (2024).
[9] N. Anju Latha, B. Rama Murthy, K. Bharat Kumar, Distance Sensing with Ultrasonic Sensor and Arduino, International Journal of Advance Research, Ideas and Innovations in Technology, Vol. 2, No. 5, (2016), pp. 1-5.
[10] S. Srivatava, R. Rastogi, S. Rungta, U. Yadav, 2014). A Methodology to Find the Cycle in a Directed Graph Using Linked List. BIJIT, 6(2), 743-749.
[11] R. Gonçalves, · A. Julio, T. Gisleiva, C. dos Santos Ferreira, Effect of coupling media on velocity and attenuation of ultrasonic waves in Brazilian wood, J Wood Sci (2011) 57: 282-287,
[12] M. Germano, Tunnel Effect for Ultrasonic Waves in Tapered Waveguides, Acoustics 2024, 6, 362-373.
[13] X. Xu, B. Ran, N. Jiang, L. Xu, P. Huan, X. Zhang, Z. Li, A systematic review of ultrasonic techniques for defects detection in construction and building materials, Measurement, Volume 226, 2024, 114181.
[14] A. Feeney., (2024). Advances in Adaptive Ultrasonics. CRC Press.
[15] R. G. Maev, F. Seviaryn, Applications of non-linear acoustics for quality control and material characterization, J. Appl. Phys. 132, 161101 (2022),
Cite This Article
  • APA Style

    Bchiri, Y., Saadi, W. (2026). Detection and Visualization of Distant Objects: A System Design Using Arduino and Processing Software. Journal of Electrical and Electronic Engineering, 14(2), 91-98. https://doi.org/10.11648/j.jeee.20261402.13

    Copy | Download

    ACS Style

    Bchiri, Y.; Saadi, W. Detection and Visualization of Distant Objects: A System Design Using Arduino and Processing Software. J. Electr. Electron. Eng. 2026, 14(2), 91-98. doi: 10.11648/j.jeee.20261402.13

    Copy | Download

    AMA Style

    Bchiri Y, Saadi W. Detection and Visualization of Distant Objects: A System Design Using Arduino and Processing Software. J Electr Electron Eng. 2026;14(2):91-98. doi: 10.11648/j.jeee.20261402.13

    Copy | Download

  • @article{10.11648/j.jeee.20261402.13,
      author = {Yemna Bchiri and Wided Saadi},
      title = {Detection and Visualization of Distant Objects: A System Design Using Arduino and Processing Software},
      journal = {Journal of Electrical and Electronic Engineering},
      volume = {14},
      number = {2},
      pages = {91-98},
      doi = {10.11648/j.jeee.20261402.13},
      url = {https://doi.org/10.11648/j.jeee.20261402.13},
      eprint = {https://article.sciencepublishinggroup.com/pdf/10.11648.j.jeee.20261402.13},
      abstract = {A detection system is an electronic device that uses electromagnetic waves to determine the altitude, range, direction, or speed of objects, whether moving or stationary. In contrast, ultrasonic waves are used instead of electromagnetic waves in ultrasonic detection system. It has many advantages. Its low power consumption, low cost, and ease of implementation and use make it well-suited for various applications, including security systems, object detection and avoidance systems in robotics. In this paper, a low-cost ultrasonic detection system using Arduino microcontroller and processing software was developed. This system makes measurements of distance, direction or speed of both moving and fixed object. The ultrasonic sensors measure the distance to target objects using non-contact technology. They provide accurate distance measurement without causing damage and are easy to use. The sensor receives signals in analog form, which are then converted to a digital format and processed by a microcontroller. The detection distance of the proposed system is tested up to 400 cm for different types of objects: fabrics and aluminum. The distance error between the system and the objects were determined. The results obtained for all types of objects prove that a very low error can be achieved using the proposed design.},
     year = {2026}
    }
    

    Copy | Download

  • TY  - JOUR
    T1  - Detection and Visualization of Distant Objects: A System Design Using Arduino and Processing Software
    AU  - Yemna Bchiri
    AU  - Wided Saadi
    Y1  - 2026/04/07
    PY  - 2026
    N1  - https://doi.org/10.11648/j.jeee.20261402.13
    DO  - 10.11648/j.jeee.20261402.13
    T2  - Journal of Electrical and Electronic Engineering
    JF  - Journal of Electrical and Electronic Engineering
    JO  - Journal of Electrical and Electronic Engineering
    SP  - 91
    EP  - 98
    PB  - Science Publishing Group
    SN  - 2329-1605
    UR  - https://doi.org/10.11648/j.jeee.20261402.13
    AB  - A detection system is an electronic device that uses electromagnetic waves to determine the altitude, range, direction, or speed of objects, whether moving or stationary. In contrast, ultrasonic waves are used instead of electromagnetic waves in ultrasonic detection system. It has many advantages. Its low power consumption, low cost, and ease of implementation and use make it well-suited for various applications, including security systems, object detection and avoidance systems in robotics. In this paper, a low-cost ultrasonic detection system using Arduino microcontroller and processing software was developed. This system makes measurements of distance, direction or speed of both moving and fixed object. The ultrasonic sensors measure the distance to target objects using non-contact technology. They provide accurate distance measurement without causing damage and are easy to use. The sensor receives signals in analog form, which are then converted to a digital format and processed by a microcontroller. The detection distance of the proposed system is tested up to 400 cm for different types of objects: fabrics and aluminum. The distance error between the system and the objects were determined. The results obtained for all types of objects prove that a very low error can be achieved using the proposed design.
    VL  - 14
    IS  - 2
    ER  - 

    Copy | Download

Author Information
  • Laboratory of Physics of Materials and Nanomaterials Applied at Environment (LaPhyMNE), Faculty of Sciences of Gabes, Gabes, Tunisia;Higher Institute of Computer Science of Medenine, Medenine, Tunisia

  • Laboratory Processes, Energy, Environment and Electrical Systems, National Engineering School of Gabes, Gabes, Tunisia;Higher Institute of Computer Science of Medenine, Medenine, Tunisia