Driving DC Motors with Microcontrollers

Поділитися
Вставка
  • Опубліковано 29 тра 2024
  • 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.
  • Навчання та стиль

КОМЕНТАРІ • 273

  • @Dronebotworkshop
    @Dronebotworkshop  4 місяці тому +18

    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 Місяць тому

      @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 Рік тому +195

    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 Рік тому +6

      That is because to these folks, it is a work of love. It is not a job they go to.

    • @ApteraEV2024
      @ApteraEV2024 7 місяців тому

      ​@@dragon.fromindia3235like, software?

  • @alwedtechnology8589
    @alwedtechnology8589 Рік тому +8

    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

    • @jasenchen3731
      @jasenchen3731 25 днів тому

      good luck on your amazing journey

  • @xzs6ba0
    @xzs6ba0 Рік тому +5

    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.

  • @AllTheNamesWereInUse
    @AllTheNamesWereInUse Рік тому +4

    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.

  • @MrOnlineCoder
    @MrOnlineCoder Рік тому +30

    That's exactly the video I needed. As always, highest quality. Thank you!

  • @TheKirstebee
    @TheKirstebee 5 днів тому

    Thank you so much for this video - I have been trying to wrap my head around the different microcontrollers for dc motors and always ended up confused! Such clear explanations-as always 🙏 Love your work! ❤

  • @harryhino2267
    @harryhino2267 Рік тому +2

    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.

  • @p.g.pg38
    @p.g.pg38 Рік тому +8

    Grand merci pour cet énorme travail de synthèse sur les drivers!

  • @EsotericArctos
    @EsotericArctos Рік тому +8

    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.

  • @pixelsquarelight
    @pixelsquarelight Рік тому +14

    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

  • @dustyfisk1887
    @dustyfisk1887 Рік тому +1

    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!

  • @sinjhguddu4974
    @sinjhguddu4974 Рік тому +4

    Once more, thank you for this beautiful masterclass on controlling DC motors. Thoroughly enjoyed it. Do stay well.

  • @braddixon3338
    @braddixon3338 Рік тому +1

    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!

  • @TediumGenius
    @TediumGenius Рік тому +2

    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 7 місяців тому +1

    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!

  • @JonathanDeWitt1988
    @JonathanDeWitt1988 Рік тому +9

    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 Рік тому +3

    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.

  • @kajitis_1
    @kajitis_1 Рік тому +4

    Fantastic introduction to the world of controling motors. Your vids are brilliant. Keep up the good work 👏

  • @Reach41
    @Reach41 Рік тому +18

    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.

  • @lorisrobots
    @lorisrobots Рік тому +2

    Thanks for this great content! I always find your videos well researched and accessible. Please keep them coming!

  • @mizbot
    @mizbot 6 місяців тому +1

    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 ❤️

  • @gpTeacher
    @gpTeacher Рік тому +7

    Very informative and well-presented! Thank you!

  • @usefulelectronics
    @usefulelectronics Рік тому +11

    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 !

  • @MitzpatrickFitzsimmons
    @MitzpatrickFitzsimmons Рік тому +4

    I just rceived my motors for my remote controlled lawnmower project yesterday... and today this video!
    Coincedence or Syncronicity?
    Either way... thanks Bill!

  • @bruinflight1
    @bruinflight1 Рік тому +4

    EXCELLENT TOPIC! Thank you for sharing this knowledge, I've got some projects in mind that I'd love to apply this to.

  • @rogueart7706
    @rogueart7706 Рік тому +1

    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

  • @erickbermudez8219
    @erickbermudez8219 Рік тому +3

    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.

  • @ernierasta
    @ernierasta 6 місяців тому +1

    Thank you! Your videos are so pleasant to watch and easy to understand!

  • @andrewrevelee5097
    @andrewrevelee5097 Рік тому +2

    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.

  • @Eagle621
    @Eagle621 4 місяці тому +1

    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👍

    • @rv10flyer84
      @rv10flyer84 12 днів тому

      Nobody outside of Aviation cares about our credentials.

  • @Graham1904
    @Graham1904 8 місяців тому

    An awesome video for those people just started with DC motor controlling. Brilliant!!

  • @TheUnofficialMaker
    @TheUnofficialMaker Рік тому +11

    Very comprehensive as usual, thanks for your efforts. I always learn a lot from your well made experiments.

  • @TYGAMatt
    @TYGAMatt Рік тому +1

    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!

  • @michaelkosciewicz1623
    @michaelkosciewicz1623 Рік тому +4

    Phenomenon! i start with electrical machines, this semestr. Great thnx Bill:)

  • @warrenking1815
    @warrenking1815 7 місяців тому +1

    Great video, real good information presented in a clear and thoughtful manner!

  • @Kamal_Kalyan887
    @Kamal_Kalyan887 Рік тому +3

    Thank you so much 💖 and I wish all the happiness be with you professor

  • @chadizdroid
    @chadizdroid Рік тому +1

    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.

  • @johneagle4384
    @johneagle4384 7 місяців тому +1

    Very comprehensive, very useful. Thank you very much!

  • @hammabuckshot5062
    @hammabuckshot5062 Рік тому +1

    Yet another amazing video,this truly magnificent.keep up the good work ❤️❤️❤️

  • @Googolplex6
    @Googolplex6 5 місяців тому +1

    Amazing video. I am a beginner but this video gave me the right answer were to start. 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.

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

    Perfectly explained, the right speech speed and super diagrams.

  • @LeslieIsgrigg
    @LeslieIsgrigg Рік тому +3

    👍 Very good course.
    Thanks again for your efforts.

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

    Another great video. These are so helpful. Thanks for putting them together. 🎉

  • @Mike.Kachar
    @Mike.Kachar Рік тому +5

    Thank you very much for the videos you do!

  • @U8uxa8SP
    @U8uxa8SP Рік тому +2

    Thanks for another wonderful video. I learned a lot.

  • @tungstikum
    @tungstikum Рік тому +3

    Thank you for all your quality content

  • @donaldkormos5529
    @donaldkormos5529 Рік тому +2

    Super video on motor drivers!! All the best to you ...

  • @crazytronics9917
    @crazytronics9917 Рік тому +5

    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.

  • @jackisgoofingoff5510
    @jackisgoofingoff5510 7 місяців тому +1

    This is so detailed and useful, thanks.

  • @user-px3kp9eg8v
    @user-px3kp9eg8v Місяць тому

    I couldn't find any like this. Thank you🎉

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

    Thank you for this very interesting video and workshop! Best regards from Germany!

  • @donodono2287
    @donodono2287 Рік тому +2

    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.

  • @millbean13
    @millbean13 5 місяців тому +1

    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.

  • @79ober
    @79ober Рік тому +1

    Hi Bill, great video! Thanks for trying out Cytron's MD25HV and happy that you like it.

  • @lesthompson5907
    @lesthompson5907 3 місяці тому +1

    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.

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

    Awesome! Thank you very much, you just released exactly the video I needed

  • @j.b.9474
    @j.b.9474 Рік тому +4

    Would love to see video on motors with position feedback.

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

    This channel deserves more recognition.

  • @q12x
    @q12x Рік тому +1

    Very good tutorial ! Thank you !

  • @tobi9648
    @tobi9648 9 місяців тому

    such a great video. exactly what I needed. Thank you very much!!

  • @Jeovanivm
    @Jeovanivm 10 місяців тому

    Thanks so much, I am from Brazil and I can understand you very well,

  • @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.

  • @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

  • @petermolnar6017
    @petermolnar6017 Рік тому +3

    Great as always! Thank you!

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

    Thanks! Very detailed and comprehensive!!!

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

    Parabéns! bem explicado! aprendi muito

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

    Nice variety in coverage. Bless 🙏

  • @GiC7
    @GiC7 7 місяців тому +1

    Master, I love the pr.oject. thanks

  • @JBernhard72
    @JBernhard72 Рік тому +1

    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!

  • @waynefilkins8394
    @waynefilkins8394 6 місяців тому

    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.

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

    Great explanation in your video. Very Professional.

  • @joshuaoduroadu5376
    @joshuaoduroadu5376 Рік тому +2

    Thanks Bill for another excellent 👍👌 video.

  • @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.

  • @ms.informed
    @ms.informed 10 місяців тому

    This is a godsend, exactly what I need for my next wannabe project, if I stop procrastinating, that is.

  • @ladiran
    @ladiran Рік тому +4

    Great tutorial.
    It will be appreciated if a display showing the motor speed could also be included.
    Thanks, again, for the tutorial

  • @simonlyons5681
    @simonlyons5681 5 місяців тому +1

    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!

  • @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!

  • @0dbm
    @0dbm 24 дні тому

    Excellent, love your video
    I been seeing all these dc driver cicuit , no one has said there are 3 different types of cicuit

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

    channels like this make our traditional school system looking obsolete

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

    Many thanks for perfect explanation ☺️

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

    I've got to admit that at 70 I'm too impatient to actually learn to code. I usually try an find some online project that looks like what I want to do and give it a try. Sometimes it works and sometimes it doesn't. But from that effort I pick up enough clues to come here and choose your video that seems about right, pay attention and usually get the thing going the way I wanted. Thanks for doing what you do.

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

    Absolutely fantastic content thank you!

  • @Hey_Steve
    @Hey_Steve 9 місяців тому +1

    Please do a video on driving 3 phase dc motors found in old computer printers so we can all repurpose them :) love your content!

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

    Great video, very valuable information!

  • @oljobo
    @oljobo Рік тому +3

    👍😃 Fantastic video! Thank You‼️

  • @eduardprivat9821
    @eduardprivat9821 7 місяців тому +1

    thx. amazing presentation

  • @mahmoodmohammad7241
    @mahmoodmohammad7241 Рік тому +1

    Great Tutorial, Thanks

  • @rich4239
    @rich4239 Рік тому +4

    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

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

    Perfect presentation!

  • @juliojoseruizolivo4697
    @juliojoseruizolivo4697 7 місяців тому

    Very helpful, keep doing this videos!

  • @paramtrx9558
    @paramtrx9558 Рік тому +1

    Thx again for a great video!

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

    Cool video ! Also, at 46:00 that's a nice power supply, it reacts super fast.

  • @ramybrahim3188
    @ramybrahim3188 6 місяців тому +1

    thank you from Morocco

  • @eneleich373
    @eneleich373 6 місяців тому

    Very usefully, thanks a lot

  • @chouseification
    @chouseification Рік тому +2

    Another great video!

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

    very good video. thank you!

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

    BTW: I see eBayers selling Wheel Chair motors without wheels. I found that Harbor Freight pneumatic wheels with 4 bolt holes line up perfectly, and cost around $5. You should knock out the inside bearing to fit the hub nut, and fill the tire with Fix a Flat or Slime since the valve stem will be on the inside mount side. I think they are the 4-5 in rim, white wheels. The IBT-2 45 amp motor controller works on a wheel chair motor. You can get the IBT-2 cheap 2 for $15. I bench tested my Wheel chair motor yesterday and it only pulled 10-12 amps under no load so there is plenty of amps left for a load. I believe DWS said the IBT-2 were 30 Amps continuous. 43 peak. I just looked on eBay Wheel Chair motor prices have skyrocketed They run from $130 to $200 each. It might be better to look on Craigslist and buy a whole chair for $100-300 from an estate sale. 5 years ago I got 2 eBay motors without wheels for $75. I also had 2 chairs given to me when a friend's mother passed away

  • @kryptocat4240
    @kryptocat4240 Рік тому +3

    Please make a video on F.O.C