Develop an Edge Detection Robot using Arduino

Published on . Written by

Edge Detection Robot

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.


Skyfi Labs Projects
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.

Read more..

SLNOTE
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.


SLLATEST
Project Implementation

  1. Chassis of the robot is build using the motors and the sensors.
  2. Connect the IR sensors to the A0 and A1 of the Arduino board where Arduino takes input from the sensor.
  3. Now connect the motors to the motor driver and then connect the motor driver output of motor 1 to 10 and 11 pin and motor 2 to 12 and 13 pin of the Arduino board.
  4. After the connection is done the required code is written and dumped into the arduino board. For reference you can check the following code:
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);

 }


SLDYK
Kit required to develop Develop an Edge Detection Robot using Arduino:
Technologies you will learn by working on Develop an Edge Detection Robot using Arduino:


Any Questions?


Subscribe for more project ideas