Arduino autonomous Robot Project: A DIY obstacle avoiding robot using an SG90 servo

Поделиться
HTML-код
  • Опубликовано: 29 июн 2024
  • In this Arduino Robot project video, we are going to build an autonomous Arduino Robot that can avoid obstacles. It is a fun project and a great learning experience, so without any further delay, let's get started!
    The robot that we are going to build today is moving around and it can detect obstacles and avoid them. It uses a supersonic distance sensor to measure the distance from its front side. When it detects an obstacle, it stops, goes backward for a few cms, looks around and then it turns to the direction with the more space available. As you are going to find out, building this impressive little robot is extremely easy and fun. It will not take you more than a couple of hours from start to finish. Then you can use my code, modify it and implement your own robot behavior easily. It is a great learning experience and a great introduction to robotics for kids and adults. Let's build it!
    💻 Code & Parts: educ8s.tv/arduino-robot-easy-d...
    Want to learn to code?
    👨‍💻 Check my new RUclips channel: bit.ly/3tku2n0
    🎮 My Android Game: bit.ly/QuizOfKnowledge
  • НаукаНаука

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

  • @Educ8s
    @Educ8s  5 лет назад +14

    I hope you find this video useful. If you want to support the channel see how here: educ8s.tv/support-educ8s-tv/

    • @iamdeepakbhandari
      @iamdeepakbhandari 5 лет назад +2

      Bro can you publish a video in which we can switch autonomous to manual controlled.

    • @DhadamRobotics
      @DhadamRobotics 5 лет назад

      Good job

    • @shreyaskarsingh1835
      @shreyaskarsingh1835 5 лет назад

      I m getting error while uploading the code its says faltal error AFmotor.h: no such file or directory

    • @pulkitandpalaksharma6200
      @pulkitandpalaksharma6200 3 года назад

      @@shreyaskarsingh1835 i found same error while uploding what i do

    • @pulkitandpalaksharma6200
      @pulkitandpalaksharma6200 3 года назад

      i found error while uploding the code the directory not found can i uplod with out files

  • @alexkatsis2386
    @alexkatsis2386 7 лет назад +2

    Ευχαριστω, Finally someone explains arduino with simple terms!!!
    please keep this great work of yours for it helps people!!!

  • @alanpowell328
    @alanpowell328 7 лет назад +2

    Hi Nick,
    I've had the parts for some time but just got around to building it today. Worked first time, with one motor going slightly faster than the other. I should be able to fix this by playing with the motor offset value. Thank you for your work - I have learned a lot from your channel.
    Kind Regards
    Alan

  • @satrah101
    @satrah101 7 лет назад

    yes more robot vids, connect the small vacuum clean you built, many thanks for these videos.

  • @mariocontreras82
    @mariocontreras82 6 лет назад

    Beautiful proyect and so well explained, thanks

  • @senthilkumarraju2187
    @senthilkumarraju2187 5 лет назад

    This project is perfectly working for me👍🏽👍🏽👍🏽. Thank you. 😀😀😀😀

  • @MitzpatrickFitzsimmons
    @MitzpatrickFitzsimmons 7 лет назад +6

    Great project!
    One feature that would be great (since winter is coming) is to add a snowplow :) heheh

  • @TaRg3t222
    @TaRg3t222 7 лет назад +1

    Use the ultrasonic sensor to warn you with a light and a piezo sound generator. Of course you need to controll it wirelessy so the feature comes in use :) Great video!

  • @MaxBrainDevices
    @MaxBrainDevices 7 лет назад

    Great work. I loved to build this kind of robot on my channel

  • @danielkonat8535
    @danielkonat8535 5 лет назад

    Thank you! Good explanation and nice pics. The video helped a lot ! I would like to suggest a few edits please.
    1- The wiring for the Ultrasound Sensor needs to be corrected. The trigger and Echo pins in the diagram and in the code are inverted. The code has Trigger pin in A4, while the diagram has it in A5.
    2- If you have issues with motor not running, may be you want to remove the input MOTOR12_1KHZ from lines 7&8. See updated code below. What I found is that for most of the battery operated motors, the MOTOR12_1KHZ will create an error and a humming noise in the motor.
    AF_DCMotor motor1(1); // Removed MOTOR12_1KHZ
    AF_DCMotor motor2(3); // Removed MOTOR12_1KHZ

  • @adwaitsworld2361
    @adwaitsworld2361 2 месяца назад

    Nicely explained.thank you

  • @Bianchi77
    @Bianchi77 Год назад

    Nice info, thank you for sharing it :)

  • @nikhil4dtiwari
    @nikhil4dtiwari 5 лет назад

    Great Work sir... Thank you

  • @mysterymanyo
    @mysterymanyo 5 лет назад +2

    Awesome!!!!!!!!!!!!

  • @SuperSpuddo
    @SuperSpuddo 7 лет назад

    Great video as always. How about some sound, lights and remote control. Would be a fun Christmas present for a small child as an introduction to electronics.

  • @FranciscoRodriguezCasal
    @FranciscoRodriguezCasal 7 лет назад

    Please don't stop doing this videos!

  • @anthonybelcher8569
    @anthonybelcher8569 6 лет назад +1

    Awesome

  • @KnewLight
    @KnewLight 6 лет назад

    Great sir, one can just sense a lot of humility and knowledge in your voice! ... you are not intimidating.

  • @user-mi6ht9lm1n
    @user-mi6ht9lm1n 4 года назад

    بارك الله فيك😍❤

  • @cursoderobotica
    @cursoderobotica 7 лет назад +1

    Nice project!! For future improvements It could be awesome add a IR remote control! Good job

  • @mk_annan22
    @mk_annan22 7 лет назад +4

    I was quite successful in building it with my custom PVC board. My first success in using the Sonar Sensor. Many thanks from Bangladesh and do please, keep uploading more. Can you please upload a project on Motion/Gesture control Arduino Robot using 433MHz RF module Transmitter and Receiver plus 6-DOY GY521 Gyro Accelerometer

  • @IdeaLab1
    @IdeaLab1 7 лет назад

    very good work i like it

  • @zabi4142
    @zabi4142 6 лет назад

    great project....................

  • @trians95
    @trians95 6 лет назад

    this really help me so much
    thank you sir

    • @Educ8s
      @Educ8s  6 лет назад

      You are welcome!

  • @omarkhaled3068
    @omarkhaled3068 5 лет назад +1

    Obstakool ❤️

  • @marcuscatchpole5389
    @marcuscatchpole5389 7 лет назад

    Good video

  • @faizmohd9708
    @faizmohd9708 6 лет назад

    Ultimate

  • @MrKosxrem
    @MrKosxrem 7 лет назад

    Nice robot my friend!! Why not trying to rotate the sensor 360 degrees, in order to map the surroundings, and then deciding the exit strategy? All you need is some memory, a sampling procedure to determine the distance on each side, and basic trigonometry to determine if you have enough space to pass.

  • @KnaufL
    @KnaufL 7 лет назад

    great videos!keep up the good work. Also show us your face!

  • @swikaradhikari1623
    @swikaradhikari1623 7 лет назад

    u dont need such big motor shield just looks more messy expensive . You can use l293d motor driver ic for superb clean finish anyways nice video

  • @mog99lie
    @mog99lie 7 лет назад

    I have built this robot and it is fantastic!! The code compiled first time and I had a working robot.Thank you for the project.. One small problem is when the robot comes to a wall at a very shallow angle it does not see the obstacle. How about a right and left sensor so it can move away. I am trying to add sensors with the Ping libary but I can't make it work.. I will keep trying!!
    This is one fantastc project with lots of options..... THANK YOU!!!

  • @royal6439
    @royal6439 5 лет назад

    How did you make the circuit design and what parts did you use?
    Thanks in advance and keep the great work!

  • @jesperkleemann1333
    @jesperkleemann1333 7 лет назад +3

    Wow! I have never seen so many people without any knowlegde about Arduino trying to build an Arduino-robot.Please! To all you beginners, try and go to the Arduino site and learn a bit Arduino before making big projects and you will have more fun instead of frustration.(Sorry for bad gramma and spelling)

  • @pinsonrobotics8711
    @pinsonrobotics8711 5 лет назад

    Nice

  • @kostantinosvtv1558
    @kostantinosvtv1558 7 лет назад +3

    GOOD!!!! THANK YOU FOR THE IDEA
    ΥΟU HAVE MAKE SUBSCRIBE

  • @TutocarloCV
    @TutocarloCV 6 лет назад +1

    nice

  • @jackmanjls
    @jackmanjls 6 лет назад

    I have watched several of your vids...they are top notch.
    IDEA==>could you take this same platform and make a vid on using a remote control?

    • @Educ8s
      @Educ8s  6 лет назад

      Sure, that's coming!

  • @HX2003
    @HX2003 7 лет назад

    Awesome project! How much weight can this carry?

  • @paulsharpe7740
    @paulsharpe7740 7 лет назад

    hi great project and video how about return to home to charge it's battery. that would make it more useful and self safitiont and be a good base for other projects

  • @robobillgr
    @robobillgr 6 лет назад

    Hello, first of all this is a great video. I would like to ask about a problem of mine. For some reason sometimes it does not go straight forward. IT seems that a motors starts some ms before the other motor, Any ideas how to solve this? When i place it to move forward to seems to have a drag left or right...it does go straight.

  • @chemgreec
    @chemgreec 7 лет назад

    thanks for all the links etc it is nice to have everything in one place. I am starting now with robotics and this is my first kit, i hope it works out well

    • @Educ8s
      @Educ8s  7 лет назад

      Great! It is a very nice project to start with! If you have any problems don't hesitate to ask... Cheers!

  • @DaveLynks
    @DaveLynks 4 года назад

    Hi,
    Excellent video.
    Is it possible to implement the project so that the robot is autonomous and create routes through mapping through a device (laptop, tablet, smartphone....)?.... How would it be?
    Thank you

  • @storrho
    @storrho 6 лет назад

    Great video, helped me alot. I made a robot for a school project along with a detailed 'scription' about robots in todays society.
    Is it okay if i put your video with the sources?
    Thanks!
    PS: One question, why did you solder the wires to the motor shield when you could've put them in the arduino first to let you keep using the motor shield?

    • @TheNoobVishu
      @TheNoobVishu Год назад

      I am Coded The Same Code In Arduino In Mobile But It Is Not Working Please help Me I Have To Do For My School Project

  • @victoralfa5446
    @victoralfa5446 6 лет назад +1

    I want to attach a harrow behind it that will need stepper motor for its angular movement. how can I go about it?

  • @elve44
    @elve44 6 лет назад

    French retired I discover electronics. this tutorial is really great.
    can we have the sheme of connection of the LCD screen as well as modofications for code Encore thank you

  • @emadabuhagag222
    @emadabuhagag222 Год назад

    cool

  • @AliAbbas-vn1qh
    @AliAbbas-vn1qh 4 года назад

    Hi, thanks for the amazing tutorial. After uploading the program, the car isn't moving. Can you please help?

  • @BruGaleen
    @BruGaleen 6 лет назад

    A question. The motors I'm using may require a higher voltage than I'm using. I'm assuming that's why I can't get my code to run correctly. The sensor seems to work just fine on a test rig but does nothing on the robot. I copied and pasted the code directly from the website and connected everything correctly as in the video, and it doesn't seem to work. What might I be doing wrong? Thanks for reading. :)

  • @prateekrana1387
    @prateekrana1387 7 лет назад

    could you pls just tell me from where did you got the code which you wrote in the programming

  • @alimaster5292
    @alimaster5292 7 лет назад

    hey can this program be used for maze solving robot ? or just improving it

  • @irfanaslam5859
    @irfanaslam5859 7 лет назад +3

    sir can you make more robot videos

  • @victorkimnaquila4174
    @victorkimnaquila4174 7 лет назад

    Sir what are other capacitors that i can use in attaching to the servo?

  • @BigerBoy
    @BigerBoy 7 лет назад

    How did you add the capacitor at the end?

  • @petrcaha6214
    @petrcaha6214 6 лет назад

    As I am mechanical hobby technician, this video was very helpful for me and IP:) (Idiotic Proof), but I would need to connect more powerful el. motors, like for 12 or even 18 V DC for some grass mover, etc. Can you help with some details how to realieze it? Many thanks

  • @YashChavanYC
    @YashChavanYC 7 лет назад +1

    How can I add a remote control to it? I want to control this via Bluetooth on a smartphone, how do I interface it with the smartphone in order for the smartphone to act as a controller?

  • @geoffreyprodapro2245
    @geoffreyprodapro2245 3 года назад

    Sir I have a doubt what should the board name be given and what serial port did u connect it too

  • @prabhavshankar606
    @prabhavshankar606 6 лет назад +1

    I use everything as per shown but my L293D produce beeping noise. I am using absolutely new 9V battery . Please help me

  • @aktarhossain3261
    @aktarhossain3261 5 лет назад +1

    can i make it without programing?

  • @valdeilsonsouzasilva3781
    @valdeilsonsouzasilva3781 2 года назад

    Vc Usou Pilhas Recarregáveis nesse Projeto

  • @muhammadasri1093
    @muhammadasri1093 7 лет назад

    sir i have an idea, what about the robot follow the direction of the user..the robot follow wherever the user goes..what sensor can be use to make this idea work?

  • @harshvardhankumar9403
    @harshvardhankumar9403 7 лет назад

    You said in the video that we need 330 uf capacitors but in the list you have 100 nf and 300 uf capacitors. I am confused.

  • @claud.8676
    @claud.8676 5 лет назад

    hello sir, can you be able to limit the distance of the sensor to let say 30cm then the robot will detect obtacle thus it will move away

  • @edeepakn
    @edeepakn 4 года назад +1

    Could you make a video of Obstacle avoiding car with the access to bluetooth .My son loves to make robots with arduino he was triying to find a video at that point he saw this video.He said that he would wish to get this video with bluetooth module.

  • @user-gs1bw3oq8e
    @user-gs1bw3oq8e 7 лет назад

    Hey i need help fast im doing everything write but it says declaration of 'loop' as array of void. what does that mean?

  • @tomherd4179
    @tomherd4179 7 лет назад

    Being new to this I have a question about the code. Once uploaded to the UNO will the UNO store and hold the code. I am confused about the power connection. The USB cable provides the power and the code transfer - so how once power is removed does your robot remember the code??

    • @jesperkleemann1333
      @jesperkleemann1333 7 лет назад

      Hi! Please go to the Arduino site and learn to use Arduino before you make bigger projects.

  • @WARHERO388
    @WARHERO388 7 лет назад

    plz help me ive hooked everything up right sensor works like its supposed too but motors dont work at all only if i dc them they will spinn wont work with anything else

  • @Roscovanul2
    @Roscovanul2 5 лет назад

    Well ..I've got a problem with the Super Sonic Sensor.
    When I run the New Ping Example it would just show me some squares ...or occasionally some letters when i gently press its "eyes".
    However when i run the code that you gave us in the super sonic sensor tutorial (the one without any library) it works just fine. So I guess the problem would be at the New Ping library ? As the sensor works fine when i'm not using it. The problem is , I guess i will need the New Ping library in order to make this robot work ( for lookright() function and lookleft(function))

    • @geekfpv374
      @geekfpv374 5 лет назад

      You are not supposed to touch the tx and the rx... You could damage the sensor touching the grid..

  • @AKDesign-2050
    @AKDesign-2050 6 лет назад

    J aime

  • @uditpandit3244
    @uditpandit3244 5 лет назад

    I connected 9v to the motor shield but it's not working.
    But when I give supply through serial port it works perfect .
    Why is it so???

  • @saivigneshathipalli
    @saivigneshathipalli 3 года назад

    hello i am vignesh.......loved ur project....great thing.....i also did the same as you did it...but the motors r perfectly working....but my sensor is not detecting.....pls help me out from this plsss...thanks

  • @namankasliwal1725
    @namankasliwal1725 4 года назад

    hello, can i make this with a relay instead of a sheild

  • @devendrachowdary3424
    @devendrachowdary3424 7 лет назад

    add graphical output of utrasonic sensor like radar.

  • @satheeshaj8239
    @satheeshaj8239 6 лет назад

    A nice project, but when I made it everything was working properly only thing was that one motor was not running Pls help

  • @FFGAMER-cp5vd
    @FFGAMER-cp5vd 5 лет назад +1

    Bhi I make this but servo can direct rotate why ??????????

  • @tonibusljeta1325
    @tonibusljeta1325 3 года назад

    Hello, is it possible to install a Bluetooth device in a robot like this, and transmit information from the ultrasonic sensor back to the pc in real time, something like parking sensors in cars, and if can what software do i need for visualization?

  • @joselobo4910
    @joselobo4910 6 лет назад +2

    cant understand where exactly is the code .Could you plz help me

    • @ddx30
      @ddx30 6 лет назад

      Just look at the link under "Code of the project" it opens a page and scrolling down you'll see the link to download.

  • @GetRealwithMike
    @GetRealwithMike Год назад

    How can I get this to follow me like a puppy when it senses me in the room? Maybe using an IR camera for that instead of the/ or in addition to sonar? Can you write the code for that? Thanks

  • @athngeo
    @athngeo 6 лет назад

    The motor shield sends only 1,7 V at the right motor and it doesn't work. Meanwhile the left motor receives about 3,2 volts and runs normally. Is it a shields problem or simply there 's not enough power? I put 4x AA new batteries and the multimeter shows 5,9V. The servo and the sensor work just fine.

    • @athngeo
      @athngeo 6 лет назад

      DemSkittlesDoe You are right! I changed the motor and it works without problems.

  • @EngineeringNibbles
    @EngineeringNibbles 7 лет назад

    Don't you need a diode for motors or are these small enough for it to not be a problem ?

    • @mekiteu
      @mekiteu 7 лет назад

      Diode for what purpose? Do you mean as a safety measure like used on relais? (In that case: The motors get their polarity switched by the motor shield in order to go backwards and forwards.)
      If you didn't mean this never mind me ;)

    • @EngineeringNibbles
      @EngineeringNibbles 7 лет назад

      mekiteu w I meant for inductive spiking
      But I hadn't though about the fact that that would prevent reverse gear, so a diode isn't an option

  • @xxxd6068
    @xxxd6068 5 лет назад +2

    How to make a wall following robot

  • @bsdprojects7445
    @bsdprojects7445 5 лет назад

    hey can we leave the capacitors??

  • @Mohamed-rj8gt
    @Mohamed-rj8gt 7 лет назад

    why you put a capacitor in the dc motor?

  • @pablor123
    @pablor123 6 лет назад

    One question, how u correct the desviation caused by the aling error of the motor.

    • @dsmith5167
      @dsmith5167 6 лет назад

      Create a sloL and sloR variable. Then in the forward void subtract the sloL or R variable from the speed variable. Not perfect but will keep the bot relatively straight for short distances. See my code here. www.gertweb.com/SmartCar.html

  • @hamzahassan7730
    @hamzahassan7730 7 лет назад

    For the 330 capacitor you said "330 capacitor or similar". Can a 220 work?

    • @Educ8s
      @Educ8s  7 лет назад

      Yes, it might work. I haven't tried it though. Try it and if it does not work, use a larger capacitor.

  • @rifkykhaerul1202
    @rifkykhaerul1202 7 лет назад

    why my sensors doesnt works the only things that running only motor on the wheel

  • @abdulhaseeb3895
    @abdulhaseeb3895 7 лет назад +2

    I have uploaded the Similar code but the sensor senses late ...until it senses the robot collides with the obstacle...

    • @Educ8s
      @Educ8s  7 лет назад +1

      You can change the min distance that will make the robot to stop or update the loop function faster.

  • @xpertgamer1286
    @xpertgamer1286 6 лет назад

    Where I have to use the 100uf pin

  • @parameswaraniyer8114
    @parameswaraniyer8114 6 лет назад

    Sir,
    My robot turns at a very small angle and only to the left.
    It takes about 3 minutes for it to avoid the obstacle and move to a free space.
    plz help.

  • @croreco4795
    @croreco4795 3 года назад

    Hello, can you please help me, the robot works fine but after he passes the first obstacleand goes to the other he just goes backwards and stops, it doesnt go anywhere but the motors do sounds

  • @BigerBoy
    @BigerBoy 7 лет назад

    How to solve the reverse polarity problem ?

  • @mickeehenri674
    @mickeehenri674 3 года назад

    Is it something to do with the codes?

  • @gourishbajaj
    @gourishbajaj 7 лет назад +1

    actually I'm using 3 ultrasonic sensors !
    can u help me with the coding plzzz.... ?

  • @ignacevandevelde2733
    @ignacevandevelde2733 4 года назад

    Dear, I'm looking for a smaller ultrason sensor but I cann't find it on the internet. Please smaller then the HC04, the HC04 is to large for my project. Thanks a lot for your video's and tips etc... Hope someone can help me with a link to look at a smaller ultrason sensor.

  • @ehan1780
    @ehan1780 5 лет назад

    How many capacitor and elco?

  • @spaceisfuture169
    @spaceisfuture169 6 лет назад

    Good project.
    Sir I Need A little bit Help from your Side.
    Will You give me the Schematic Diagram of this project.
    Thanks you Sir.!!!!!!!!!!!!!!!!!!!!!!!

  • @sunithashetty7431
    @sunithashetty7431 6 лет назад

    I need circuit diagram& how volt battery is required

  • @aktarhossain3261
    @aktarhossain3261 5 лет назад

    can i programing it on android phone?

  • @NO5TAL6IC
    @NO5TAL6IC 2 года назад

    where did u get this from

  • @iannoble3354
    @iannoble3354 7 лет назад +2

    My servo and motors are not functioning well. The servo keeps rotating and my motors are not moving even I have new batteries. I am using 9 volts of battery. What is the problem? Reply please. Thanks!

    • @user-se2jc7pg1j
      @user-se2jc7pg1j 7 лет назад

      you should change batteries

    • @iannoble3354
      @iannoble3354 7 лет назад

      i am using 2 new batteries, the batteries are in series connection. My problem is the servo, it keeps rotating. It does not function well. I don't know what is the problem.

    • @pritamsalunkhe6319
      @pritamsalunkhe6319 7 лет назад

      ian noble hey im having the same problem.. only my servo motor n sensor is working the motors dont get enough power to function .. did you get any solution??

    • @aldenpinto389
      @aldenpinto389 6 лет назад

      I think the motor shield has a provision to add an external supply. Use a separate 9V battery n motor will have enough motor

    • @SnowyGlory
      @SnowyGlory 5 лет назад

      @@pritamsalunkhe6319 Did you find a solution for powering the motors?

  • @sirtessai
    @sirtessai 7 лет назад

    I have a question about connecting the wires to the external power (EXT_PWR) on the motor shield. This may seem like a silly question, but how do I get the wires to stay connected? This is my first project using the external power block, and I can't figure out how to get the wires to stay. It doesn't seem right that I should solder them, so am I missing something obvious or is my shield maybe just broken? It doesn't seem like they're in there very tightly, and my LED doesn't turn on when I flip my switch.

    • @Educ8s
      @Educ8s  7 лет назад

      +Tessa Beebe You need a screwdriver to attach the wires to the connector.

    • @sirtessai
      @sirtessai 7 лет назад

      Oooh, I see now. Thank you so much! It's working now.

    • @sirtessai
      @sirtessai 7 лет назад +2

      I have one more quick question! My robot is working, mostly. It functions properly when plugged into the computer, but when I turn it on it won't actually move. The servo motor will rotate, but the wheels never actually move. Any idea why this might be? Thanks a million!

    • @Educ8s
      @Educ8s  7 лет назад

      You probably need better batteries

    • @shivajibhardwaj8636
      @shivajibhardwaj8636 7 лет назад

      battery name plz n specification