Header Ads Widget

Object Following Robot Code and Circuit diagram in Telugu

hey guys welcome to meworkstelugu in this we know about how to make a Object Following Robot Code and Circuit diagram

making video:

watch the below video to batter understand to do this project.



Object Following Robot components :

amazon links :
  • Arduino                          BuyNow 
  • L298N Motor driver      BuyNow  
  • ultrasonic sensor            BuyNow 
quartaz components links:  
  • Arduino                          BuyNow 
  • L298N Motor driver      BuyNow  
  • ultrasonic sensor            BuyNow 
  • Breadboard and wires    BuyNow
If you want to buy Arduino components, I am giving my affiliate links. If you buy the components using my affiliate links, it will help to our channel and website growth. so do these small help.

                              

Object Following Robot Circuit diagram:

Object Following Robot Code and Circuit diagram in Telugu

Object Following Robot  code :

#define trigpin 2
#define echopin 3

int m11=9;

int m12=11;

int m21=10;

int m22=8;

void setup()

{
Serial.begin(9600);

pinMode(m11,OUTPUT);

pinMode(m12,OUTPUT);

pinMode(m21,OUTPUT);

pinMode(m22,OUTPUT);

pinMode(trigpin,OUTPUT);

pinMode(echopin,INPUT);

}

void loop()

{

int duration,distance;

digitalWrite(trigpin,HIGH);

delayMicroseconds(1000);

digitalWrite(trigpin,LOW);

duration=pulseIn(echopin,HIGH);

distance=(duration/2)/29.1;

if(distance>=30)

{

digitalWrite(m11,LOW);

digitalWrite(m12,LOW);

digitalWrite(m21,LOW);

digitalWrite(m22,LOW);

delay(500);

}

else

{

if(distance>=15)

{

digitalWrite(m11,HIGH);

digitalWrite(m12,LOW);

digitalWrite(m21,HIGH);

digitalWrite(m22,LOW);

delay(1000);

}

else

{

digitalWrite(m11,LOW);

digitalWrite(m12,HIGH);

digitalWrite(m21,LOW);

digitalWrite(m22,HIGH);

delay(1000);

}
}
}
If you have any doubts regarding to this project, contact me on Instagram or comment on YouTube video. I will help with my best.

Post a Comment

0 Comments