Obstacle Avoidance Robot

This file exchange is about an Obstacle Avoidance Robot algorithm designed in Simulink and Stateflow.
367 téléchargements
Mise à jour 10 mars 2022

Afficher la licence

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)
  1. UltraSonic Sensor Echo Pin - D2
  2. UltraSonic Sensor Trig Pin - D4
  3. ServoMotor Signal Pin - D9
  4. HBridge In1 - D5(Left motor +ve)
  5. HBridge In2 - D6(Left motor -ve)
  6. HBridge In3 - D7(Right motor +ve)
  7. HBridge In3 - D8(Right motor -ve)
MATLAB tools used:
  1. Simulink
  2. Stateflow
  3. Simulink Support Package for Arduino Hardware
Your valuable feedback/comments will be appreciated

Citation pour cette source

Ajay Krishna Vasanthakumar (2024). Obstacle Avoidance Robot (https://www.mathworks.com/matlabcentral/fileexchange/107699-obstacle-avoidance-robot), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2020a
Compatible avec les versions R2016b et ultérieures
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.2

Added additional description about the working of the Robot

1.0.1

Added hardwre connection in Description

1.0.0