Are you are a Robotics Lover?
What is Edge Avoider Robot?
It is a type of Robot which can detect edges and the move backwards.
When there is any edge the IR sensor detects it and sends information to the Arduino to move robot backwards.
If you can move it forward and there is any edge, it will move backwards automatically.
Want to make your own Robot?
Then you are in right Blog.
In this Blog I'll show you How to make Edge Avoiding Robot easily.
IR sensor pic:-
Active infrared sensors both emit and detect infrared radiation. Active IR sensors have two parts: a light emitting diode (LED) and a receiver. When an object comes close to the sensor, the infrared light from the LED reflects off of the object and is detected by the receiver.
If you want to make this Robot
First buy components from below Amazon India links
Parts List:-
1. Arduino Uno: https://amzn.to/3mmP143
2. L293D Motor driver : https://amzn.to/3uCpffT
3. IR Sensors (2 pieces) : https://amzn.to/2YiRzbs
4. DC motor (4 pieces) : https://amzn.to/3ivUtQU
5. Robot Chassis : https://amzn.to/3Bf3tkI
6. 18650 battery: https://amzn.to/3mqkAcX
7. Android Device
Here is the video of this Project:-
Steps to make this Project:
1. Gather components.
2. Take car chassis and make robot car.
3. Place Arduino and L293D motor driver on it.
4. Place both IR sensors.
5. Connect Bluetooth module..
6. Do connections from circuit diagram.
7. Install Android app from below link.
8. Connect Hc-05
9. Open app and then play with car.
Your Project is done.
Circuit Diagram:-
Copy the Arduino Code and Just paste it in Arduino IDE
// https://www.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g //
// Edge Avoider Robot //
// By MOHD SOHAIL //
#include <AFMotor.h>
#define IR1 A2
#define IR2 A1
AF_DCMotor motor1(1, MOTOR12_1KHZ);
AF_DCMotor motor2(2, MOTOR12_1KHZ);
AF_DCMotor motor3(3, MOTOR34_1KHZ);
AF_DCMotor motor4(4, MOTOR34_1KHZ);
char command;
void setup()
{
Serial.begin(9600); //Set the baud rate to your Bluetooth module.
pinMode(IR1, INPUT);
pinMode(IR2, INPUT);
}
void loop(){
if(Serial.available() > 0){
command = Serial.read();
Stop();
Serial.println(command);
switch(command){
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
case 'S':
Stop();
break;
}
int Right = digitalRead(IR1);
int Left = digitalRead(IR2);
if(Right == 1 || Left == 1 ) {
motor1.setSpeed(255);
motor1.run(BACKWARD);
motor2.setSpeed(255);
motor2.run(BACKWARD);
motor3.setSpeed(255);
motor3.run(BACKWARD);
motor4.setSpeed(255);
motor4.run(BACKWARD);
}else if(Right == 0 || Left == 0) {
command = Serial.read();
}
}
}
void forward()
{
motor1.setSpeed(150); //Define maximum Speed
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(150); //Define maximum Speed
motor2.run(FORWARD); //rotate the motor clockwise
motor3.setSpeed(150);//Define maximum Speed
motor3.run(FORWARD); //rotate the motor clockwise
motor4.setSpeed(150);//Define maximum Speed
motor4.run(FORWARD); //rotate the motor clockwise
}
void back()
{
motor1.setSpeed(150); //Define maximum Speed
motor1.run(BACKWARD); //rotate the motor anti-clockwise
motor2.setSpeed(150); //Define maximum Speed
motor2.run(BACKWARD); //rotate the motor anti-clockwise
motor3.setSpeed(150); //Define maximum Speed
motor3.run(BACKWARD); //rotate the motor anti-clockwise
motor4.setSpeed(150); //Define maximum Speed
motor4.run(BACKWARD); //rotate the motor anti-clockwise
}
void left()
{
motor1.setSpeed(200); //Define maximum Speed
motor1.run(BACKWARD); //rotate the motor anti-clockwise
motor2.setSpeed(200); //Define maximum Speed
motor2.run(BACKWARD); //rotate the motor anti-clockwise
motor3.setSpeed(200); //Define maximum Speed
motor3.run(FORWARD); //rotate the motor clockwise
motor4.setSpeed(200); //Define maximum Speed
motor4.run(FORWARD); //rotate the motor clockwise
}
void right()
{
motor1.setSpeed(200); //Define maximum Speed
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(200); //Define maximum Speed
motor2.run(FORWARD); //rotate the motor clockwise
motor3.setSpeed(200); //Define maximum Speed
motor3.run(BACKWARD); //rotate the motor anti-clockwise
motor4.setSpeed(200); //Define maximum Speed
motor4.run(BACKWARD); //rotate the motor anti-clockwise
}
void Stop()
{
motor1.setSpeed(0); //Define minimum Speed
motor1.run(RELEASE); //stop the motor when release the button
motor2.setSpeed(0); //Define minimum Speed
motor2.run(RELEASE); //rotate the motor clockwise
motor3.setSpeed(0); //Define minimum Speed
motor3.run(RELEASE); //stop the motor when release the button
motor4.setSpeed(0); //Define minimum Speed
motor4.run(RELEASE); //stop the motor when release the button
}
Download and Install the Android Application from below link
Android App link : https://cutt.ly/1EKc75g
0 Comments