Robots are similar to humans but they are robust and more efficient than human beings. Similar to humans they can also sense the environment and react with the help of sensors. Because of its various applications, it is widely used in fields such as military, space exploration, manufacturing industries, etc.
In this robotics project, you will use Arduino to develop an autonomous robot which can able to detect and avoid the edges with the help of IR sensors.
Skyfi Labs gives you the easiest way to learn and build this project.
Project Description
Edge detection technology plays a major role in self-driving cars, industrial robots, rovers, etc. So in this project, you will implement this idea in a small robot. Let’s look into the components used to build this robotics project:
Arduino Uno: It is a microcontroller board which is used to build various DIY projects. Arduino can be programmed using Arduino IDE which is based on C++ programming language. Since Arduino is an open-source platform there is a huge community which is actively contributing their works in the public forum. In our project, Arduino acts as a brain which is used to control the robot autonomously.
IR sensor: Active IR sensor is used in this project to sense the edges. It consists of two elements: The IR transmitter and IR receiver. Basically, the IR transmitter emits the Infrared rays, the rays hit the obstacle and bounces back which is received by the IR receiver. Based on the intensity of the received signal the object distance is found. In our project when the robot detects an edge the intensity of the received IR rays will be very low so the robot will actuate accordingly by avoiding the edges.
BO motor: These are used as actuators for the robot. It is basically a battery-operated miniature DC motor that gives nice torque at low rpm with the help of gears.
Other components used: wheels, wood, screws, Motor driver, battery, etc.
Working
The robot is programmed accordingly that if it detects an edge it will automatically actuate the motors to avoid the edges.
Want to develop practical skills on Robotics? Checkout our latest projects and start learning for free
Project Implementation
int lm1=10;
int lm2=11;
int rm1=12;
int rm2=13;
int sl=A0;
int sr=A1;
int SlV=0;
int SrV=0;
int led=A3;
void setup()
{
pinMode(lm1,OUTPUT);
pinMode(lm2,OUTPUT);
pinMode(rm1,OUTPUT);
pinMode(rm2,OUTPUT);
pinMode(led,OUTPUT);
pinMode(sl,INPUT);
pinMode(sr,INPUT);
sTOP();
}
void loop()
{
SlV=digitalRead(sl);
SrV=digitalRead(sr);
if(SrV==LOW && SlV== LOW)
{
digitalWrite(led,LOW);
ForWard();
}
if(SrV==HIGH && SlV== HIGH)
{
digitalWrite(led,HIGH);
BackWard();
delay(400);
Right();
delay(550);
ForWard();
delay(200);
}
if(SrV==LOW && SlV== HIGH)
{
digitalWrite(led,HIGH);
BackWard();
delay(400);
Right();
delay(550);
ForWard();
delay(200);
}
if(SrV==HIGH && SlV== LOW)
{
digitalWrite(led,HIGH);
BackWard();
delay(400);
Left();
delay(550);
ForWard();
delay(200);
}
}
void ForWard()
{
digitalWrite(lm1,HIGH);
digitalWrite(lm2,LOW);
digitalWrite(rm1,HIGH);
digitalWrite(rm2,LOW);
}
void BackWard()
{
digitalWrite(lm1,LOW);
digitalWrite(lm2,HIGH);
digitalWrite(rm1,LOW);
digitalWrite(rm2,HIGH);
}
void Left()
{
digitalWrite(lm1,LOW);
digitalWrite(lm2,HIGH);
digitalWrite(rm1,HIGH);
digitalWrite(rm2,LOW);
}
void Right()
{
digitalWrite(lm1,HIGH);
digitalWrite(lm2,LOW);
digitalWrite(rm1,LOW);
digitalWrite(rm2,HIGH);
}
void sTOP()
{
digitalWrite(lm1,LOW);
digitalWrite(lm2,LOW);
digitalWrite(rm1,LOW);
digitalWrite(rm2,LOW);
}
Skyfi Labs helps students learn practical skills by building real-world projects.
You can enrol with friends and receive kits at your doorstep
You can learn from experts, build working projects, showcase skills to the world and grab the best jobs.
Get started today!
Join 250,000+ students from 36+ countries & develop practical skills by building projects
Get kits shipped in 24 hours. Build using online tutorials.
Stay up-to-date and build projects on latest technologies