How to make a LINE FOLLOWING WITH OBSTACLE AVOIDING ROBOT/ ARDUINO LINE FOLLOWING ROBOT/ smart robot

Поділитися
Вставка
  • Опубліковано 31 гру 2024

КОМЕНТАРІ • 261

  • @hassanarif127
    @hassanarif127 6 років тому +8

    can it work with only two motors and wheels?

    • @MAKERQ
      @MAKERQ  6 років тому +1

      Hassan Arif yes it will work with 2 wheels

    • @hassanarif127
      @hassanarif127 6 років тому +2

      Thanks i tried and it works. Although i must say that the code had a few extra things which were not needed at all (at-least not in my case) so i made a few modifications to the code and now it works like a charm :)
      *Thanks Again*

    • @neilmitra4627
      @neilmitra4627 6 років тому

      Excuse me, if it is possible could you please send me the edited code ( in the comment section here)

    • @hassanarif127
      @hassanarif127 6 років тому +1

      Well i edited the code for only two motors at first, but later on i added two more motors for which the code provided by makerQ worked perfectly. All i edited in the code was the delay timings, and deleted a while loop, not any other major modification that i can remember, but unfortunately i don't have that code anymore, but if you can tell me the problem you're facing with this code i might be able to help.

    • @neilmitra4627
      @neilmitra4627 6 років тому

      So the thing that is happening is that my wheels are continuously moving backwards, unable to follow a line, and unable to avoid obstacles, what I did was that I just removed the while loop from the code giving me this:
      #include //Ultrasonic sensor function library. You must install this library
      int vSpeed = 110;
      int turn_speed = 230; // 0 - 255 max
      int t_p_speed = 125;
      int stop_distance = 12;
      int turn_delay = 10;
      //HC-SR04 Sensor connection
      const int trigPin = 11;
      const int echoPin = 12;
      //L293 Connection
      const int motorA1 = 3;
      const int motorA2 = 4;
      const int motorAspeed = 5;
      const int motorB1 = 7;
      const int motorB2 = 8;
      const int motorBspeed = 6;
      //Sensor Connection
      const int left_sensor_pin =9;
      const int right_sensor_pin =10;
      int turnspeed;
      int left_sensor_state;
      int right_sensor_state;
      long duration;
      int distance;
      void setup() {
      pinMode(motorA1, OUTPUT);
      pinMode(motorA2, OUTPUT);
      pinMode(motorB1, OUTPUT);
      pinMode(motorB2, OUTPUT);
      pinMode(trigPin, OUTPUT);
      pinMode(echoPin, INPUT);
      Serial.begin(9600);
      delay(3000);
      digitalWrite(trigPin, LOW);
      delayMicroseconds(2);
      digitalWrite(trigPin, HIGH);
      delayMicroseconds(10);
      digitalWrite(trigPin, LOW);
      duration = pulseIn(echoPin, HIGH);
      distance= duration*0.034/2;
      Serial.print("Distance: ");
      Serial.println(distance);
      left_sensor_state = digitalRead(left_sensor_pin);
      right_sensor_state = digitalRead(right_sensor_pin);
      if(right_sensor_state == HIGH && left_sensor_state == LOW)
      {
      Serial.println("turning right");
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,LOW);
      digitalWrite(motorB2,HIGH);
      analogWrite (motorAspeed, vSpeed);
      analogWrite (motorBspeed, turn_speed);
      }
      if(right_sensor_state == LOW && left_sensor_state == HIGH)
      {
      Serial.println("turning left");
      digitalWrite (motorA1,HIGH);
      digitalWrite(motorA2,LOW);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      analogWrite (motorAspeed, turn_speed);
      analogWrite (motorBspeed, vSpeed);
      delay(turn_delay);
      }
      if(right_sensor_state == LOW && left_sensor_state == LOW)
      {
      Serial.println("going forward");
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      analogWrite (motorAspeed, vSpeed);
      analogWrite (motorBspeed, vSpeed);
      delay(turn_delay);
      }
      if(right_sensor_state == HIGH && left_sensor_state == HIGH)
      {
      Serial.println("stop");
      analogWrite (motorAspeed, 0);
      analogWrite (motorBspeed, 0);
      while(true){
      }
      }
      if(distance < stop_distance)
      {
      digitalWrite (motorA1,HIGH);
      digitalWrite(motorA2,LOW);
      digitalWrite (motorB1,LOW);
      digitalWrite(motorB2,HIGH);
      delay(250);
      analogWrite (motorAspeed, 0);
      analogWrite (motorBspeed, 0);
      delay(500);
      digitalWrite (motorA1,HIGH);
      digitalWrite(motorA2,LOW);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      analogWrite (motorAspeed, t_p_speed);
      analogWrite (motorBspeed, t_p_speed);
      delay(900);
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      analogWrite (motorAspeed, t_p_speed);
      analogWrite (motorBspeed, t_p_speed);
      delay(800);
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,LOW);
      digitalWrite(motorB2,HIGH);
      delay(900);
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      delay(700);
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,LOW);
      digitalWrite(motorB2,HIGH);
      delay(650);
      digitalWrite (motorA1,LOW);
      digitalWrite(motorA2,HIGH);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      left_sensor_state == HIGH;
      while(left_sensor_state == LOW){
      left_sensor_state = digitalRead(left_sensor_pin);
      right_sensor_state = digitalRead(right_sensor_pin);
      Serial.println("in the first while");

      }
      digitalWrite (motorA1,HIGH);
      digitalWrite(motorA2,LOW);
      digitalWrite (motorB1,LOW);
      digitalWrite(motorB2,HIGH);
      delay(100);
      digitalWrite (motorA1,HIGH);
      digitalWrite(motorA2,LOW);
      digitalWrite (motorB1,HIGH);
      digitalWrite(motorB2,LOW);
      delay (500);
      }
      }
      void loop() {
      }
      But what's happening is that the motors/wheels continuously move backwards, unable to do anything else. Please help and thank you for the kind reply!

  • @MAKERQ
    @MAKERQ  6 років тому +3

    If it's not working delete the while loop in the code and try again

  • @MAKERQ
    @MAKERQ  6 років тому

    The while loop will stop the car , it is used to stop at the end, if your car is not moving delete that while loop

    • @vimalabaskar2410
      @vimalabaskar2410 6 років тому

      MAKER Q
      I want a coad now pls

    • @rizalagustian_k2373
      @rizalagustian_k2373 2 роки тому

      I'm using arduino uno for this project but the robot won't run at all, you said you have to delete the while loop first but I don't know where the while loop is, please show me 🙏🙏

  • @Tech_Insights_with_Saha
    @Tech_Insights_with_Saha 5 років тому +3

    1:25 Thnx i need this only 💗

  • @vishalshukla5363
    @vishalshukla5363 4 роки тому

    can you let me know if it drives in revers after completing the line in to point b and ten it comes back to point a in a line with obstacles.

  • @daniwagaye4930
    @daniwagaye4930 6 років тому +4

    are you sure the code is correct

  • @latachavan9013
    @latachavan9013 3 роки тому +1

    Arduino nano programing not open in to the description please give me the programing

  • @relaxingandrefreshingvideo801
    @relaxingandrefreshingvideo801 5 років тому +2

    bro motos are not rotating???

  • @bharathkumarreddy1635
    @bharathkumarreddy1635 6 років тому +2

    my motors are not moving.please help me

  • @bimalxaviour8464
    @bimalxaviour8464 6 років тому

    Which battteries do you use

  • @smtechnomind4949
    @smtechnomind4949 4 роки тому

    sir kya hum iss project me arduino uno use kr sakte hai kya with l298n and isake connection kaise rahenge with arduino uno.

  • @raghavnaikdessai6577
    @raghavnaikdessai6577 5 років тому

    Can we use arudino uno insted of arudino nano

  • @unitedrobotics7377
    @unitedrobotics7377 4 роки тому

    Is the output of the ir sensor is low or high?? Please answer..

  • @shalinimondal779
    @shalinimondal779 6 років тому

    Please tell while loop wala portion kitna tak delete karna hoga please

  • @artiwaghmare862
    @artiwaghmare862 5 років тому +1

    The code is not appearing... plz send this code.. sr...

  • @premadwivedi1616
    @premadwivedi1616 6 років тому +1

    What kind of battery I can use instead of 18650 battery plz tell me sir

  • @thrillsconnect2494
    @thrillsconnect2494 6 років тому

    Will the cose work with ardiuno uno

  • @joeycerafice7843
    @joeycerafice7843 6 років тому

    any idea how to fix a problem where only the front left and back left wheels are working.

  • @JahangirAlam-gs6uq
    @JahangirAlam-gs6uq 5 років тому +1

    Can i use arduino uno?

  • @jitendrakumardash3142
    @jitendrakumardash3142 6 років тому

    Can I use arduino uno instead of arduino nano?

  • @ayaismeal4647
    @ayaismeal4647 3 роки тому

    do you have the same code using raspberry ?

  • @1man4tech47
    @1man4tech47 6 років тому +1

    Can you provide for l298d with program . I was typing to change your program but I cannot make.

  • @tanishtated1926
    @tanishtated1926 5 років тому

    what we can write in behalf of c/cc+ which is written in code

  • @RomsTech
    @RomsTech 6 років тому +1

    Hello
    Sir the car is not moving just upload the edited program or plz mail it to me i need it for my ptoject plz reply soon as soon possible i am waiting...........

  • @mohammednisthar7659
    @mohammednisthar7659 4 роки тому

    Can you explain me what to do when only the obstacle avoidance works and the line follower doesn't works

  • @marshrodrigues8116
    @marshrodrigues8116 5 років тому

    can i erase the old program of line following and use this new given program

  • @ramubj1652
    @ramubj1652 4 місяці тому

    Where we want to delete while loop in the code

  • @eswarchandu2122
    @eswarchandu2122 5 років тому

    is it work with power bank?

  • @rizalagustian_k2373
    @rizalagustian_k2373 2 роки тому

    I'm using arduino uno for this project but the robot won't run at all, you said you have to delete the while loop first but I don't know where the while loop is, please show me 🙏🙏

  • @ShubhamGupta-bs5rh
    @ShubhamGupta-bs5rh 5 років тому

    In place of Arduino Uno can I use Arduino nano

  • @relaxingandrefreshingvideo801
    @relaxingandrefreshingvideo801 5 років тому

    reply brooooooooooo if obstacle is there again after turning left, what to do?

  • @fazalmohammad6176
    @fazalmohammad6176 6 років тому

    Where we have to write 'if' in the delay to come to line?

  • @aneesh2092
    @aneesh2092 5 років тому

    Can I know the circuit diagram with pro mini aurdino

  • @huythang3478
    @huythang3478 6 років тому +1

    can it work with arduino uno r3?

  • @maartengevers7800
    @maartengevers7800 6 років тому +1

    can you plz send the code i need to make some thing similar for school and it whould help a lot
    thank u

  • @dimplebhootra4730
    @dimplebhootra4730 6 років тому

    Is it the same with arduino uno

  • @hasithasandeepa604
    @hasithasandeepa604 6 років тому

    Sir...,How I can use Pid Control for this car...?

  • @mohammedjubaed968
    @mohammedjubaed968 6 років тому

    Maker Q help me when i clicked the link of code it shows (No preview available)what can i do now???

  • @bahaaeldin2656
    @bahaaeldin2656 4 роки тому

    can it be made with python?
    i have been trying for 2 days to recreate it with python and rpi but no luck

  • @sankalpjadhav4147
    @sankalpjadhav4147 5 років тому

    Can you plz share the list of all components required for this whole project and even the program we have a project based on this!
    Please sir

  • @deepakbains6755
    @deepakbains6755 6 років тому +1

    sir i want to make all in one .bluetooth controlled +line following + obstacle avoidance ..please help in code or make a video of all in one ..

    • @TheDutchGamingBE
      @TheDutchGamingBE 5 років тому

      You just have to buy a bluetooth module, connect it to the arduino, compile a bluetooth app to control the car. After all that, compile a code for the arduino so that the bluetooth module on the car can give orders to the arduino board that controls the car

  • @tejasoke655
    @tejasoke655 5 років тому

    Can we use Arduino Uno instead of nano

  • @mobilehelp4208
    @mobilehelp4208 4 роки тому

    What weight bear this car

  • @prabhavatikeny1375
    @prabhavatikeny1375 6 років тому

    Without any programming circuit led is on or not

  • @AnuragYadav-cp6xn
    @AnuragYadav-cp6xn 6 років тому

    Muje avoid hatha k buzzer use karna hai kaise hoga

  • @saumtallyshahanahwardah8279
    @saumtallyshahanahwardah8279 6 років тому

    Am using a L293D is it a problem and am having a problem the robot look like its about to move but stop , can u help me

    • @MAKERQ
      @MAKERQ  6 років тому +1

      Have you removed the while loop from the code?

    • @saumtallyshahanahwardah8279
      @saumtallyshahanahwardah8279 6 років тому

      Yess sir but it is not moving at all, can you send me you email address so that i can send you my codes and tell me what am doing wrong .

  • @sugumarvelu2079
    @sugumarvelu2079 2 роки тому

    Sir what is the rpm of the motor

  • @1man4tech47
    @1man4tech47 6 років тому

    bro how you have taken motor connections in program

    • @MAKERQ
      @MAKERQ  6 років тому

      What you mean?

  • @zalriego298
    @zalriego298 Рік тому

    This the code updated?

  • @kidtronics8437
    @kidtronics8437 6 років тому

    love you sir...we went more cool project from you sir..

  • @muhammadmehedihasanshishir9017
    @muhammadmehedihasanshishir9017 6 років тому

    Can it work with 9V battery and using 2 motors?

    • @achrafnatouss4622
      @achrafnatouss4622 5 років тому

      if you have code correct pls help me belkadirac@gmail.com

  • @ghatkarinagesh6173
    @ghatkarinagesh6173 2 роки тому

    Is their any code to do this

  • @arjunajee5167
    @arjunajee5167 4 роки тому

    How can i get the items

  • @latachavan9013
    @latachavan9013 3 роки тому +1

    Sir please give me the Arduino nano programing

  • @k53_adityakumar6
    @k53_adityakumar6 6 років тому

    Bhai Tim mast hai love you, are the best man, good luck for your work, thanks for the video, keep it up, nice cool bro.......!!!!!!!!!!!

  • @1man4tech47
    @1man4tech47 6 років тому

    I mean that can we use l298d instead of l298n

    • @MAKERQ
      @MAKERQ  6 років тому

      L298D OR L293D?

    • @1man4tech47
      @1man4tech47 6 років тому

      L298d

    • @jibinsaju1
      @jibinsaju1 5 років тому

      1 MAN 4 TECH Bro..will this project actually work ?

  • @youdisteve2918
    @youdisteve2918 6 років тому

    what is the type of arduino you used in this car?

    • @MAKERQ
      @MAKERQ  6 років тому

      Yudhi Ardian Arduino nano

  • @harishtwo52
    @harishtwo52 6 років тому

    If I use arduino UNO instead of arduino nano then can I use the same codes or different codes are needed?

  • @shivanshbansal7388
    @shivanshbansal7388 6 років тому

    can i use arduino uno instead of nano

  • @vantakulasairam5401
    @vantakulasairam5401 5 років тому

    hello! I made it. but, It's not following line and also not detecting obstacles. just moving in different directions. can you please help me!

  • @k53_adityakumar6
    @k53_adityakumar6 5 років тому

    Amazing you are mind-blowing

  • @sab_tech
    @sab_tech 6 років тому

    hi MAKER Q
    i'm using adafruit motor shield can you give me the program for that plsplspslspls
    i have school exhibition

  • @1man4tech47
    @1man4tech47 6 років тому

    Sir you battery is of how much voltage

    • @MAKERQ
      @MAKERQ  6 років тому

      +1 MAN 4 TECH 7.4v

  • @itzmeathul7836
    @itzmeathul7836 4 роки тому +1

    Bro ith malayalathil oru vdo cheyyoo plzzzzx

  • @prasannalaxmi1249
    @prasannalaxmi1249 6 років тому

    Can you do with arduino uno plrase

  • @abhisheksahoo9229
    @abhisheksahoo9229 3 роки тому

    Sir can I use Arduino Uno

  • @AbelJiss
    @AbelJiss 2 місяці тому

    What is program program link

  • @jasonflores8734
    @jasonflores8734 5 років тому

    what are materials for this project? need asap

  • @gangstergamingyt2864
    @gangstergamingyt2864 4 роки тому

    Nan robotics und pakshe corono aayathukond nadannilla nan colour sorter aake cheythu

  • @Durgesh_OeM
    @Durgesh_OeM 5 років тому

    While compiling code through mobile application ArduinoDroid it says error
    What should I do

    • @TheDutchGamingBE
      @TheDutchGamingBE 5 років тому

      Maybe the library in which you're compiling the code ?

  • @piyushv5739
    @piyushv5739 6 років тому

    Plzz tell if it is working so I can make my science model

  • @samkitjain148
    @samkitjain148 6 років тому

    the code is unspportive....what should I do?

  • @jabedomor887
    @jabedomor887 6 років тому

    the code is error....why?? expected initializer void

  • @shakirmppnd5401
    @shakirmppnd5401 3 роки тому

    How many total expensive bro

  • @dhruvpanchal1359
    @dhruvpanchal1359 6 років тому

    Bhai code ka link open kiya to no preview available aa raha h kya karr

  • @shekhartandel4547
    @shekhartandel4547 4 роки тому

    Can you pls send me the code for only two motors pls

  • @Secret.words.p
    @Secret.words.p 3 роки тому

    U dont have Instagram?

  • @siddhantindave6391
    @siddhantindave6391 6 років тому

    kadak re bhava

  • @muhaiminulhaquepiyas7428
    @muhaiminulhaquepiyas7428 5 років тому

    sir your attachment code is not open .Why?plz help me

  • @manugowda3845
    @manugowda3845 6 років тому

    Can we apply program in mobile?

  • @maddukuridurgaprasad1950
    @maddukuridurgaprasad1950 6 років тому

    Can we add Bluetooth to it then send to me circuit diagrams please send me the code

  • @TRAVELLER_DEV
    @TRAVELLER_DEV 6 років тому

    Sir error occurred
    Of problem uploding to board

  • @TRAVELLER_DEV
    @TRAVELLER_DEV 6 років тому

    Sir i am student and making line following many error is occuring please help

  • @saifkhld
    @saifkhld 5 років тому

    how can i get the code

  • @abdullahmir7510
    @abdullahmir7510 4 роки тому

    super, excellent
    just wow.

  • @maddukuridurgaprasad1950
    @maddukuridurgaprasad1950 6 років тому

    I did it but motor is not running,what is the folt

  • @divyanshsao9380
    @divyanshsao9380 4 роки тому

    Sir I want to stop the robot when there is obstacles how to do that , please share another code for that please please please 🙏

    • @divyanshsao9380
      @divyanshsao9380 4 роки тому

      Please share this code without rotating it

  • @mohitmehta2023
    @mohitmehta2023 5 років тому +1

    can you give the code for arduino uno

  • @chaitanyachavan7278
    @chaitanyachavan7278 6 років тому +1

    Please make same project using Arduino Uno

  • @pazhongautomation781
    @pazhongautomation781 4 роки тому

    brother my ardioino is showing port com 3

  • @parthaprateempatra4278
    @parthaprateempatra4278 6 років тому

    Very well made

  • @1man4tech47
    @1man4tech47 6 років тому

    I have used this code in my UNO and with same pining but the modal is not working

  • @madhusudandash2859
    @madhusudandash2859 6 років тому

    sir,i am a student .I have attempt to make a line following and abstacle avoding Robot according to this video. I corectly connect all wires according to your circuit diagram and upload your codes to my arduino nano. but the Robot is not movving.why? reply me.pls pls pls pls.

  • @mohammedjubaed968
    @mohammedjubaed968 6 років тому

    I need the source coad of this

  • @prasannalaxmi1249
    @prasannalaxmi1249 6 років тому

    Can you please make the robot with arduino uno

  • @dodoashraf4014
    @dodoashraf4014 6 років тому

    The code is not appearing
    Can you send me the code,please?

  • @67omkarwaghmare28
    @67omkarwaghmare28 5 років тому

    Coding link is not working please make again.

  • @sai3217
    @sai3217 5 років тому

    Muze code nahi Mila Raha so pls help me

  • @madhusudandash2859
    @madhusudandash2859 6 років тому

    after deleting the while loop . the code is not uploading.

    • @memootto
      @memootto 6 років тому

      Using Uno and the same pin and removing the loop while , the car is not moving al all. i tried a lot of variations but does not work.

  • @relaxingandrefreshingvideo801
    @relaxingandrefreshingvideo801 6 років тому

    can u explain the working