Article in HTML

Author(s): Somay Sharma, Tanishk Vishnoi, Surender Kumar

Email(s): somaysharma690@gmail.com, tanishk.vishnoi.97@gmail.com, skladhoria88@gmail.com

Address:

    Department of Electronics and Communication Engineering, IIMT College of Engineering, Gretaer Noida, UP, India.

Published In:   Volume - 6,      Issue - 1,     Year - 2026


Cite this article:
Somay Sharma, Tanishk Vishnoi, Surender Kumar, Obstacle Detection and Avoidance Using an Arduino-Based Autonomous Car, Spectrum of Emerging Sciences, 6 (1)1-6 10.55878/SES2026-6-1-1

  View PDF

Please allow Pop-Up for this website to view PDF file.



INTRODUCTION

Autonomous systems have emerged as a transformative technological paradigm across multiple engineering domains, including self-driving vehicles, industrial automation, service robotics, and intelligent surveillance. The fundamental capability underpinning all such systems is the ability to perceive and interpret the surrounding environment, enabling safe and effective operation without continuous human intervention [1-2]. Among the various perceptual requirements, obstacle detection and avoidance constitute the most critical safety feature, as failures in this function can directly lead to collisions, system damage, or operational hazards.

The growing interest in autonomous technologies has been accompanied by an increasing need for accessible educational platforms that allow students and researchers to understand core principles through hands on experimentation. Small-scale robotic platforms offer an ideal medium for this purpose, providing a safe, cost-effective, and customizable environment for developing and testing navigation algorithms [3-4].

1.1 Problem Statement

Conventional remotely operated vehicles require continuous human input for navigation and collision avoidance. This dependence limits their applicability in scenarios where real time human intervention is impractical, such as in hazardous environments, remote exploration, or repetitive monitoring tasks. Furthermore, manual operation does not address the fundamental challenge of developing autonomous decision-making capabilities that are essential for next-generation intelligent systems [5].

1.2 Objectives

The primary objectives of this work are:

1.    To design a low-cost autonomous vehicle capable of detecting obstacles in its path

2.    To develop a real-time control algorithm for collision avoidance without human intervention

3.    To integrate multiple sensors (ultrasonic and IR) for robust obstacle detection

4.    To implement directional scanning using a servo motor for improved situational awareness

5.    To evaluate system performance under varying obstacle configurations

2. Literature review

Autonomous obstacle-avoiding robots have been extensively studied in academic and hobbyist communities. Table 1 summarizes key contributions from existing literature.

The present work differentiates itself by offering a complete, low-cost, autonomous implementation that integrates multiple sensing modalities with a simple yet effective control algorithm, specifically designed for educational accessibility and reproducibility.                  Table 1. Summary of existing work

Author(s)

Year

Key Contribution

Limitations

Hwang & Yu [6]

2012

Zigbee-based remote monitoring system

Limited to communication; no autonomous navigation

Alex & Starbell [7]

2014

Energy-efficient intelligent street lighting

Application-specific; not applicable to mobile robots

Kim et al. [8]

2011

Human tracking using US/IR sensors

Focused on tracking rather than avoidance

Subramanyam et al. [9]

2013

Wireless street lighting control

Stationary application; no mobility

Jalal et al. [10]

2023

Object detection for autonomous vehicles

Advanced ML algorithms; high computational cost

ResearchGate [11]

2019

Arduino-based remote-controlled car

Manual control; limited autonomy

3. System architecture and components

3.1 Overall System Design

The proposed autonomous car employs a modular architecture comprising four functional units: (1) power supply unit, (2) sensing unit, (3) control unit, and (4) actuation unit. Figure 1 presents the block diagram of the system.

The power supply unit utilizes 18650 lithium-ion batteries to provide regulated power to all system components. The sensing unit includes an HC-SR04 ultrasonic sensor for primary obstacle detection and IR sensors for supplementary short-range detection. A servo motor enables directional scanning of the ultrasonic sensor. The Arduino UNO serves as the central control unit, processing sensor inputs and generating control signals. The actuation unit comprises an L298N motor driver and four TT gear motors mounted on a four-wheel chassis, enabling forward, reverse, and turning movements.

Fig. 1. Block Diagram of the Autonomous Obstacle Detection and Avoidance Car

3.2 Component Specifications and Selection

3.2.1 Arduino UNO Microcontroller

The Arduino UNO, based on the ATmega328P microcontroller operating at 16 MHz, serves as the system's central processing unit. Key specifications include: 14 digital I/O pins (6 with PWM capability), 6 analog input pins, 32 KB flash memory, 2 KB SRAM, and 1 KB EEPROM. The Arduino platform was selected for its ease of programming, extensive library support, large community documentation, and proven reliability in educational robotics applications [12].

Fig. 2. Pinout Diagram of Arduino UNO

3.2.2 Ultrasonic Sensor (HC-SR04)

The HC-SR04 ultrasonic sensor is employed as the primary obstacle detection device. It operates by transmitting 40 kHz ultrasonic pulses and measuring the time-of-flight of reflected echoes. The distance is calculated using the formula:

Distance = Time × Speed of Sound 2 Distance = 2Time × Speed of Sound​

where the speed of sound is approximately 343 m/s at 20°C. Key specifications include: operating voltage: 5V DC, detection range: 2–400 cm, measuring angle: 15 degrees, and accuracy: ±3 mm [13]. The sensor's non-contact operation and immunity to ambient lighting conditions make it ideal for indoor robotic applications.

3.2.3 Infrared (IR) Sensor

The IR sensor complements the ultrasonic sensor by providing short-range detection capability. It operates on the principle of reflected infrared radiation: an IR LED emits modulated infrared light, and a photodiode detects reflected signals from nearby objects. The sensor output is digital (HIGH when obstacle distance is below the adjustable threshold). IR sensors are particularly effective for detecting obstacles at close range (2–10 cm) and are less susceptible to angular orientation issues compared to ultrasonic sensors [14].

3.2.4 Servo Motor (SG90)

The SG90 micro servo motor is used to rotate the ultrasonic sensor, enabling directional scanning of the environment. The servo operates on PWM signals, with pulse widths of 0.5 ms (0°), 1.5 ms (90°), and 2.5 ms (180°). By mounting the ultrasonic sensor on the servo, the system can sequentially scan left, centre, and right directions, thereby obtaining a comprehensive view of the forward environment without requiring multiple fixed sensors [15].

3.2.5 L298N Motor Driver

The L298N motor driver module is a dual H-bridge driver capable of controlling two DC motors independently. Key specifications include: logic voltage: 5V, motor supply voltage: up to 12V, maximum current: 2A per channel, and PWM support for speed control. The H-bridge configuration allows bidirectional motor control by selectively activating transistors in diagonal pairs. The motor driver is essential because the Arduino UNO's digital pins cannot supply sufficient current (typically >100 mA) to drive the TT gear motors directly [16].

3.2.6 TT Gear Motors and Chassis

Four TT gear motors with a 48:1 gear ratio provide the vehicle's propulsion. These motors offer a good balance of torque and speed (approximately 100–150 RPM at 6V), making them suitable for small-scale robotic platforms. The motors are mounted on a four-wheel acrylic chassis (approximately 20 cm × 15 cm), providing a stable base for sensor mounting and component placement.

3.3 Cost Analysis

Table 2 presents the detailed cost breakdown of the prototype components. The total cost of ₹1,840 (approximately USD 22) demonstrates the economic viability of the proposed system, making it accessible for educational institutions and individual learners.

Table 2. Cost and specifications

SI. No.

Component

Qty.

Cost (INR)

01

Arduino UNO

1

350

02

TT Gear Motor (with wheels)

4

360

03

IR Sensor

1

100

04

18650 Li-ion Battery

2

300

05

SG90 Servo Motor

1

120

06

Battery Holder (2-cell)

1

50

07

HC-SR04 Ultrasonic Sensor

1

60

08

4-Wheel Chassis (Acrylic)

1

300

09

Rubber Wheels (set of 4)

4

200

Total

₹1,840

4. Hardware implementation and control algorithm

4.1 Circuit Schematic and Connections

The complete circuit connections are as follows:

Arduino UNO Connections:

·       Ultrasonic Sensor: Trig → Pin 9, Echo → Pin 10

·       IR Sensor: Output → Pin 8

·       Servo Motor: Signal → Pin 11

·       L298N Motor Driver: IN1 → Pin 4, IN2 → Pin 5, IN3 → Pin 6, IN4 → Pin 7

·       L298N Enable A and Enable B → 5V (for full speed)

L298N Motor Driver Connections:

·       Motor A (Left wheels): OUT1 and OUT2

·       Motor B (Right wheels): OUT3 and OUT4

·       Power: 12V input from batteries (shared with Arduino VIN)

4.2 Control Algorithm

The obstacle avoidance algorithm follows a deterministic decision-making process based on distance measurements from the ultrasonic sensor. The pseudo-code is as follows:

text

BEGIN

WHILE (true)

Measure distance in forward direction (servo at 90°)

   

IF (distance > SAFE_THRESHOLD) THEN

Move forward

ELSE

Stop vehicle

Measure left distance (servo at 180°)

Measure right distance (servo at 0°)

     

IF (left distance > right distance) THEN

Turn left

ELSE IF (right distance > left distance) THEN

Turn right

 ELSE

 Turn left (default decision)

 END IF

 END IF

 END WHILE

 END

The algorithm employs a safe distance threshold of 30 cm. When obstacles are detected within this range, the vehicle halts, performs a directional scan, and executes a turn toward the clearer path.

4.3 Prototype Development

Fig. 3. Complete Hardware Model

The hardware assembly followed these steps:

1.    The acrylic chassis was prepared with mounting holes for motors, Arduino, and sensors

2.    TT gear motors were secured using brackets, and wheels were attached

3.    The Arduino UNO was mounted using standoffs to prevent short circuits

4.    The L298N motor driver was positioned centrally for balanced weight distribution

5.    The ultrasonic sensor was mounted on the SG90 servo using a custom bracket

6.    The servo assembly was attached to the front of the chassis

7.    IR sensor was mounted at the front lower edge for close-range detection

8.    Batteries and holders were secured to the chassis base

9.    All connections were verified using a multimeter before powering the system

 

Fig. 4. Final Prototype

4.4 Programming

The Arduino code was developed using the Arduino IDE (version 2.0). The NewPing library was utilized for ultrasonic sensor interfacing due to its improved timing stability compared to the standard pulseIn() function. The servo motor was controlled using the built-in Servo.h library. The complete source code is available upon request from the corresponding author.

5. Results and discussion

5.1 Experimental Setup

The prototype was tested in a controlled indoor environment with various obstacle configurations:

·       Test Case 1: Single obstacle (cardboard box, 20 cm × 20 cm) placed at varying distances

·       Test Case 2: Multiple obstacles arranged in a simple maze configuration

·       Test Case 3: Dynamic obstacle (moving object) approaching from different directions

·       Test Case 4: Wall-following along a corridor

Each test was repeated 20 times, and the vehicle's response (successful avoidance, collision, or indecision) was recorded.

5.2 Functional Performance

Table 3 summarizes the experimental results.

Table 3. Experimental results

Test Case

Trials

Successful Avoidance

Collision

Success Rate

Single obstacle (30 cm)

20

19

1

95%

Single obstacle (20 cm)

20

20

0

100%

Single obstacle (10 cm)

20

18

2

90%

Multiple obstacles

20

17

3

85%

Dynamic obstacle

20

16

4

80%

Wall following

20

18

2

90%

Overall

120

108

12

90%

The system achieved an overall success rate of 90% across all test cases. Failures were primarily attributed to:

1.    Sudden obstacles entering the detection zone from the side (6 failures)

2.    Small obstacles below the sensor's detection height (3 failures)

3.    Confused decisions in symmetrical obstacle configurations (2 failures)

4.    Battery voltage drop affecting motor performance (1 failure)

The average response time from obstacle detection to initiation of avoidance manoeuvre was measured at 0.85 seconds, which is adequate for the vehicle's speed of approximately 0.2 m/s.

5.3 Comparison with Existing Work

Table 4 compares the proposed system with existing implementations.

 

Table 4. Comparative analysis

Parameter

Gunarakulangunaretnam [17]

Instructables [18]

Circuit Digest [19]

Proposed System

Microcontroller

Arduino UNO

Arduino UNO

Arduino UNO

Arduino UNO

Primary Sensor

Ultrasonic

Ultrasonic

Ultrasonic

Ultrasonic

Secondary Sensor

None

None

IR (optional)

IR + Servo

Scanning Capability

No

No

No

Yes (servo-based)

Cost (INR)

~1,500

~1,800

~1,600

~1,840

Success Rate

Not reported

~85%

~88%

90%

The proposed system demonstrates comparable or improved performance relative to existing open-source implementations, with the added benefit of servo-based directional scanning, which enhances situational awareness.

5.4 Limitations

The following limitations were identified during the study:

1.         Limited Detection Range: The ultrasonic sensor's 15-degree beam angle creates blind spots near the vehicle's sides

2.         No Mapping Capability: The system operates reactively without constructing an environmental map, leading to potential inefficiencies in complex mazes

3.         Speed Constraints: The avoidance algorithm requires the vehicle to stop for scanning, reducing overall speed

4.         Battery Dependency: Motor performance degrades as battery voltage drops, affecting manoeuvrability

5.         No Wireless Communication: The system lacks remote monitoring or override capabilities

6. Conclusion and future scope

6.1 Conclusion

This paper successfully presented the design, implementation, and evaluation of a low-cost Arduino-based autonomous car capable of real-time obstacle detection and collision avoidance. The system integrates an ultrasonic sensor for primary distance measurement, IR sensors for short-range detection, a servo motor for directional scanning, an L298N motor driver for actuation, and a four-wheel chassis for mobility. The control algorithm employs a simple deterministic decision-making process based on distance thresholds, achieving an overall success rate of 90% across varied test configurations.

The total component cost of ₹1,840 makes this system highly accessible for educational purposes, particularly for undergraduate students learning embedded systems, robotics, and sensor integration. The modular architecture allows for easy modification and extension, making it a valuable platform for hands-on experimentation.

6.2 Future Enhancements

The following enhancements are recommended for future iterations:

·      Artificial Intelligence Integration: Implementing machine learning algorithms (e.g., Q-learning or neural networks) for adaptive navigation in unknown environments

·      Simultaneous Localization and Mapping (SLAM): Adding a second ultrasonic sensor and implementing SLAM algorithms for environmental map construction

·      Wireless Connectivity: Integrating Bluetooth (HC-05) or Wi-Fi (ESP8266) modules for remote monitoring, data logging, and manual override capabilities

·      Enhanced Sensing: Adding a camera module for vision-based obstacle detection and classification

·      Power Management: Implementing voltage regulation and battery monitoring for consistent performance

·      Multiple Vehicle Coordination: Developing communication protocols for multi-robot coordination and swarm navigation

·      Obstacle Classification: Using sensor fusion techniques to differentiate between obstacle types and adjust avoidance strategies accordingly

6.3 Applications

The proposed system is well-suited for the following applications:

·           Educational Laboratories: Teaching embedded systems, robotics, and control algorithms

·           Hazardous Environment Exploration: Prototyping for search-and-rescue or inspection robots

·           Smart Warehousing: Small-scale material transport in automated storage systems

·           Research Platforms: Baseline system for testing advanced navigation algorithms

·           Competitions: Entry-level platform for robotics competitions

Acknowledgment

The authors express their sincere gratitude to Prof. (Dr.) Pankaj Jha, Head of the Department of Electronics and Communication Engineering, IIMT College of Engineering, Greater Noida, for his invaluable guidance, encouragement, and administrative support throughout this project. The authors also thank the faculty members and technical staff of the ECE Department for providing laboratory facilities and technical assistance during the design and testing phases. Finally, the authors acknowledge the constructive feedback and collaborative spirit of their B.Tech. 2nd-year batchmates.


Related Images:

Recomonded Articles:

Author(s): Sunny Raj; Yash Kumar Singh Jadon; Basanta Mahto

DOI: 10.55878/SES2024-4-1-10         Access: Open Access Read More

Author(s): Juhi Mishra; Sapna Sorrot; Seema Nayak; Puneet Mittal

DOI: 10.55878/SES2024-4-1-7         Access: Open Access Read More

Author(s): Sarfraj Ansari; Santosh Yadav; Nitish Kumar Rai

DOI: 10.55878/SES2023-3-1-7         Access: Open Access Read More

Author(s): Abhishek Kr Dubey; Sumit Singh; Deepak Sahu

DOI: 10.55878/SES2024-4-1-6         Access: Open Access Read More

Author(s): Akhlad Kadri; Ajaharudin Ansari; Alok Gond

DOI: 10.55878/SES2023-3-1-3         Access: Open Access Read More

Author(s): Roshan Kumar; Rahul Yadav; Pankaj Jha

DOI: 10.55878/SES2024-4-1-13         Access: Open Access Read More

Author(s): Sachin Chhonker; Om Tripathi; Arpita Gupta

DOI: 10.55878/SES2024-4-1-17         Access: Open Access Read More

Author(s): Kartikey Pandey; Ujjwal Tiwary; Manikesh Jha

DOI: 10.55878/SES2024-4-1-11         Access: Open Access Read More

Author(s): Punit Tomar, Ankit Sharma, Sandhya Bhardwaj

DOI: 10.55878/SES2025-5-1-3         Access: Open Access Read More

Author(s): Ram Ashish Maurya, Riya Tiwari, Aayush Vikram Singh

DOI: 10.55878/SES2025-5-2-7         Access: Open Access Read More

Author(s): Jatin Bora, Dharmesh Lodhi, Arpita Gupta

DOI: 10.55878/SES2025-5-1-8         Access: Open Access Read More

Author(s): Rishav Raj, Dinesh Kumar Yadav

DOI: 10.55878/SES2025-5-1-6         Access: Open Access Read More

Author(s): Anmol Nagar, Sheetal Nagar

DOI: 10.55878/SES2025-5-1-9         Access: Open Access Read More

Author(s): Achitya Srivastava, Arpit Dubey, Dev Prakash, Surendra Kumar

DOI: 10.55878/SES2025-5-1-5         Access: Open Access Read More

Author(s): Rishabh Raj, Ritesh Kumar, Shubham Kumar

DOI: 10.55878/SES2025-5-2-9         Access: Open Access Read More

Author(s): Anush Kumar Singh, Ankit Kumar, Surendra Kumar

DOI: 10.55878/SES2025-5-2-14         Access: Open Access Read More

Author(s): Lalit Pal, Prince Kumar, Praveen Kumar

DOI: 10.55878/SES2025-5-2-8         Access: Open Access Read More