Obstacle Avoidance Robot Using Ultrasonic Sensor (Proteus)

Introduction: Obstacle Avoidance Robot Using Ultrasonic Sensor (Proteus)

We generally come across obstacle avoidance robot every where. Hardware simulation of this robot is part of competition in many colleges and in many events. But software simulation of obstacle robot is rare. Even though if we can find it somewhere, the information provided by them was not at all insufficient to do our project.

So, without further delay, Let's get started !

Step 1: Introduction

If u came here , you will already know what is an obstacle avoidance robot and what does it do. In short, Obstacle Avoidance Robot is an intelligent robot, which can automatically sense and overcome obstacles on its path. For sensing an obstacle, robot needs to use sensors. The ultrasonic sensor and Ir sensor can be used for detecting objects or obstacles in between the path.

Obstacle Avoidance Robot has dynamic steering algorithm which ensures that the robot doesn't have to stop in front of an obstacle which allows robot to navigate smoothly in an unknown environment, avoiding collisions. The main motto of this robot is to avoid the accident which will generally happen in congested Areas by applying emergency brake.

Step 2: Requirements

For software simulation of obstacle avoidance robot, we need :

  1. A pc
  2. Proteus software
  3. Arduino library for proteus
  4. Ultrasonic sensor library for proteus
  5. potentiometer (available in proteus ) (POT-HG)
  6. L293D motor drive (available in proteus software)
  7. Motor - DC (available in proteus software)
  8. Virtual terminal (available in proteus software)
  9. power and ground (available in proteus software)

I have made my first Arduino robot using proteus software. I will provide the links for downloading the proteus software and required libraries for build obstacle avoidance robot. It is a obstacle avoidance using 3 ultrasonic sensors. Most of the libraries will be available in www.theengineeringprojects.com. I did lot of work on the arduino code and made the best algorithm.

Step 3: Adding Components in Proteus Software

By clicking on "p" , we can add components. Above pictures are for your reference for adding components into the schematic capture of proteus software.

Adding a library in the proteus software can be learnt using this video :

https://www.youtube.com/watch?v=hkpoSDUDMKw

Step 4: BLOCK DIAGRAM

This is the basic block diagram of our circuit using components. We are going to construct the circuit using this block diagram.

Step 5: Algorithm

This is the algorithm when you use three ultrasonic sensors. Follow this algorithm clearly, while writing your arduino code. I will provide arduino code as well, don't worry.

Algorithm Explanation :

  • start the simulation.
  • If distance between the middle sensor and the object is greater than max range then it moves forward irrespective of distance between the other two ultrasonic sensors and objects. Forward movement is strictly accepted.
  • If distance between right & middle sensor is less than max range and distance between left sensor and object is more then it moves left .
  • If distance between left & middle sensor is less than max range and distance between right sensor and object is more then it moves right
  • If all the sensors have less than max range then it checks which is greater in them. If right sensor have more distance than other two then it moves right. If left sensor have more distance than other two then it moves left. If middle sensor have more distance than other two then it moves forward. If all the sensors have equal distances then it stops.
  • If distance between right, left sensor and object are greater than max range and distance between middle sensor is less than max range then it checks which is greater in distance between right and left sensors. If right sensor distance is greater than left sensor distance then it moves right and If left sensor distance is greater than right sensor distance then it moves left.

Step 6: Circuit Diagram

Make your connections according to the above circuit diagram in the proteus software. Go through each and every connection slowly and make connections properly.

Step 7: Code

Download the below code and run it in the arduino ide before pasting it in the source code of the proteus. If any library not installed, install it by going to Sketch > Include library > Manage libraries > search the required library. Paste it in the source code of the arduino in the proteus software. you can check youtube tutorials to know how to paste the code in proteus software.


Step 8: Simulation

The above three examples shown are the robot movement in all the possible directions i.e Forward movement, Left movement, Right movement.

Step 9: Video Simulation

This is the real time simulation obstacle avoidance robot in Proteus software. I changed distance between the sensors and the objects using potentiometer attached to the ultrasonic sensor.

Step 10: Library Files

Step 11: Installation

Follow the steps in the videos to install the required softwares for simulating the obstacle avoidance robot using software.

Proteus Software :

https://www.youtube.com/watch?v=31EabTgBnG8&feature=emb_logo

Arduino Software :

https://youtu.be/TbHsOgtCMDc

Step 12:

Be the First to Share

    Recommendations

    • Anything Goes Contest

      Anything Goes Contest

    12 Comments

    2
    mmuckian99
    mmuckian99

    1 year ago

    Hi,
    Thanks for the tutorial, i followed each step.... but my Virtual Terminal is not displaying anything !!
    Could anyone help with this, I have everything connected and running as the tutorial says otherwise.

    Thanks

    0
    Karthik Bhogi
    Karthik Bhogi

    Reply 1 year ago

    Hi bro, can I know what is the error that was displayed while simulation ?? You can see them in messages box after running it. The messages box is located at the bottom left side of the window.

    Regards,
    Karthik.

    0
    mmuckian99
    mmuckian99

    Reply 1 year ago

    Hi Karthik,
    Thanks for the reply,

    There is no error except that it's not running in real time, but for some reason the 2 motors on the left are not turning at all. There is also no comment or words coming up on the virtual terminal. Let me know what you think.

    King Regards,
    James

    0
    Karthik Bhogi
    Karthik Bhogi

    Reply 1 year ago

    Hi james,

    If there is no error displayed, there may be some error on the arduino code itslef. I will share the code, project file and all with u if u can share the mail id.

    Regards,
    James.

    0
    swethagy660
    swethagy660

    Reply 1 year ago

    Could u kindly share me, If you had the proteus circuit file and
    arduino code of ...it would
    really help me completing my project
    my mail id swethagy660@gmail.com

    0
    Karthik Bhogi
    Karthik Bhogi

    Reply 1 year ago

    Sure. I will share the project today 👍

    0
    mmuckian99
    mmuckian99

    Reply 1 year ago

    mmuckian99@gmail.com !!

    If you had the proteus circuit file and arduino code it would really help!! As I tried to build myself but still not working!!
    Let me know as soon as possible as I really want this working by next week!

    0
    Prathamesh811
    Prathamesh811

    Reply 1 year ago

    Hii karthik.. I have also ty this project but arduino code is showing some error .can u please mail me the proteus file and arduino code. My mail id is dadakudale80@gmail.com

    0
    Karthik Bhogi
    Karthik Bhogi

    Reply 1 year ago

    Hi Prathamesh...I haven't seen ur message. Sorry for that. If u want, I will send it today.

    0
    jishmaav26
    jishmaav26

    1 year ago on Step 7

    how could we insert a program for dijkstras algorithm for shortest path in this code

    0
    Karthik Bhogi
    Karthik Bhogi

    Reply 1 year ago

    There is no need of dijkstras algorithm anymore. As i vary the distance between object and the robot using potentiometers, the robot moves in the direction in which distance is higher between object and bot. Also, there is threshold value and if the distance between the front sensor and object is more than threshold value, then robot will move in forward direction only irrespective of the distance between the object and left,right sensors.