Driving DC Motors with Microcontrollers

  Переглядів 566,487

DroneBot Workshop

DroneBot Workshop

День тому

How to use 7 different motor driver modules with an Arduino or any microcontroller. Hookup, code & demonstrations with motors big and small.
Article with code: dronebotworkshop.com/dc-motor...
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/
Today we will be working with lots of motor drivers and lots of motors!
You’ll see how there are actually three methods used among all of these drivers for controlling speed and direction. Because of this, it’s pretty easy to swap drivers and use a sketch for small motors to be used with much larger ones (or vice-versa).
I’ll be driving everything with a simple Arduino Uno today, but you could use any microcontroller to work with these motor drivers.
The code for all these motors is pretty simple, I’ll show it to you, and I’ll also introduce you to a few libraries that make coding for these motor drivers a breeze. We’ll also check out a motor driver library from Cytron that is a hidden gem, as it can be used with ANY of these drivers!
Here is the Table of Contents for today's video:
00:00 - Introduction
01:17 - DC Motor Driver Basics
08:05 - L298N Dual H-Bridge
16:13 - TB6612FNG Dual H-Bridge
25:24 - DRV8871 Single H-Bridge
31:08 - MX1508 Dual H-Bridge
38:54 - DBH-12 Dual H-Bridge
46:27 - IBT-2 Single H-Bridge
51:17 - MD25HV Single H-Bridge & Controller
1:02:27 - Conclusion
Hope you enjoy this, remember that the article on the DroneBot Workshop website has all the code I used today.

КОМЕНТАРІ: 264
@Dronebotworkshop
@Dronebotworkshop 3 місяці тому
Hi everyone - It's come to my attention that there has been someone masquerading as myself, responding to some comments here with a link to a Telegram chat to win a prize from me. THIS IS A SCAM, I am not holding a contest, nor do I have a Telegram account. PLEASE DO NOT RESPOND TO THESE MESSAGES!! It's happening on a lot of my videos, I'm taking steps to remove them manually, but as I have 162 videos, it will take some time. If you do run across a suspicious comment, I would appreciate you letting me know at info@dronebotworkshop.com. Thanks! Bill (The real one!)
@alejandroaguirre2355
@alejandroaguirre2355 26 днів тому
@Bill I was wondering if you have any info or videos on how to connect NEMA 23 steppers with Arduino Mega or Giga even a Uno. I have a few raspberry pies and I wanted to make a CNC controller but I can even install LinuxCNC so I thought I would try out Arduino excellent video by the way take care Bill
@mecanoman
@mecanoman Рік тому
Just so you know the quality of the content here. This is waaaay better than the Automatization lab on my university at the Engineering faculty. Regards!
@dragon.fromindia3235
@dragon.fromindia3235 Рік тому
Elon musk should start Google like companies
@alchemy1
@alchemy1 Рік тому
That is because to these folks, it is a work of love. It is not a job they go to.
@ApteraEV2024
@ApteraEV2024 6 місяців тому
​@@dragon.fromindia3235like, software?
@alwedtechnology8589
@alwedtechnology8589 Рік тому
I am Edgar from Kenya, Africa.. I don't have the words to thank you for turning my dreams into reality. May God Bless you Abundantly
@xzs6ba0
@xzs6ba0 Рік тому
Thank you very much... you have helped an 80 year Old Man to understand how his CNC motors work. Very much appreciated. Have a Great and Safe Day.
@MrOnlineCoder
@MrOnlineCoder Рік тому
That's exactly the video I needed. As always, highest quality. Thank you!
@pixelsquarelight
@pixelsquarelight 11 місяців тому
Although I have watched many of your videos I rarely but I wanted to stop and thank you for the excellent content that you provide. I am highly appreciative of your presentational style you're calm demeanor and your thorough and useful explanations. There have been multiple times where your videos have helped me understand concepts well enough to implement them in my experiments and projects and this has enriched the quality of my life. I sincerely appreciate your efforts. Thank you
@p.g.pg38
@p.g.pg38 Рік тому
Grand merci pour cet énorme travail de synthèse sur les drivers!
@AllTheNamesWereInUse
@AllTheNamesWereInUse Рік тому
Great video! You can always expect the quality and information to be excellent when a new video pops up. Thanks for all the time and effort you put into these.
@EsotericArctos
@EsotericArctos Рік тому
H-Bridge devices have so many different applications. They can be looked at primarily as a motor controller but I also use a H Bridge to convert the digital signal out from an Arduino to DCC +-15V square wave for HO/OO scale model railways. Very versatile device.
@TediumGenius
@TediumGenius Рік тому
This is a FANTASTIC treatise in motor control options!!! With some excellent tips and the 98% speed warning!!! I can't get enough of your instruction! Well done as always!!!
@tukituki127
@tukituki127 6 місяців тому
I am currently a junior majoring in Computer Engineering. I can spend hours looking for specific information out there, and it drives me crazy. You bring all the essential knowledge in one video and with excellent structure and explanations. I cannot thank you enough for these kind of videos!
@braddixon3338
@braddixon3338 Рік тому
Kind of a long video, but a ton of info was presented, all in a very detailed format as usual. Thanks for taking the time to put these together, folks really appreciate your efforts!
@sinjhguddu4974
@sinjhguddu4974 Рік тому
Once more, thank you for this beautiful masterclass on controlling DC motors. Thoroughly enjoyed it. Do stay well.
@JonathanDeWitt1988
@JonathanDeWitt1988 Рік тому
Bill, I have watched many of your videos over the years. I have seen some of these motor drivers in those videos. But it is wonderful to have them all in one place compared to one another. It took me a few days to make it through this video. It is a great reference video that I am sure I will use over the years. Thank you for taking so much effort to create it. The quality is amazing. I really like those cytron boards. I especially liked the feature of it testing a motor without the microcontroller.
@absinthe4breakfast299
@absinthe4breakfast299 Рік тому
Fantastic video, it's just what I've been looking for. I've been building a 3d printed tank and I got stuck trying to figure out the electronics side of things, this video has been incredibly helpful and should allow me to move forward with the project.
@dustyfisk1887
@dustyfisk1887 Рік тому
This video and tutorial is absolutely amazing! Thank you so much for putting together this clear, concise, tutorial. So much easier to understand! Looking forward to watching all of your other videos!
@Eagle621
@Eagle621 3 місяці тому
As an aircraft mechanic, A/P, with an Inspectors Authorization, IA, I’m just getting into this world…but I find your videos VERY informative and helpful. Thank you and I really appreciate your help in understanding in a way that I can develop my own projects. Cheers, new sub here👍
@kajitis_1
@kajitis_1 Рік тому
Fantastic introduction to the world of controling motors. Your vids are brilliant. Keep up the good work 👏
@lorisrobots
@lorisrobots Рік тому
Thanks for this great content! I always find your videos well researched and accessible. Please keep them coming!
@Zeddify
@Zeddify Рік тому
This channel deserves more recognition.
@ausgewogen
@ausgewogen Рік тому
Perfectly explained, the right speech speed and super diagrams.
@gpTeacher
@gpTeacher Рік тому
Very informative and well-presented! Thank you!
@ernierasta
@ernierasta 6 місяців тому
Thank you! Your videos are so pleasant to watch and easy to understand!
@rogueart7706
@rogueart7706 Рік тому
Excellent video. I needed this as I’m building a CNC router. The drivers are the only thing I couldn’t quite grasp. Thanks a bunch
@mizbot
@mizbot 5 місяців тому
Love the effort you put in in your videos, I've come back to this video again and again as reference for the motor drivers. Appreciate your content a lot really helpful ❤️
@tungstikum
@tungstikum Рік тому
Thank you for all your quality content
@Kamal_Kalyan887
@Kamal_Kalyan887 Рік тому
Thank you so much 💖 and I wish all the happiness be with you professor
@TYGAMatt
@TYGAMatt Рік тому
Great work Bill. I'm using the TB6612FNG in my latest project but only driving one motor. But thanks to your vid I've just ordered a DRV8817 to replace it. Keep up the good work!
@Graham1904
@Graham1904 7 місяців тому
An awesome video for those people just started with DC motor controlling. Brilliant!!
@johneagle4384
@johneagle4384 6 місяців тому
Very comprehensive, very useful. Thank you very much!
@bruinflight1
@bruinflight1 Рік тому
EXCELLENT TOPIC! Thank you for sharing this knowledge, I've got some projects in mind that I'd love to apply this to.
@andrewrevelee5097
@andrewrevelee5097 Рік тому
Im just a hobbyist when it comes to electronics and have been slowing learning an self teaching myself for a few years know and even though I may know how to use h bridge controllers I still feel you can learn more about things by listening to others especially ones who are well versed or educated on the topic I just found this channel and subbed after the linear ps video because of how well you did in making a high quality informative video an because you don't drag on one thing forever explaining it you condense the important points with enough detail to get the message across then move on and that's why these videos I feel are packed full of information in a decent run time and can be watched with ease.
@user-px3kp9eg8v
@user-px3kp9eg8v 5 днів тому
I couldn't find any like this. Thank you🎉
@LeslieIsgrigg
@LeslieIsgrigg Рік тому
👍 Very good course. Thanks again for your efforts.
@munjee2
@munjee2 Рік тому
The 5v logic input on the l298 also acts as a ~5v supply actually, which is pretty useful to supply μC's without built-in voltage regulator
@michaelkosciewicz1623
@michaelkosciewicz1623 Рік тому
Phenomenon! i start with electrical machines, this semestr. Great thnx Bill:)
@Mike.Kachar
@Mike.Kachar Рік тому
Thank you very much for the videos you do!
@U8uxa8SP
@U8uxa8SP Рік тому
Thanks for another wonderful video. I learned a lot.
@erickbermudez8219
@erickbermudez8219 Рік тому
You really know how to transfer knowledge! Great job, thanks for be so professional and provide excellent videos, very well explain and easy to follow.
@darkoprintshop9927
@darkoprintshop9927 Рік тому
Another great video. These are so helpful. Thanks for putting them together. 🎉
@petermolnar6017
@petermolnar6017 Рік тому
Great as always! Thank you!
@donaldkormos5529
@donaldkormos5529 Рік тому
Super video on motor drivers!! All the best to you ...
@Chloe_59
@Chloe_59 Рік тому
Awesome! Thank you very much, you just released exactly the video I needed
@jackisgoofingoff5510
@jackisgoofingoff5510 6 місяців тому
This is so detailed and useful, thanks.
@willlockler9433
@willlockler9433 Рік тому
Great presentation as always! Cytron urc10 robot control board, which is UNO R3 and cytron 10/30 amp driver all on one board, is great project option. One power hookup and lots of pins.
@TheUnofficialMaker
@TheUnofficialMaker Рік тому
Very comprehensive as usual, thanks for your efforts. I always learn a lot from your well made experiments.
@chadizdroid
@chadizdroid Рік тому
Thank you for another Great video, to complement this, I would follow up by showing how we can do current sensing on all, and also how to use an different types of motor encoders to demonstrate feedback control loop concepts.
@Reach41
@Reach41 Рік тому
Not to be ignored are the motor controller boards that communicate with the Arduino via I2C. They only require two of the precious IO pins to drive your robot’s motors, and the libraries available to control them take care of all the setup details. People new to the sport will be best off sticking with brands such as SparkFun or Adafruit, and picking motors from the same places that they indicate are compatible with the board you choose.
@luisrueda6459
@luisrueda6459 7 місяців тому
HB
@tobi9648
@tobi9648 8 місяців тому
such a great video. exactly what I needed. Thank you very much!!
@warrenking1815
@warrenking1815 6 місяців тому
Great video, real good information presented in a clear and thoughtful manner!
@Matt2chee
@Matt2chee Рік тому
That helped, considering I started in industrial when MG set's were still commonly in use. The current rating is amazing in some of these small packages.
@Googolplex6
@Googolplex6 5 місяців тому
Amazing video. I am a beginner but this video gave me the right answer were to start. Thanks!
@Mrgasman1978
@Mrgasman1978 4 місяці тому
channels like this make our traditional school system looking obsolete
@yucynthia644
@yucynthia644 Рік тому
Thanks! Very detailed and comprehensive!!!
@harryhino2267
@harryhino2267 Рік тому
Great content as usual. Minor nit pick. Vbe is 0.7V for bipolar transistors; Vce(sat) is 0.3V. When using FETs, keep in mind that they cannot change from OFF to ON (or ON to OFF) instantaneously; there is a slew rate. When they are in this intermediate state, there is a voltage drop and a current flow; so they have to dissipate power as heat. It is nowhere near as bad as bipolar devices, but needs to be kept in mind when switching them very fast.
@hammabuckshot5062
@hammabuckshot5062 Рік тому
Yet another amazing video,this truly magnificent.keep up the good work ❤️❤️❤️
@ms.informed
@ms.informed 10 місяців тому
This is a godsend, exactly what I need for my next wannabe project, if I stop procrastinating, that is.
@TrillChords
@TrillChords Рік тому
Nice variety in coverage. Bless 🙏
@diogenesofSinope87
@diogenesofSinope87 Рік тому
Absolutely fantastic content thank you!
@lesthompson5907
@lesthompson5907 3 місяці тому
that was very revelling & did infect answer a questions or tow i have still have to get in to wring the set up. And loop for the ono but at lest now i may have a drivers to handle the job thank you a lot once has figured out how to put it together on my lath.
@ingodering9649
@ingodering9649 Рік тому
Many thanks for perfect explanation ☺️
@79ober
@79ober Рік тому
Hi Bill, great video! Thanks for trying out Cytron's MD25HV and happy that you like it.
@GiC7
@GiC7 6 місяців тому
Master, I love the pr.oject. thanks
@sciacabale
@sciacabale Рік тому
This is a very well conceived and instructive tutorial. However, the most versatile motor controller I know of was left out. This is Basic Micro's ROBOCLAW. It comes in different sizes but the most common is the Roboclaw 2x7 capable of driving two motors drawing up to 7 Amp each. This controller has the ability of processing signal coming from motor encoders and controlling the motor's speed via a PID (Proportional, Integral, Derivative) feedback loop.
@ladiran
@ladiran Рік тому
Great tutorial. It will be appreciated if a display showing the motor speed could also be included. Thanks, again, for the tutorial
@q12x
@q12x Рік тому
Very good tutorial ! Thank you !
@JochenRoth
@JochenRoth Місяць тому
Thank you for this very interesting video and workshop! Best regards from Germany!
@wodzimierzkeska2380
@wodzimierzkeska2380 Рік тому
Perfect presentation!
@donodono2287
@donodono2287 Рік тому
Wish we'd been taught this stuff at school. Absolutely essential now!
@ronaldmorrison2765
@ronaldmorrison2765 Рік тому
Me too but microcontrollers and H bridges weren't popular in the classroom 55 years ago.
@waynefilkins8394
@waynefilkins8394 5 місяців тому
Great video, helped a TON with my project. Sadly I already ordered 5 of the L298N, but I got them super cheap so went ahead and ordered the ones I need, the TB6612FNG. Problem with the first one is that huge heatsink, and I only need 12v so 2nd one was perfect.
@usefulelectronics
@usefulelectronics Рік тому
This is all in one motor driver tutorial! I didn’t not know about some of these drivers. Thank you for the amazing comparison! Keep it up !
@eduardprivat9821
@eduardprivat9821 6 місяців тому
thx. amazing presentation
@Jeovanivm
@Jeovanivm 10 місяців тому
Thanks so much, I am from Brazil and I can understand you very well,
@juliojoseruizolivo4697
@juliojoseruizolivo4697 6 місяців тому
Very helpful, keep doing this videos!
@joshuaoduroadu5376
@joshuaoduroadu5376 Рік тому
Thanks Bill for another excellent 👍👌 video.
@duinobox6991
@duinobox6991 Рік тому
Parabéns! bem explicado! aprendi muito
@paramtrx9558
@paramtrx9558 Рік тому
Thx again for a great video!
@amirajpal6382
@amirajpal6382 Рік тому
Great explanation in your video. Very Professional.
@MitzpatrickFitzsimmons
@MitzpatrickFitzsimmons Рік тому
I just rceived my motors for my remote controlled lawnmower project yesterday... and today this video! Coincedence or Syncronicity? Either way... thanks Bill!
@crazytronics9917
@crazytronics9917 Рік тому
Please make video on FOC and how we can use it for position controlling of BLDC motor. 👍
@stefanguiton
@stefanguiton Рік тому
Would be great to see this
@TheMarshallFan
@TheMarshallFan Рік тому
Electronoobs has a video on FOC PMSM control, but I'd like to see Bill's take on the topic as well.
@gersonfer
@gersonfer 8 місяців тому
Very good class covering all aspects as always. Thank you. I have a question regarding IBT2: How can I apply a progressive motor braking function? i.e. I don't want the motor to stop suddenly.
@j.b.9474
@j.b.9474 Рік тому
Would love to see video on motors with position feedback.
@MrTweetyhack
@MrTweetyhack 8 місяців тому
Excellent content
@Ben_Lovely
@Ben_Lovely 8 місяців тому
Please do a video on driving 3 phase dc motors found in old computer printers so we can all repurpose them :) love your content!
@mahmoodmohammad7241
@mahmoodmohammad7241 Рік тому
Great Tutorial, Thanks
@ramybrahim3188
@ramybrahim3188 5 місяців тому
thank you from Morocco
@DingusGoesWest
@DingusGoesWest Рік тому
Great video, very valuable information!
@rich4239
@rich4239 Рік тому
excellent work!!! thanks for your outstanding presentation...your consistent, clear outline for your videos makes them superior to any other source. You were the first source for my arduino learning process and as my level of understanding grows...you seem to be there with a video on the topic. I am a noob trying to control 12v powerwheels toy with my 80v lawn mower battery...needing to get the voltage down to 12-18v...from your explanation, an h-bridge does not seem to work...or am I missing something...is there a standard way to control lower voltage, lower cost dc motors with a much bigger voltage source...thanks again
@chouseification
@chouseification Рік тому
Another great video!
@jlucasound
@jlucasound Рік тому
😲 You forgot to say "Wipers" @ 50:24. 😄 I so love your videos! Your illustrations, diagrams and tutorials are the BEST! And I mean that. I'm still keeping my L298Ns. I'll use a wall wart on a project with no wheels. A Pinball Machine!! 🤣 Thank You, Sir!
@oljobo
@oljobo Рік тому
👍😃 Fantastic video! Thank You‼️
@JBernhard72
@JBernhard72 Рік тому
Just to add ... if you try to 'roll our own' H-bridge, timing of the 'switches' is important! It is VERY easy to momentarily short out to ground and release the magic smoke!
@cornjulio4033
@cornjulio4033 Рік тому
Cool video ! Also, at 46:00 that's a nice power supply, it reacts super fast.
@simonlyons5681
@simonlyons5681 4 місяці тому
At 3:40 I think you are confusing the base-emitter voltage drop of a bipolar transistor (about 0.7V) with Vce(sat) which is often on the order of 0.1V, similar to a MOSFET. Otherwise, amazing video. I can't believe the work you put in here!
@Donder1337
@Donder1337 Рік тому
This was perfect 👌
@eneleich373
@eneleich373 5 місяців тому
Very usefully, thanks a lot
@millbean13
@millbean13 4 місяці тому
Very informative content. I enjoy it. lol, this guy is interesting. I don’t think I’ve ever heard someone pronounce the arbitrary names of any circuit board so many times. I don’t think he skipped a single time saying the entire name of board when talking about them. Very funny. Most people would shorten them or only refer to a small portion of the name. Interesting guy.
@robertparenton7470
@robertparenton7470 Рік тому
Thank You!
@Lorenzo0077
@Lorenzo0077 Рік тому
thank's for this video
@lesthompson5907
@lesthompson5907 3 місяці тому
the last one is was the one it taken a day to get there . now i need to get to how to set thread cutting speeds. with an arduino
Linear DC Power Supplies - Designing & Building Custom DC Power Supplies
1:12:39
DroneBot Workshop
Переглядів 943 тис.
Using Basic Logic Gates - With & Without Arduino
1:03:51
DroneBot Workshop
Переглядів 548 тис.
ФОКУС С ЧИПСАМИ (секрет)
00:44
Masomka
Переглядів 3,8 млн
Зомби Апокалипсис  часть 1 🤯#shorts
00:29
INNA SERG
Переглядів 1,6 млн
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
Rachel De Barros
Переглядів 356 тис.
Stepper Motors and Arduino - The Ultimate Guide
29:57
How To Mechatronics
Переглядів 1,1 млн
Motor Driver in depth | H-Bridge | L293D, L298N, TB6612FNG, VNH2SP30
12:50
ESP32 Guide 2024 | Choosing and Using an ESP32 Board
41:06
DroneBot Workshop
Переглядів 200 тис.
What is an H-Bridge?
6:29
CircuitBread
Переглядів 9 тис.
Brushless Motor - How they work BLDC ESC PWM
16:12
The Engineering Mindset
Переглядів 4,3 млн
MOSFETs and Transistors with Arduino
40:50
DroneBot Workshop
Переглядів 1 млн
NEW Arduino Uno R4 Boards - Minima & WiFi
57:40
DroneBot Workshop
Переглядів 96 тис.
McDonald’s MCNUGGET PURSE?! #shorts
0:11
Lauren Godwin
Переглядів 23 млн
Такого покрытия для вашего помещения вы ещё не видели
0:22
Дизайнерское Логово
Переглядів 2,9 млн
✅️🪂🫵 Mergulhando nas Nuvens: A Emoção de um Pouso Radical!
0:12
História paraquedismo
Переглядів 17 млн