Obstacle Avoidance Robot
Versión 1.0.2 (38,7 KB) por
Ajay Krishna Vasanthakumar
This file exchange is about an Obstacle Avoidance Robot algorithm designed in Simulink and Stateflow.
The Robot utilizes the ultrasonic sensor HC-Sr04 module to detect the obstacles. The ultrasonic sensor is mounted on the servo motor. If a obstacle is detected, the Robot stops the motion and scans in the left and right directions to the Robot. This scanning motion is achieved by rotating the servo motor in 0 and 180 degrees.
The following motion is achieved based on the conditons
Move Forward:
No obstacle is found in front of the robot
Move Left:
Obstacle detected in front of the robot. Robot Stops. Robot scans in left and right, If the left distance sensor feedback is greater than the right and the left distance from the sensor feedback is greater than the threshold distance, the Robot will turn left
Move Right:
Obstacle detected in front of the robot. Robot scans in left and right, If the right distance sensor feedback is greater than the left and the right distance from the sensor feedback is greater than the threshold distance, the Robot will turn right
Move Reverse:
Obstacle is detected, Robot Stops and rotate's the servo motor left and right to look for obstacles.
If the both left and right distance from the sensor feedback is less than threshold dsitance, the Robot moves in the reverse direction for threshold time.
Hardware Used:
Ultrasonic Sensor
Servo motor
DC Geared motors - 4Nos
L293D H bridge
Arduino UNO
3.7V Lion battery - 2Nos
Hardware Connection(Sensor/Components -> Ardunio)
- UltraSonic Sensor Echo Pin - D2
- UltraSonic Sensor Trig Pin - D4
- ServoMotor Signal Pin - D9
- HBridge In1 - D5(Left motor +ve)
- HBridge In2 - D6(Left motor -ve)
- HBridge In3 - D7(Right motor +ve)
- HBridge In3 - D8(Right motor -ve)
MATLAB tools used:
- Simulink
- Stateflow
- Simulink Support Package for Arduino Hardware
Your valuable feedback/comments will be appreciated
Citar como
Ajay Krishna Vasanthakumar (2025). Obstacle Avoidance Robot (https://es.mathworks.com/matlabcentral/fileexchange/107699-obstacle-avoidance-robot), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2020a
Compatible con cualquier versión desde R2016b
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
