How to make Edge Detecting Robot || Edge avoidance robot that never falls off the table !!!

Поделиться
HTML-код
  • Опубликовано: 26 май 2023
  • Hello friends,
    In todays video, we will learn how to make an edge detecting or edge avoidance robot. This robot detects the edges of table and avoids falling down. The project is done using arduino uno and ultrasonic sensor HR- SR04 as the main components.
    The edge detection is done using the 2 ultrasonic sensors. When both the sensors are on the top of table, the robot continues to move forward. When at least one sensor is outside the table, the robot takes a reverse and changes direction. The response time of the ardino and ultrasonic sensor is very less and edge detection is done very quickly by the ultrasonic sensor.
    The links for purchasing the items are given below.
    1. Arduino uno board : amzn.to/3RPzXw8
    2. L298N motor driver : amzn.to/3RO0F8k
    3. HC-SR04 Ultrasonic Sensor : amzn.to/3XFNCd4
    4. Motors with wheels : amzn.to/3W5EYTW
    5. 18650 battery pack :amzn.to/3ziAm3N
    6. Jumper wires : amzn.to/3xG4FB0
    Link to download code : drive.google.com/file/d/1FTYE...
    Please do watch the video .Thank you...
    Please share the video if you like it.
    🎵 Song: 'Markvard - Dreams' is under a creative commons license license.
    ruclips.net/channel/UC8zg...
    🎶 Music promoted by BreakingCopyright:
    • 🛀 Soothing & Chill Out...
    ❤❤❤~~PLEASE SUBSCRIBE TO THE CHANNEL TO SEE MORE SUCH INTERESTING VIDEOS & MAKE LEARING SCIENCE FUN~~❤❤❤
    #edgedetectingrobot #arduinoproject #scienceproject
  • НаукаНаука

Комментарии • 58

  • @jacklan4103
    @jacklan4103 7 месяцев назад +2

    I did everything and it made my robot go in circles

    • @Science_4U_
      @Science_4U_  7 месяцев назад +2

      Hi friend. I guess one motor is rotating forward and other motor is rotating backwards, which is causing the robot to go in circles. So just interchange the +ve and -ve wire connection of the motor that is rotating backward, to the motor driver board. That should solve the problem..

  • @VinKrishSolutions
    @VinKrishSolutions Год назад +1

    Nice😊👌👌

  • @kiruthikaasunder5081
    @kiruthikaasunder5081 4 месяца назад +1

    is the code can be suitable for 1
    ultrasonic sensor

  • @the3stumbleteers870
    @the3stumbleteers870 7 месяцев назад +1

    am doing it for my science exhibition :))

    • @Science_4U_
      @Science_4U_  7 месяцев назад +1

      Okay dear friend. Very happy to know that.🙂.. Please ask here if you face some problems. I can help..

    • @user-jm1vs1gh2e
      @user-jm1vs1gh2e 7 месяцев назад +1

      Bro do u live in mohali??

    • @Science_4U_
      @Science_4U_  7 месяцев назад +2

      @user-jm1vs1gh2e No friend. I live in Kerala..🙂

    • @user-jm1vs1gh2e
      @user-jm1vs1gh2e 7 месяцев назад +2

      Im sorry but I wasn't asking u😊😊

    • @Science_4U_
      @Science_4U_  7 месяцев назад +1

      @@user-jm1vs1gh2e ooh..okay..I am sorry..🙂

  • @pandaheart000
    @pandaheart000 6 месяцев назад +1

    • @Science_4U_
      @Science_4U_  6 месяцев назад +1

      Thank you dear friend..❤️

  • @telugumusicworld2786
    @telugumusicworld2786 4 месяца назад +1

    Is It can be work in nyt times without lighting

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      Yes friend. It will work in night also because it is using ultrasonic sensors which use sound waves for detecting obstacles..

  • @user-bn7wj7vs2w
    @user-bn7wj7vs2w 3 месяца назад +1

    Hi! How did you turn on and off the robot? Did you put a switch?

    • @Science_4U_
      @Science_4U_  3 месяца назад +1

      Hi friend. The battery pack that I am using is already having a small builtin switch kept on its side. So I did not have to put a separate switch.

  • @telugumusicworld2786
    @telugumusicworld2786 4 месяца назад +1

    Total program is correct or not

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      Program is correct only friend. I check the working of the code by making the project and then only upload. So there will not be any mistake in code.

  • @KanishkKR
    @KanishkKR 6 месяцев назад +1

    can i get the circuit diagram

    • @Science_4U_
      @Science_4U_  6 месяцев назад +1

      Yes.. I will make the circuit diagram nad share. Meanwhile you can watch the video and try to make this project. In the video, I am showing step by step how to make this project ..

  • @JaiphulaBarik
    @JaiphulaBarik 3 месяца назад +3

    Can you give code....

    • @Science_4U_
      @Science_4U_  3 месяца назад +1

      Hi friend. The code is already available for download from the link given in the description box..

    • @JaiphulaBarik
      @JaiphulaBarik 3 месяца назад +1

      @@Science_4U_ but that format not support to our phone...

    • @user-pu1wv9vg9q
      @user-pu1wv9vg9q 3 месяца назад +1

      ​@@JaiphulaBarik yes same problem...

    • @Science_4U_
      @Science_4U_  3 месяца назад

      @@JaiphulaBarik YOu need to install arduinodroid app in phone to open the code. You can open the code also in PC or laptop by installing IDE software.
      I will paste the code here also..
      #define trigPin1 4 // Trig Pin Of HC-SR04
      #define echoPin1 5 // Echo Pin Of HC-SR04
      #define trigPin2 6 // Trig Pin Of HC-SR04
      #define echoPin2 7 // Echo Pin Of HC-SR04
      #define MLa 8 //left motor 1st pin
      #define MLb 9 //left motor 2nd pin
      #define MRa 10 //right motor 1st pin
      #define MRb 11 //right motor 2nd pin
      long duration1, distance1, duration2, distance2 ;
      void setup() {
      Serial.begin(9600);
      pinMode(MLa, OUTPUT); // Set Motor Pins As O/P
      pinMode(MLb, OUTPUT);
      pinMode(MRa, OUTPUT);
      pinMode(MRb, OUTPUT);
      pinMode(trigPin1, OUTPUT); // Set Trig Pin As O/P To Transmit Waves
      pinMode(echoPin1, INPUT); //Set Echo Pin As I/P To Receive Reflected Waves
      pinMode(trigPin2, OUTPUT); // Set Trig Pin As O/P To Transmit Waves
      pinMode(echoPin2, INPUT); //Set Echo Pin As I/P To Receive Reflected Waves
      }

      void loop()
      {
      Serial.begin(9600);
      digitalWrite(trigPin1, LOW);
      delayMicroseconds(2);
      digitalWrite(trigPin1, HIGH); // Transmit Waves For 10us
      delayMicroseconds(10);
      duration1 = pulseIn(echoPin1, HIGH); // Receive Reflected Waves
      distance1 = duration1 / 58.2; // Get Distance
      Serial.println(distance1);
      delay(5);


      if (distance1 < 10 ) // Condition For Absence Of Obstacle
      {
      digitalWrite(MRb, HIGH); // Move Forward
      digitalWrite(MRa, LOW);
      digitalWrite(MLb, HIGH);
      digitalWrite(MLa, LOW);

      }
      else if (distance1>15) // Condition For Presence Of Obstacle
      {
      digitalWrite(MRb, LOW); //Stop
      digitalWrite(MRa, LOW);
      digitalWrite(MLb, LOW);
      digitalWrite(MLa, LOW);
      delay(5);


      digitalWrite(MRb, LOW); // Move Backward
      digitalWrite(MRa, HIGH);
      digitalWrite(MLb, LOW);
      digitalWrite(MLa, HIGH);
      delay(500);
      digitalWrite(MRb, LOW); //Stop
      digitalWrite(MRa, LOW);
      digitalWrite(MLb, LOW);
      digitalWrite(MLa, LOW);
      delay(100);
      digitalWrite(MRb, HIGH); // Move Left
      digitalWrite(MRa, LOW);
      digitalWrite(MLa, LOW);
      digitalWrite(MLb, LOW);
      delay(500);
      }
      digitalWrite(trigPin2, LOW);
      delayMicroseconds(2);
      digitalWrite(trigPin2, HIGH); // Transmit Waves For 10us
      delayMicroseconds(10);
      duration2 = pulseIn(echoPin2, HIGH); // Receive Reflected Waves
      distance2 = duration2 / 58.2; // Get Distance
      Serial.println(distance2);
      delay(5);
      if (distance2 < 10 ) // Condition For Absence Of Obstacle
      {
      digitalWrite(MRb, HIGH); // Move Forward
      digitalWrite(MRa, LOW);
      digitalWrite(MLb, HIGH);
      digitalWrite(MLa, LOW);

      }
      else if (distance2>15 ) // Condition For Presence Of Obstacle
      {
      digitalWrite(MRb, LOW); //Stop
      digitalWrite(MRa, LOW);
      digitalWrite(MLb, LOW);
      digitalWrite(MLa, LOW);
      delay(10);


      digitalWrite(MRb, LOW); // Move Backward
      digitalWrite(MRa, HIGH);
      digitalWrite(MLb, LOW);
      digitalWrite(MLa, HIGH);
      delay(500);
      digitalWrite(MRb, LOW); //Stop
      digitalWrite(MRa, LOW);
      digitalWrite(MLb, LOW);
      digitalWrite(MLa, LOW);
      delay(100);
      digitalWrite(MRb, HIGH); // Move Left
      digitalWrite(MRa, LOW);
      digitalWrite(MLa, LOW);
      digitalWrite(MLb, LOW);
      delay(500);



      }
      }

    • @Science_4U_
      @Science_4U_  3 месяца назад +1

      @@JaiphulaBarik You need to install arduinodroid app in phone to open the code..

  • @enjay9723
    @enjay9723 2 месяца назад +1

    why it is not working for me

    • @Science_4U_
      @Science_4U_  2 месяца назад +1

      Hi dear friend. What us the problem that you are facing?. Is the robot not detecting edges? Or is it not moving at all?

    • @enjay9723
      @enjay9723 2 месяца назад +1

      It's not detecting edges my friend. It always move forward. But, if I remove the ultrasonic pin, it moves backward like it detects edges

    • @Science_4U_
      @Science_4U_  2 месяца назад +1

      @@enjay9723 Hm..okay friend. It is a problem with your ultrasonic sensor. I think it is faulty. Can you just bring your hand near to the ultrasonic senzor while everything is switched on?. The motor should change direction of rotation. Is it happening like that?

  • @kaungsettthu4893
    @kaungsettthu4893 5 месяцев назад +1

    Please list components

    • @Science_4U_
      @Science_4U_  5 месяцев назад +1

      Hi friend. The component list and its purchase links are already given in the description box.🙂
      I will give the list below also..
      The links for purchasing the items are given below.
      1. Arduino uno board : amzn.eu/d/iH03OHj
      2. L298N motor driver : amzn.eu/d/bzrLeMA
      3. HC-SR04 Ultrasonic Sensor : amzn.eu/d/i5OkXM7
      4. Motors with wheels : amzn.eu/d/gGczeza
      5. 18650 battery pack :amzn.eu/d/gtI4BlO
      6. Jumper wires : amzn.eu/d/hQ1P7Mi

  • @user-jm1vs1gh2e
    @user-jm1vs1gh2e 7 месяцев назад +1

    Can I get circuit diagram

    • @Science_4U_
      @Science_4U_  7 месяцев назад +2

      Yes sure friend...I will have to draw the cicuit diagram..will do it tomorrow and share with you..🙂

    • @user-jm1vs1gh2e
      @user-jm1vs1gh2e 7 месяцев назад +2

      Thx

    • @k.v.gamers3777
      @k.v.gamers3777 7 месяцев назад +1

      Hi please share circuit diagram it's important

    • @shobhapatel7247
      @shobhapatel7247 Месяц назад

      Plz share the circuit diagram and abstract for this project

  • @shobhapatel7247
    @shobhapatel7247 Месяц назад +1

    Robot is not atleast moving

    • @Science_4U_
      @Science_4U_  Месяц назад +1

      Okay friend..Why it is not even moving could be due to poor batteries or a faulty motor driver board..

  • @shobhapatel7247
    @shobhapatel7247 Месяц назад +1

    Robot is not working

    • @Science_4U_
      @Science_4U_  Месяц назад +1

      Hi friend. Can you tell what is the exact problem?.

  • @juyoungsun5135
    @juyoungsun5135 5 месяцев назад +1

    It doesnt work. all it does is just turn left and right then go back and forth regardless of the presence of edge.

    • @Science_4U_
      @Science_4U_  5 месяцев назад +1

      Hi friend. That is because the ultrasonic sensor is not detecting properly. The ultrasonic sensors keep on measuring the distance below. If the distance below is less, that means that there is table underneath and it starts moving forward. But if it suddenly detects that distance is more, it means the edge is detected and it reverses and changes direction, to avoid falling down. In your case either one or both the ultrasonic sensors are not working. So it always measures higher distance though there is table underneath. So it keeps on reversing, change direction and moves forward.

    • @Science_4U_
      @Science_4U_  5 месяцев назад +1

      Please use tested working ultrasonic sensors and it will solve the problem, for sure..

  • @telugumusicworld2786
    @telugumusicworld2786 4 месяца назад +1

    Edge detection not detecting correctly

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      Can you explain the problem friend?. I will help you to solve it.

    • @telugumusicworld2786
      @telugumusicworld2786 4 месяца назад +1

      It was going right left not moving straightly

    • @telugumusicworld2786
      @telugumusicworld2786 4 месяца назад +1

      And also fastly moving

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      Hmm..okay friend. It is definitely because either one of the ultrasonic sensor or both the ultrasonic sensor are not working properly..You have to replace them with good one..

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      @telugumusicworld2786 If it is mpving very fast, the easiest way to reduce speed is to use battery with lower voltage..

  • @user-wf4jo3sr6d
    @user-wf4jo3sr6d 10 месяцев назад +1

    robot is not working

    • @Science_4U_
      @Science_4U_  10 месяцев назад +1

      Hello friend. Can you please tell what is the problem?. I will help you.It will definitely work if connections are given correctly and all components and sensors are working properly.

    • @Science_4U_
      @Science_4U_  10 месяцев назад +1

      Is the robot atleast moving? Or is the edge detection only is the problem?. Please tell. I will help you to solve the issue.