0% found this document useful (0 votes)
14 views6 pages

report

The document outlines the design and functionality of an Arduino-based maze-solving robot that utilizes ultrasonic sensors for navigation. It details the hardware components, programming structure, and algorithms employed for obstacle avoidance and pathfinding. The robot serves as an educational tool while demonstrating potential applications in various automated systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views6 pages

report

The document outlines the design and functionality of an Arduino-based maze-solving robot that utilizes ultrasonic sensors for navigation. It details the hardware components, programming structure, and algorithms employed for obstacle avoidance and pathfinding. The robot serves as an educational tool while demonstrating potential applications in various automated systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Name Class Student Code

Nguyễn Minh Thành 22ES 123220070

Technical Report: Versatile Arduino-Based


Maze-Solving Robot System with Ultrasonic
Sensors

*Introduction
The Arduino-powered maze-solving robot stands as a notable educational and
research apparatus in robotics and automation. Employing an array of ultrasonic
sensors coupled with an Arduino controller, this robot is adept at navigating
complex maze environments. This not only deepens the understanding of
programming and automated system design for students, enthusiasts, and tech
aficionados but also teaches problem-solving skills in unpredictable and dynamic
settings.
Practically, the robot's autonomous navigation capabilities have broader
applications, such as in automated vacuum cleaners, industrial site autonomous
vehicles, and even in exploratory vehicles on challenging terrains like Mars, where
human-independent navigation is critical.

*Hardware Components
-Arduino UNO: This central processing unit interprets sensor inputs and
orchestrates motor responses for navigation.
- Ultrasonic Sensor HC-SR04:This sensor offers precise distance measurements,
enabling the robot to interact effectively with its surroundings.
- L298N Motor Driver Module: This module controls motor power, facilitating
adjustments in the robot's speed and directional movement.
*Circuit Layout

*Software and Programming with Arduino

- Programming Language: The Arduino utilizes a C++-based language, offering


programmers the robustness and versatility of C++ for crafting intricate programs.
The object-oriented nature of C++ aids in developing reusable components,
boosting development efficacy and maintainability.
-Arduino IDE: The Integrated Development Environment (IDE) of Arduino
presents a user-friendly platform for novices and a robust suite of tools for
seasoned developers. It streamlines the processes of code development,
compilation, and deployment to the Arduino board.
-Code Implementation
The robot's code, grounded in C++, continuously processes ultrasonic sensor data
to determine motor actions. This involves sophisticated data interpretation, such as
gauging distances and formulating navigational algorithms for optimal pathfinding.

*Variable and Function:


Variable Declarations
- Ultrasonic Sensor Pins : `trig1`, `echo1`, `trig2`, `echo2`, `trig3`, `echo3` are
pin assignments for three ultrasonic sensors. These sensors will emit and receive
ultrasonic waves to measure distances.
- Motor Control Pins: `in1` to `in4` are for controlling the direction of motor
rotation, while `ENA` and `ENB` are for controlling the speed of two motors.
- Speed and Distance Variables: `LeftSpeed`, `RightSpeed` represent motor
speeds. `leftDistance`, `middleDistance`, `rightDistance` store the distance
readings from each sensor. `pingTime` and `distance` are used in distance
calculation. `speedSound` is the speed of sound, used in distance calculations.
- Threshold Distance: `DIS` is a threshold distance for obstacle detection.

Functions for Distance Measurement


- `leftMeasurement()`, `middleMeasurement()`, `rightMeasurement()`: These
functions trigger their respective ultrasonic sensors and calculate the distance
based on the time taken for the ultrasonic pulse to return.

Setup Function
- `setup()`: Initializes serial communication, sets pin modes, and ensures the robot
is stationary at startup.
Main Loop Function
-` loop()`: The core logic where distances are measured continuously. Depending
on these distances, the robot decides to move forward, backward, turn left, turn
right, or stop.

Movement Functions
- `moveForward()`, `moveBackward()`, `turnRight()`, `turnLeft()`,
`moveStop()`: These functions control the robot's movements. They use
`analogWrite()` for speed control and `digitalWrite()` for direction control.

Decision Logic in Loop


- The robot reacts based on the distance from obstacles:
- If there's an obstacle on one side, it turns to the other side.
- If there's an obstacle in front, it decides to turn left or right based on the
distances on its sides.
- If obstacles are detected on all sides, it stops, moves backward, and then turns
around.
- In the absence of nearby obstacles, it moves forward.

Code Structure and Efficiency


- Modular: The code is well-structured into functions for different tasks,
enhancing readability and maintainability.
- Efficient Distance Measurement: By using ultrasonic sensors, the robot can
make relatively accurate and quick decisions about its environment.
- Delays: The use of `delay()` might introduce some response lag but is necessary
for sensor stability.

*Algorithmic Framework
- Navigation Algorithm: The robot employs the "Wall Follower" technique, a
prevalent maze-solving strategy, where it keeps adjacent to a maze wall for
guidance.
- Obstacle Avoidance Algorithm: Upon encountering an obstacle, the robot
evaluates distances using its tri-directional sensors and opts for the most open path,
ensuring uninterrupted navigation.
*Testing and Assessment
The robot undergoes thorough testing in obstacle-laden environments to evaluate
the navigation algorithm's efficiency, pinpointing system strengths and areas for
improvement.

*This is the Program when Code runs

*Outcomes
The testing phase demonstrates the efficacy of the "Wall Follower" algorithm in
simple mazes, suggesting the need for algorithmic refinement for more intricate
maze configurations.
*Conclusion
Beyond its educational value, the maze-solving robot showcases potential in real-
world applications that demand sophisticated automation and independent
navigation. The use of Arduino and C++ ensures flexible system integration and
expansion, setting a robust foundation for progressive educational and research
endeavors.

You might also like