Obstacle avoidance robot using arduino, In this project Obstacle avoidance robot is designed using Arduino Uno R3. Obstacle avoidance robot is work with self intelligence if there is any hardle or obstacle in its way. It turn its direction automatically in case of any obstacle in its way. ultrasonic sensor is used to sense obstacle. The basic purpose of ultrasonic sensor is to measure distance from any obstacle in front of it. This distance measurement concept is used to change direction of robot when robot is at some distance close to handle or obstacle. HC-SR04 Ultrasonic sensor is used in this project.
HC-SR04 ultrasonic sensor for distance measurement :
ultrasonic sensor is distance measurement sensor which used ultrasonic waves to measure sensor. HC-SR04 ultrasonic sensor have ultrasonic waves transmitter and receiver which is used to measured distance with the help of reflection time of ultrasonic waves from transmitter to back into receiver. I have posted a separate article on Ultrasonic sensor interfacing with Arduino. I highly recommend you to read following article first. If you don’t know about utrasonic HC-SR04 sensor interfacing with Arduino Uno R3. because it is main part of Obstacle avoidance robot project. Check this article:
I hope that after reading above article, you know that how to measure distance using ultrasonic sensor and Arduino Uno R3. Now let’s proceed to next important part of this project that is how to interface two dc motors with Arduino Uno R3. It is very easy to interface Two DC motors with Arduino using L293D dc motor driver. Circuit diagram below shows how to connect dc motor and L293 motor driver with Arduino.
Circuit diagram of obstacle avoidance robot using Arduino :
Circuit diagram of obstacle avoidance robot using arduino is given below:
You should note that ultrasonic sensor have four pins voltage pin, ground pin , trigger pin and echo pin. L298 is a dc motor driver which is used to rotate motors in clock wise or anti clock wise direction. It is used to turn robot right, left, reverse and straight. Followings are main components of this obstacle avoidance robot using Arduino Uno R3.
Hardware components of obstacle avoidance robot:
- Arduino Uno R3
- 2 DC motors
- HC-RS04 ultrasonic sensor
- L298 Dc motor driver
Code of obstacle avoidance project :
Code for this project is written using Ardino IDE. To downland code of this project check following link:
If your code doesn’t work you also have to add motor driver library in your arduino IDE software. To download motor driver click on following link:
If you have any issue with obstacle avoidance robot project. Feel free to comment on this post.