Obstacle detection and avoiding robots are intelligent robots that can perform desired tasks in an unstructured environment by finding and overcoming obstacles in their way without continuous human guidance.
CIRCUIT DESIGN:
STEP 1: Robot chassis DC motors connection to Motor Shield
Each motor has +ve and –ve terminals. Two +ve and –ve terminals of both left-side and right-side DC motors are shorted separately to be connected to the ports of motor shield A+, A-( 2 +ve terminals of left side DC motors are connected to A+ and 2 -ve terminals of left side DC motors are connected to A-) and B+, B-( 2 +ve terminals of right-side DC motors are connected to B+ and 2 -ve terminals of right-side DC motors are connected to B-) respectively.
L298P Motor Driver Shield |
STEP 2: Servo motor connection
We used the Servo motor, Tower Pro SG90 9G Micro Small Servo Motor, to control movement 0-180 degrees. This controls the ultrasonic head movement for sensing an obstacle. It has three wires:
Red = +5v
Brown = GND
Orange = Signal (pin 10 for our code)
STEP 3: Ultrasonic Sensor Connection
The ultrasonic sensor we used was HC-SR04. It consists of 4 wires for the following connection:
STEP 4: Horn and Light Connection
Horn and Light we used here. It consists of 3 wires for the following connection:
We completed our circuit designing of the Obstacle Avoidance Robot by following the above procedure.
Working Principle of this Obstacle Avoiding Robot
The Obstacle avoiding Robot we created was mainly based on the working principle of
Ultrasonic sensor. Our Robot initially moves forward until it gets any kind of Obstacle. During driving, every time, it will check if there is any obstacle nearby by continuously sending and receiving distance-related information. The Trig pin will be used to send the signal, and the Echo pin will be used to listen for returning signal.
So, we see an object closer than 30 cm to our Robot. The check has two possible outcomes, yes or no. Yes, meaning that there is indeed some object closer than 30 cm. No, meaning that there are no objects detected within 30 cm. If nothing is within 30 cm, the Robot can simply move forward as the path is clear. If there is something closer than 30 cm, the Robot must perform obstacle avoidance maneuvers.
Another check occurs to see what direction is the best way to go. If left is the way to go, it has to turn back to the left and go forward. If the right is the way to go, the Robot simply moves forward as it is already facing the right direction.
All we have done is convert that diagram into Arduino code, and that's it. So, quickly, the obstacle avoidance code was done.
Flow Diagram of Arduino Obstacle Avoiding Robot |
Arduino Code for Obstacle Avoiding Robot:
Physical Obstacle Avoiding Robot:
Obstacle Avoiding Robot using Arduino and L298P |
Can i use arduino UNO replace mega?
ReplyDeleteOf course, we can use Arduino UNO in this project. You can also use Arduino Pro Mini or Arduino MINI. Because only a few IO pins we need for obstacle avoiding robot. So feel free to play with different Arduino boards. Thanks for your comment.
DeletePost a Comment