Тёмный

Arduino Robot Car with Speed Sensors - Using Arduino Interrupts 

DroneBot Workshop
Подписаться 601 тыс.
Просмотров 380 тыс.
50% 1

Let's build a robot car that uses those slotted "optical speed sensors"! We'll also learn about Arduino Interrupts.
Get full instructions and Arduino sketches at dronebotworkshop.com/robot-ca...
More articles and tutorials: dronebotworkshop.com
Join the conversation on the forum: forum.dronebotworkshop.com
Subscribe to the newsletter and stay in touch:dronebotworkshop.com/subscribe/
In this video, I will show you how to assemble a very popular 2WD robot car chassis kit and how to use the speed sensor disks or “encoder wheels” that are included with the kit. You’ll learn how to couple the encoder wheels with a couple of inexpensive optical sensors that are based upon an optocoupler and an LM393 dual comparator chip, allowing you to measure speed and distance traveled.
These inexpensive kits can form the basis of a simple or sophisticated robot, you are only limited by your imagination (and budget and technical abilities LOL). I’ll show you an example of a robot I’m constructing that illustrates just how much you can expand upon the basic robot car chassis, and I’ll offer some suggestions for planning out your own unique robotic creation.
There are a couple of different styles of these kits, I will show you two of them. The main difference between them is in how the motors are mounted to the chassis - one uses an acrylic mount while the other uses a mount made of aluminum. Either type is perfectly fine to use for these experiments.
In addition to the robot car chassis kit and a pair of LM393-based optical sensors, you’ll need an Arduino Uno and an L298N H-Bridge motor driver, as well as a few batteries to power everything up. I’ll show you how to hook it all up and how to determine the optimum placement for these components on your robot car chassis.
I’ll then explain how the optical sensor works and how you can use its readings to determine not only speed but distance as well.
Then comes the code! If you are relatively new to Arduino programming then you might not have used “interrupts” before, so it’s time to learn something new. The Arduino Uno allows for two hardware interrupts and both will be used in this design.
Here is an outline of what’s covered in the video:
00:00 - Introduction
02:20 - Extra parts you’ll need
03:00 - Parts included with Robot Car Kit
04:54 - Planning your Robot Car design
08:24 - Building the Robot Car
10:13 - Speed Encoder & Opto Interrupter operation
11:18 - Speed Encoder & Opto Interrupter demonstration
12:46 - LM393-based Speed Sensor
13:21 - How a Comparator works
14:18 - Explaining Arduino Interrupts
18:04 - Arduino Speed Sensor demo setup
19:14 - Arduino Speed Sensor demo sketch
26:19 - Arduino Speed Sensor in action
27:27 - Calculating Speed and Distance
28:57 - Robot Car wiring layout
32:32 - Robot Car Schematic
34:35 - Arduino Sketch for Robot Car
45:35 - Robot Car in Action!
46:52 - Conclusion
There is a lot covered in this video but it actually just scratches the surface of the potential our little Robot Car has. I’m going to keep this car and add to it in future videos so if you want to know when there are updates (such as the much-requested remote control feature) please subscribe to the channel!
Again all of the code is available on the DroneBot Workshop website .
Hope you enjoy the video!

Хобби

Опубликовано:

 

31 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 266   
@CountryNerd639
@CountryNerd639 2 года назад
I really like watching your videos. You explain the project in a way that I can understand. Most tutorials fly through the steps that some of the information is missing, or glossed over. That is why I appreciate your style of teaching.
@ashr
@ashr 3 года назад
I learned more about Arduino programming from this video in 40 minutes, then I did in almost 1 semester of my college classes that teaches us to work with the Arduino Uno.
@kyrofromgahool2009
@kyrofromgahool2009 2 года назад
Mb you should have stopped making part times and start following the course((?
@andreaszervas7546
@andreaszervas7546 6 лет назад
Excellent work! You are a great teacher. I found you last week and learn from you things I m looking for months before. Thank you and keep uploading!
@tegekgast
@tegekgast 6 лет назад
Excellent timing! Just got into this thing and wondered how the heck the speedometer things work, the Chinese instructions aren't much help and you are a hero doing this series in your calm and structured way, much appreciated!
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Glad that my timing worked out so well for you, let me know if you have any additional questions. The stuff we can get now from China is of incredible value but it does tend to lack a lot of useful instructions, which Is one of the reasons I made the video. Happy to hear you found it useful.
@Aegir1001
@Aegir1001 6 лет назад
A big thank you for a nice and informative tutorial. I was pondering whether to start to learn Arduino and found your channel after a short search. Very interesting - now I'm hooked!
@julenlaskibar5409
@julenlaskibar5409 6 лет назад
My compliments and applause. Simply amazed by such a well structured lesson.
@peterbaker6597
@peterbaker6597 6 лет назад
I am teaching myself Arduino and to a smaller extent robotics. I have followed your excellent tutorials about the robot car and every detail is clearly explained and easy to follow. The instructions on Interrupts (and the link to Nick Gammon) made my project jump ahead in leaps and bounds. I did find that the last code would not run until I put a few pinMode(??, OUTPUT) instructions in the setup to define the Arduino to L298N driver pins. Once they were set, away we went. Thanks again and I'm looking forward to your continued additions to the car.
@bennedhedegaard4971
@bennedhedegaard4971 4 года назад
This is an incredibly valuable resource, thank you for your work!
@1DR31N
@1DR31N 3 года назад
It cannot be better. What a great video. Words aren't enough to praise your job. Congratulations, you deserve the best.
@charlesbrown5057
@charlesbrown5057 2 года назад
For some reason, I volunteered to enter a robotics competition for my senior project... extremely thankful for this video
@Webendowed
@Webendowed 4 года назад
I'm new to the group and I must say this is great. I'm learning so much and having thought provoking ideas as well. Thank you for these great videos DroneBot Workshop
@pastrana2000
@pastrana2000 5 лет назад
Outstanding video! You really explained things here in layman's terms which helped tremendously.
@msignal2000
@msignal2000 4 года назад
Decided to spend the corona lock down learning Arduino. So very glad I found your channel.
@123kkambiz
@123kkambiz 5 лет назад
Your tutorials are excellent.Thank you very much for uploading the video with excellent camera positioning and video editing.
@carlosl1895
@carlosl1895 3 года назад
I’m starting with arduino. Still don’t know how to program it. Thank you for such a great explanation. To me is the best video I have seen. Keep up with it
@joerinaldi5
@joerinaldi5 5 лет назад
Excellent Presentation. Clearly explained with complete details of project without any missing steps. Very easy to follow...thanks
@eclecticlife
@eclecticlife 2 года назад
Excellent instructional video! Your videos are clear, easy to understand, and to the point. Thank you for all the effort and for sharing your knowledge.
@ishansmith549
@ishansmith549 6 лет назад
Thumbs up. Very good, informative video. Blows all the other videos ive seen on these robots so far out of the game. Really appreciate the video.
@ibrahimshareef4743
@ibrahimshareef4743 6 лет назад
Sir! You are the best in your field. Thank you for such great video.
@VerifiedUser-DE
@VerifiedUser-DE 6 лет назад
The way you explain everything is amazing ..which let me stick till last...waiting for more material ..mostly excited about IOT
@elmrychkarla1795
@elmrychkarla1795 3 года назад
nice car
@Luis3alsa
@Luis3alsa 3 года назад
This is by far the best channel to learn arduino! Thanks a lot 👍
@duylekhac6044
@duylekhac6044 5 лет назад
You deserve so much more than 93K sub. Love your videos!
@danielmartel6424
@danielmartel6424 4 года назад
very well done, congratulation. I love the details and the clarity of your explanation. Keep up the good work
@damithsm1980
@damithsm1980 6 лет назад
Great Work... Your presentation was simple and amazing...Thank You very much. I love the way you arrange your tools too.
@andur63
@andur63 6 лет назад
This video is worth every minute watching, you made such a fine job, Thank you!
@elihaugh4162
@elihaugh4162 3 года назад
Definitely
@odevarjr8715
@odevarjr8715 2 года назад
Thank you, teacher! 2022 and still a great and relevant lesson!
@preetamsingh147
@preetamsingh147 3 года назад
You really are a hardworking man. Keep it up!
@hayttom
@hayttom 3 года назад
Thank you very much! I mainly came here to begin to understand interrupts. I'm on my way!
@sugarstool1602
@sugarstool1602 6 лет назад
This is sooo crystal clear. I code more on Python instead. Go through Pyserial to response each other between Arduino IDE and Python. very much like this episode.
@pardhunadella2524
@pardhunadella2524 4 года назад
This video just drove me crazy.....Such a great explanation......
@roniosteicoechea9190
@roniosteicoechea9190 6 лет назад
This am amaizing channel! Really you are doing a beautiful job!
@premprasad3511
@premprasad3511 3 года назад
THE BEST SET OF TUTORIALS ON ARDUINO.
@ArduinoBasicsBlogspot
@ArduinoBasicsBlogspot 5 лет назад
A great video explanation - very thorough and easy to understand. Awesome !!
@pantuflip
@pantuflip 5 лет назад
Un gran aporte, sobre todo en la parte del código de las interrucciones. Nice contribution, Very good information about interruptions.
@naboulsikhalid7763
@naboulsikhalid7763 6 лет назад
A good teacher. thank you again
@ukwerna
@ukwerna 5 лет назад
Thanks alot for all your videos! Seriously good stuff!
@amjad2000in
@amjad2000in 6 лет назад
Simply Superb .... No words . .. This is the best tutorial video I have ever seen in my life in youtube yet. And your lab, its awsome. Wish I could work with you. You have explained everything in such a way that even a beginner will understand it. I am also building a Robo car with same chasis but controller and functionalties will be different. Just came here while searching the working of speed encoders. I got what I need. I am from India and wish I could meet you in person ever and visit your lab. Keep going sir ...
@jainlibra
@jainlibra 6 лет назад
Your videos are awesome!!really helpful
@bluehornet6752
@bluehornet6752 5 лет назад
Great video. Your > is "greater than" not less than... You said it correctly towards the end, but it was confusing when you said it incorrectly while explaining the logic of your functions. Excellent demonstration though on the use of optical sensors, comparators and interrupts. Great stuff!
@abd-elrahmanmohamed9839
@abd-elrahmanmohamed9839 6 лет назад
Really great and full explained . Thanks a lot !
@claudecastets4271
@claudecastets4271 6 лет назад
very clear instructor efficient and going in details for all functions
@MrHristoB
@MrHristoB 6 лет назад
Excellent tutorial!!! Well done. I'm really enjoying your videos, pure information without the drama other guys trow out. I did a couple of projects but I used 6 cell holder for rechargeable batteries for 7.2V for the arduino and 8 cell for the H bridge. Keep them coming mate!! Regards
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Glad you liked it, thanks for the nice comment! Next video is on Friday.
@d3bbi339
@d3bbi339 6 лет назад
You should make a video on building a drone with a camera attached. Just a thought! You just explain things so well it would make things so much easier for my brain to crunch on.
@grape142
@grape142 6 лет назад
Excellent video, glad to see back. I'm looking forward to your development of this robot. I like the explanation of the use of interupts.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Glad you enjoyed it and I'm glad to be back. I'll definitely have more on the evolution of this robot very soon!
@toilaxuannam
@toilaxuannam Год назад
Absolutely amazing video for beginners like me. Really appreciate it🎉
@davidkennard2614
@davidkennard2614 6 лет назад
Thank you very much. Robotics is fascinating and provides a vehicle for learning lots of different processes.I plan to automate my greenhouse to some extent and include remote monitoring of the parameters.
@gersonfer
@gersonfer 5 лет назад
very important basic concepts . Thank you
@bikefarmtaiwan1800
@bikefarmtaiwan1800 6 лет назад
Nice and clear-please keep up with this great resource! Thanks for your effort.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Thanks for your very nice comment!
@wolfrobots118
@wolfrobots118 4 года назад
You are simply the best. I love your videos. They have helped me multiple time.
@mattjohnson2848
@mattjohnson2848 6 лет назад
Awesome! This is the first time it's actually made sense to me. Thank you.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Glad I could help it make sense, you're welcome Matt. :)
@BTSARMY-zi6ph
@BTSARMY-zi6ph 3 года назад
Wow, that is so smart! Thank you for all the tips for my robot!
@karalekasgeorge1252
@karalekasgeorge1252 5 лет назад
Bravo from Greece..
@cliffordhallam3270
@cliffordhallam3270 6 лет назад
Excellent video, very easy to follow. Looking forward to the radio control video because that’s where I’m currently at with my own arduino robot project. Thank you for taking the time to make this.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Glad you liked it, stay tuned as the remote control will be coming very soon.
@zobayarriad668
@zobayarriad668 5 лет назад
You are really awesome guy who really understand robotics
@skronosp
@skronosp 6 лет назад
That's awesome, looking forward to new projects! Thanks for your videos
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
You are very welcome, more videos very soon!
@MrEerilybasic
@MrEerilybasic 4 месяца назад
Thanks Bill. Much fun!
@dafeifeng3902
@dafeifeng3902 2 года назад
Thank you for this tutorial!
@SchwanaCARDHUT
@SchwanaCARDHUT 4 года назад
Thank you very much for tutoriels ....I'm from France
@anubhavkalita675
@anubhavkalita675 4 года назад
I understood everything whatever you explained. Love from India 🇮🇳
@khajamohiddien9163
@khajamohiddien9163 4 года назад
Great work sir, Loved it alot
@marwanshwaiki777
@marwanshwaiki777 3 года назад
This is a great tutorial. thanks alot for your excellent way of presenting.
@jrareas
@jrareas 4 года назад
you are incredible good at this. Thank you very much
@andreaszervas7546
@andreaszervas7546 6 лет назад
hi and thank you for this work, it's a great start for me. Some improvements I did in the move routines code: 1. if you use "II" instead "&&" in "while", then the movement finish when both motors end at the same number of steps. 2. instead of "steps > counter_A" I use "counter_B >= counter_A" and instead of "steps > counter_B" i use "counter_A >= counter_B".. in this case each motor waits the other to complete same number of steps, so the movement is straight.
@lakshsharma9324
@lakshsharma9324 6 лет назад
loved the video great job
@thilinawijebandara3232
@thilinawijebandara3232 3 года назад
Great Explanation .Thank you very much 👍
@kouider76
@kouider76 5 лет назад
Thank you for this awesome video
@oOcitizenOo
@oOcitizenOo 6 лет назад
Another useful tut with theory and practice - like!
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Thank you!
@Mystic0Dreamer
@Mystic0Dreamer 6 лет назад
Absolutely fantastic instruction video. Very clear, to the point, with no unnecessary baloney. I'm definitely a fan. I'll be building one of these robots via these instructions to be sure. I eventually hope to build a far larger robot using the same basic principles. But building this little one to gain the experience is definitely the way to go. Thank you very much for making these video courses.
@temanmikro3867
@temanmikro3867 5 лет назад
Great video. Thanks for inspiring me
@theeasywayoutcampers6550
@theeasywayoutcampers6550 4 года назад
Your a great teacher.
@ahmedabdulsamir932
@ahmedabdulsamir932 4 года назад
I just watched this video and went ahead to download more. I'm planning to build something big with this as soon as Corona virus is over and shipping resumes. Thank you so much. I would love if you can put me through whenever I get hooked up on the way.
@UzunKamis
@UzunKamis 3 года назад
Great video! I have learned alot today. Thank you.
@NielsLinneberg
@NielsLinneberg 4 года назад
truly amazing and usefull video, thank you very much, enjoyed it all to then end! ... definitely worth a subcribe!
@colinpowers5381
@colinpowers5381 3 года назад
love your theme song!
@ricklarson8459
@ricklarson8459 2 года назад
Thanks. Still helpful in 2021!
@VolthausLabElectronics
@VolthausLabElectronics 6 лет назад
Very good work sir. I've been wanting to learn this information for some time. Thank you very much.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
You are most welcome!
@vacm1700
@vacm1700 6 лет назад
Great project! Nice project to build in this season.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Glad you enjoyed it, let me know how your build turns out. Remember that you can get all the code on the website at dbot.ws/rbtcar
@gpiluso
@gpiluso 3 года назад
Thanks a lot for the video, awesome
@PG-qz6mg
@PG-qz6mg 2 года назад
Thank you very much for your videos. I'm french but i understand very well your english !
@bibekdhungana2182
@bibekdhungana2182 6 лет назад
Thank you so much for sharing wonderful video....
@nagesh007
@nagesh007 2 года назад
Amazing , Thanks a lot 😍
@kboo918077
@kboo918077 6 лет назад
Thank you for the very good videos you make, they are very clear, very good work. I have a question, could you do a video that show an example of PID controller maybe with this kit? It could be very interesting to make a speed and another with a position controller. Thank you very much
@marcosalmeida9465
@marcosalmeida9465 6 лет назад
Say hi to Brazil! I still do not speak your language very well, but I'm studying! Thank you for the explanation. I searched for something very much, but without much success, I had to appeal and look in another language ... Thank you! Nós amamos vocês!
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Hi to Brazil from Canada Marcos! You do much better in English than I ever would in Portuguese. I'm glad you were able to understand enough to make it useful for you.
@ShahyanBharucha30
@ShahyanBharucha30 2 года назад
Fantastic video. Thank you very much 😊 ☺️
@Plitschosplatschos
@Plitschosplatschos Год назад
Great! Thank you! 🙃
@blackbox330
@blackbox330 Год назад
Sir, Great video
@iamosrazin
@iamosrazin 4 года назад
amazing, good job , it seems well for biginner, thanks
@nejim1232
@nejim1232 2 года назад
Thank you my dear for your clear and complyt lesson may god help you wish you all the best
@ckcnhovandung1200
@ckcnhovandung1200 4 года назад
very useful :) Thank admin
@charlesnemo4325
@charlesnemo4325 5 лет назад
tres belle video merci
@neurosp
@neurosp 4 года назад
Another way I found to make it go straight is using a compass and following a heading , so if something interferes with the robot it wil autocorrect and using encoders too he can know the distance .
@germanaltgelt4967
@germanaltgelt4967 5 лет назад
excellent video
@jlucasound
@jlucasound 4 года назад
The opto-isolator can also be used with a "flag" (a single piece of metal or opaque plastic) as a "home" sensor.
@ahmadzakki8917
@ahmadzakki8917 6 лет назад
thank you from indonesian!
@C_Haberstoked
@C_Haberstoked 4 года назад
Thank you!
@bloodtwister
@bloodtwister 2 года назад
thanks a lot i will try that soon
@johnhaythorpe206
@johnhaythorpe206 6 лет назад
Brilliant Demo, with excellent explanations. The only suggestion would be (at 33:37) show the negative from the 9 volts goes to the outside (chassis) of the 2.1 mm power socket (centre is positive). I am jealous of how neat, tidy and well laid out your workshop appears.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Good eye John, I should have spotted that connection error but didn't until I read your comment. Hopefully most users will just use a 9-volt to 2.1mm connector and won't reverse the polarity. Thanks for pointing that out!
@pradeepsahoo7243
@pradeepsahoo7243 6 лет назад
Really nice video! Having bought a similar chassis last month, I made a Mobile controlled robot car using a bluetooth HC-05 module, but I kept wondering what to do about those speed encoders to control the distance they travel or speed of the motors. Well, thanks to you, now I know. The explanation about the Interrupts was exceptionally good and will help me in building some more ambitious projects. I will surely check out your website as well.
@Dronebotworkshop
@Dronebotworkshop 6 лет назад
Thank you for the nice comment, so glad I was able to help!
@Borishal
@Borishal 5 лет назад
Thank you. Thank you. Thank you.
@tharnaturalhistoryfossilmu5920
@tharnaturalhistoryfossilmu5920 2 года назад
So nice lam learning so much love ❤️
Далее
Mecanum Wheel Robot Car & ESP-NOW Remote
1:26:38
Просмотров 124 тыс.
How to use encoders (Optical, Hall Effect, Quadrature)
20:44
Driving DC Motors with Microcontrollers
1:04:32
Просмотров 622 тыс.
RC Robot Car - RC Controls and Arduino
47:53
Просмотров 208 тыс.
Adventures in Science: How to Use Rotary Encoders
12:05
I found PERFECT display
51:32
Просмотров 560 тыс.
Best exercises to lose weight ! 😱
0:19
Просмотров 11 млн
WORLD'S SHORTEST WOMAN
0:58
Просмотров 80 млн
WORLD'S SHORTEST WOMAN
0:58
Просмотров 80 млн