Motor Driver | How to use Arduino Motor Shield to drive different types of DC Motors Part 1 | Ut Go
Вставка
- Опубліковано 18 жов 2024
- Learn about Arduino Motor Shield and how to use to drive different types of DC Motors.
In part 1 you will learn how to control simple dc motors. In part 2 you will learn to control stepper motor and servo motor.
Follow Us❤️/ Contact :
Instagram: / utgo_tech
Telegram: t.me/UtGoTech
------------------------------------------------------------------------
Code : bit.ly/48VC7QU
Components Link:
Arduino Uno Board : amzn.to/3GwFuS0
Arduino Motor Shield: amzn.to/3QuCyKa
Simple DC Motor : amzn.to/3XfkOVi
Stepper Motor : amzn.to/3k8qylv
Servo Motor : amzn.to/3CHEYQ1
12V Power Adapter : amzn.to/3vTTWhM
Library used: Adafruit Motor Shield V1 Library.
Other Videos and Tutorials Links :
• How to make Heartbeat ... : How to make heartbeat monitoring device
• What is MAX30102 and h... : How to use MAX30102 Sensor
• How to use OLED with A... : How to use OLED Display
• How to use Liquid Cry... : How to use Liquid Crystal Display | LCD
• HOW TO USE I2C LCD DIS... : HOW TO USE I2C LCD DISPLAY
• How to use RFID CARD R... : How to use RFID CARD READER
• DigiSpark Tutorial - I... : DigiSpark Tutorial
• How to program ESP8266... : How to program ESP8266 using Arduino IDE
• How to host web pages ... : How to host web pages using ESP8266
Thanks for watching this Video. If you liked this video then hit the LIKE button and share it.
Please share your questions, suggestions and thoughts regarding this project in the comment section below :)
Need any help, ask in the comment section
.
If you want to support me then please subscribe to my UA-cam Channel
-- bit.ly/34GtRnZ
Thanks, see you again in my next tutorial.
Here my Social Links:
Twitter: / utgo2
Facebook: / ut.go.524
Instagram : / utgo_tech
Like | Share | Subscribe | Comment
#Arduino #Motor #Shield #MotorShield #Robot #Controller #Driver #MotorDriver #DCMotor
Music: www.bensound.com
Song: Atch - Daydream
Music provided by Vlog No Copyright Music.
Creative Commons - Attribution-ShareAlike 3.0 Unported
Video Link: • Atch - Daydream (Vlog ...
#NoCopyrightMusic #VlogMusic #VlogNoCopyrightMusic
This is insanely well produced. So easy to learn. One of the best tutorials I have ever seen, thank you so much
Glad you liked it 👍
Very good explanation. Clarifies the relation between M1 M2 M3 & M4 motor connecting points and programing them in sketch. Please continue making simple but great videos. Great help for beginners.
Thanks👍
Amazing video !!
I was looking everywhere but finally found an amazing video
Glad you liked it!👍
Very supportive thankyou. Job done with a 12V 10A power supply. 4 motors.
Welcome👍
Thanks a lot! I had a problem with the M3 & M4
What problem. May be your M3, M4 IC is not working. You can try replacing the IC.
@@UtGoTech brother in my case:when I connect motors to M3 and M4 , motor not runs, what should I do please help
You should try replacing the IC
@@UtGoTech one more thing... If I giving supply to motor shield with 5000mAh should I have to remove the Jumper or not?
If you have different power source for Arduino board then the jumper must be removed. But if you to power the Arduino board through motor shield then you have to plug that jumper.
Excellent presentations. Even education colleges are not teaching like this . Easily understandable. May I request you to clarify my doubts.
Yes sure
very beautifully made us understand the code and motor with motor shield and use of jumper if external power supplied to shield i never seen any other tutorial such way as you described the all function it is a great tutorial power that you have i like it not me i feel all learner will understand it...thank you dear so much your efforts for new learner... i again thanks to you and expect more such beautiful tutorial in future ....God bless you for your kind support through this internet....
Welcome 👍
It really helped me alot....
I was going to make a project for science exhibition. .but when I go to ardiuno app to upload the code of motor driver ......it shows error ...showing af motor something. .......but after seeing this I downloaded the library of adafruit ........now its working 😮💨😀😀 THANKYOU
Welcome👍
After you use all 4 motors, are you still able to plug in other things like IR detectors elsewhere?
Yes, if you are controlling only 4 motors then pin 2,9,10,13 and A0 to A5 are free for use.
Thanks. Just worked out why I just destroyed twO UNOs. That jumper🤯🤬. i liked warnings and instructions on packets back in the day.
Welcome
Best explanation, thank you very much ❤❤❤❤❤❤❤❤❤❤❤❤
Welcome 👍
That's why I owe my university degree to the country of India. I genuinely love you all
Thanks and Welcome
Yeah, they are the ones who prepare all the educational/ tutorial stuff. Very helpful people
The best explanation of motor shield. Thanks a lot
Glad you liked it.😊
Awesome video. Very very well narrated and easy to follow tutorial. I tip my hat to you sir!
Thanks
Hi, I am making Arduino obstacle avoiding robot, so i have given seperate power to adruino and driving shield. I have given volte 6 to the driving shield, but my car is not moving properly, it's move slowly, so i have doubt that how much voltage supply we can give to shield???
First if you are giving separate power supply then make sure the jumper is not connected and as far as voltage is concerned 6 volt will work but make sure the 6 volt power supply must provide enough current to drive those motors.
Very informative! The motor you had used were 12v? or more/less than that...?
Can we use 4 motor each of (12v) ? and to run those motors what battery specification we need to use ? 12v is ok ?
Yes 12v should be fine. Try not to exceed 12v just for safety even though the boards are usually made to withstand till about 24v. Also yes you can connect up to 4 12v DC motors but use a high MAh battery or Ac to DC power supply so it works. All the best for your projects!
Correct 👍
Urgent please reply!!! I want to connect ESP32 Cam module with this how and which pins to use and what are all the digital pins available after you connected those motors ?
How do you want to connect?
What type of RC Car do you wanna make ?
Thanks for your effort sir
Mmm what does ut stand for
Welcome
very nice explanation sir.
Thanks
man you are my hero I was doing a project and now I am sure your video will help me so much , just one question btw I connected 4 motors to the driver and 3 Li batteries of total 11.1 volt and made code for them but after using it for a while on of the ICs got so hot and got burned smoking do you know what is the problem that caused it I bought a new IC and it is again getting so hot while moving the motors
Choose motors according to the current rating of the motor driver IC. Maybe the motors are drawing too much current which makes the IC hot.
@@UtGoTech I am using the simple yellow gear dc motors like all videos of making RC car are using it idk what is heating it maybe short circuit maybe the module can't hold the 11 volt
Use only 2 lithium ion batteries. Total 7.4V
can you take the inputs of buttons while using this shield?
Yes, there are some free I/O pins you can use.
Hello first of all great video
Im having an issue
Im connecting a 28BYJ-48 Stepper motor (I have checked the connections many times) and im powering the shield with a 12V 2A adapter
It doesn't rotate nor vibrate only it heats up
I was earlier using 2 nema17 motors and those weren't doing anything
Pls suggest me what am I doing wrong is it the supply issue or is my shield broken?
Ps - the led on shield does glow when powered with external supply i have also unshorted the pwr pins
Don't connect anything with motor shaft and try to operate it.
Please answer🙏🏻
Can? I connect mobile charger adapter (12v 5a) to motor driver SHILD for power . And I connect 2 tt gear motors. Is it work?
I make obstacles avoiding Arduino Robot in 2 wheels.
Yes. 12V 5A will work
Great explanation
👍
Hello Ut Go very nice video , i subbed but i have a small issue
so what happens is that i am using your same setup with shield and uno boards and two 18650 powerbank batteries to power the shield and a cable to power the uno. but when i run the 4 motors (small only) the ic on the shield heat up quickly in like 30 seconds. maybe it won't heat up without the cable connecting the uno to the laptop? please give confirmation. will appericiate it very much :)
If you are giving separate power supply to motor Shield and arduino Uno then make sure that jumper is not connected.
Thank you for the video! How long wires could be used for motor with this setup? Would something like 2 meters cause problems?
Yes you can use long wires. Try using thick core wire.
This is really helpful
Happy to help
@@UtGoTech i would like to ask help for my school project if i may? Im working with school project with the final goal of having automatic grass cutter. All i need is to have my dc motor program to run specific distance then change direction. Im using arduino uno and L293D motor driver shield. The problem is when i connect the dc motors in motor driver shields terminal such as M1, M2 ,M3 ,M4 it doesnt even work. Even when i try the exact experiment in the website of lastminute engineer it still doest work. So i try to put 1 wire of dc motor in M1 terminal then put another in ground and it work it move forward and recieve the command of stopping before moving forward again but the command about doing backward movement doesnt work and now its a dilema. I also try your experiment but i doesnt work i hope u can help me. is there any way to contact you directly and discuss my problem more. thankyou
Contact me on Telegram.
Thanks a lot. This helped lot for my projects. I want to control 4 N20 geared motors individually for camera automation and each motors will be controlled through GUI with momentary buttons. Hence suggest me if USB cable and power cable can be connected simultaneously for power and motor control...?
Yes, you can connect usb cable and power cable simultaneously after removing the jumper in the motor shield.
@@UtGoTech thank you so much
Welcome
Congrats! Great video!!
Thanks and Welcome 👍
After you put the last code for all motor after that we can remove the Arduino cable .? Will the code run if we only give power through motor shield
Code will run even if Arduino cable is disconnected but for that you have to connect the jumper in the motor shield
Great video! I am making a ball launching machine using a 12V 30W motor and a 16.8 Ah Lithium battery. Would this motor shield work with this setup? Thanks
No, you will motor powerfull motor driver.
I just need to run my motor for one sec once every 5sec inteval. Would L298N be ok to use?
@@UtGoTech Do you mean my motor is too powerful or I need a more powerful driver?
If you don't want to change the speed of motor the use relay.
Yes your motor is powerful that's why you need powerful driver.
Excellent explanation. would be better if you can say what are the voltage ranges that can apply for the shield also. Thank you
Welcome
We welcome your suggestion. Thanks 👍
Bhaiya I need your help🙏,
I am making Bluetooth control fire fighting robot in which we will use hc05 Bluetooth module,ardiuno Uno,4 BO gear,one water pump,battery, ardiuno motor shield can you make video by using this all component plz in 2 or 3 days and also provide me code and diagram of circuit as well
ua-cam.com/video/Pqs-3GgWW3s/v-deo.htmlsi=PrNxhjvAtUQLqbH9
Make this robot then contact me, I will tell you what more to add for the fire fighting robot.
Been very usefull. Thank you very much!
Welcome
can it be used for a drone/helidrone?
i recently bought L293D shield and the 2 motors I have to my helidrone are DC powered, but the L293D chip from the driver heats up. What do I do? Do I look for a different driver or do I add extra electronic parts for the motor? Keep in mind that the motor only vibrates and has a bad start (unless I start it manually). Thanks
This driver is not for drones.
This driver is heating up due to high current.
@@UtGoTech any other suggestions of shield/drivers for bigger motors?
Which motor you are using?
@@UtGoTech it's very unknown since the drone was a product from a shop, so I have no idea, unless the physical size can give a clue.
Generally drones have BLDC motor or Cordless Motor. If the motors have 3 terminals then it is a BLDC motor. If it have only 2 terminals then it is a coreless motor. For BLDC motor use ESC as motor driver and for coreless use some kind of MOSFET driver.
very easy to understand thanks bro!!!
Welcome
Hello, I hope this message finds you well. I'm currently working on a project involving an Arduino motor shield and four DC motors. I've encountered an issue where only two of the motors are functioning as expected. I would greatly appreciate any guidance or suggestions you may have on how to ensure that all four motors operate correctly. Thank you in advance
Try swapping the L293D IC's in the motor driver shield.
Absolutely helpful. Thank you 🙏❤
Glad it help👍👍
Is it safe to connect 7.4V power source to the motor shield??
Yes
I just want to ask sir if this type of motor shield can be able to move 250v
No
How can i randomise the intervals of a servo movement? Like lets say i want robot eyes to open and close at random times. And to keep doing that, until power is shut off.
You can use the "random" function in the Arduino IDE to generate a random number and use it as an interval.
Nice..good explanation
Thank You 👍
One doubt..
When you unplugged the usb from laptop how motor is rotating as your programming,is it save in Arduino?
As the jumper in the motor Shield is connected, the power is transferred from the motor Shield to the arduino board.
Sir, I want to connect 4 DC motors each of 12v with 10rpm .what supply do I connect to motor driver shield help me ...
Your can use multiple batteries in series. But make sure motors should not draw current more than 1.2A peak per channel.
What kind of battery is being used to connect the l293d? Does a 6F22 9V battery sufficient to rotate 4 dc motors? Please let me know on any other options if not!!
9V battery will not work. Use 2 lithium ion cells in series.
@@UtGoTech Thanks for replying!
Should I have to use 18650 cells?
Yes, you can use 18650 cells.
Good super sir VV good
Thanks
very useful vedio thank you
Thanks Bro👍
Hello sir can we use the mobile charger to drive the motor shield and Arduino Instead of battery.
That depends on the type of mobile charger
Ok
Can I use a 9V battery for Arduino and another 9V battery for L293D shield, removing the jumper PWR?
Yes.
Nice video!
Is it possible to make the motors rotate randomly in Arduino?
Yes. It's possible.
@@UtGoTech Thanks.
Welcome
Ref my last week clarification request. TKs much for your reply. When measured Voltage at the power input terminal of M.Shield it was 3.9 V.
How the 9 V external power supply applied at Arduino board shows( 3.9V) at motor shield power input terminal inspire of jumper removal ?
Is there any fault.? Anticipating your expertise comments.
Reason for the above question ::: Two 6 VDC motors connected to M3 & M4 ports. 6 V lead acid battery connected to motor shield ( on measurement it is 6.4 V.) . Motor speed set to 240 Code uploaded to run both motors. When I checked the voltage at ports M3 &M4 it was 5.8 V..
Motor wires removed and Voltage measured It was 6.1 V . Why there is a big drop of 0.3 V at M3 & M4 terminal ( No drop at input terminal )
Reason for getting 5.8 volt when motor connected and running at speed 240 : Arduino board uses PWM signals to control the speed of the motors. Arduino board controls the duty cycle of the PWM signal to vary the speed of motor due to which you will get average voltage at the motor terminal which will always be less than the input power supply. As you are running motor at speed 240 that's why you are getting voltage of 5.8 volt in motor terminal. If you decrease the motor speed further then the voltage in the motor terminal also decreases because it is showing average voltage. If you increase the motor speed to its maximum, that is speed 255 then in the motor terminal you will get almost same voltage as input supply voltage.
Reason for getting 6.1 volt when motors are disconnected.: When motors are disconnected no one is drawing power through the motor terminal and due to the presence of decoupling capacitors on each motor terminal you are getting higher voltage.
best place to buy Arduino board and Arduino shields
Where are you from ?
Which pins are the servos connected to if the motor shield is on a mega board
Same as Arduino Uno
@@UtGoTech thanks
Welcome
Really thank you for that sir
Most welcome😊
Can I connect it directly to the 2200 11.1v lipo battery?
Yes you can. But I suggest you to use a battery voltage of 7.4Volt.
I want to control 4 motor( 'any type of motors same or different type like dc or stepper or servo')independently in different direction and different rpm.it is possible or not with this sheild .if it not possible with this this sheild then which shield should i buy .
THANK YOU
Yes you can if you play smartly with timings and coding.
awesome explanation man!!!!
Thanks 👍
Can you have the motors stop at a certain level of torque/resistance?
This can't be achieved precisely by using this motor driver shield
Is it just coding to operate the motors independent from each other (at separate speeds for separate times at different stages of a process) or is required to add more elements to the circuit or change it?
Just coding
@@UtGoTech Sorry could you share the links of the specifications of the components that you used?
Brilliant video helped alot thanks
Welcome👍
Bro i want to make drone so should I have to put the same (200)speed code for the drone
You can't make drone using these type of motors.
How much voltage, amps i should give to arduino motor shield?
Voltage should be between 6 to 12 volt and current about 2 Amps.
loved the video and the way of explanation
Thanks 👍
Can we use 12v motor,will this motor driver give 12v output on each channel please tell me.❤
Yes you can use 12V motors and yes motor driver gives 12v PWM output.
@@UtGoTech thanku so much brother ♥️♥️♥️♥️
Welcome Bro👍
It's so helpful, thank you very much,
Welcome 👍
Thanks for initiating us!
Most Welcome 😊👍
@@UtGoTech I just activated the bell, am full nooby but and am looking to start building something using a Nano IoT with 6 axis, so any help or collaboration would be much appreciated!
Yes sure
Bro how to write code for blutooth module hc-05 to control Arduino blutooth based car.
You have to learn how to interface with HC-05 module.
Hi Sir! Is it possible to connect LCD display on this prototype to show motors are running/stopping if I'm using Arduino Mega 2560 board? And can also connect a manual circuit using stop/start buttons so that I can control the motors manually and automatically if I want?
If possible I do I connect the board and write the code?
Yes you can.
this video's good explain
👍
Hello! Please answer. As you can see on 1:52, on the lower right corner, there are rows of holes in there. I've followed a tutorial of an "Arduino Vacuum Cleaner" with this exact same motor shield, except his motor shield has like pins or something connected to the hole where you can insert something there, while in mine, it only have holes. However in the order that I've received, there are a row of black things with like a metal pin in it. What do i do? I really need to insert something to the holes in the bottom right
You have to solder those header pins in those holes so that you can connect the jumper cables directly.
@@UtGoTech thankyou, problem has been solved
Great 👍
sir , in my moter driver shield l293d, when i connect moters it is not working. i am useing 12 volt battery, plzz reply.
What type of battery you are using
It is a great video but I want to ask what is the voltage of the power supply you used?
2 lithium ion cells in series that is 7.4Volt
Hi,
Why did you set the speed to 200 and not 250 when you could have? And why shouldn’t you use the jumper when you give power to both the Arduino and the shield. Just out of curiosity.
Speed was set to 200 because I want to drive at lower speed.
Power rail of Arduino UNO and the motor shield is connected through that jumper. So in order to use different power supply you have remove the jumper otherwise heavy short-circuit current will damage the components.
Jumper is removed from shield. No power is connected to motor shield.When Arduino board is powered from external power source ( 9Volt battery) , the green LED in shield glows . Is it OK....
Any problem in Arduino board or shield.. Your help is very much helpful to me. Thanks
The led lights very dim without connecting the jumper. It is ok
very nice!! thank you so so much!! love the video design!
Welcome👍
Hello sir, I have question. How about if I wanted to use a HC-05 bluetooth module to control the motors automatically. How do I code that?
And about the speed you used 200, is it possible to increase the speed? What is the maximum speed I can use?
Yes you can use HC-05 Bluetooth module to control motors. For coding you can check out the code in Bluetooth RC car video and modify it according to your needs.
You can set the speed up to 255, maximum.
Can I know, M1,M2,M3M4 of motor driver get connected to which pin of the arduino uno?
In the case of using DC motor, pin11 for Motor1, pin3 for Motor2, pin5 for Motor3, pin6 for Motor4 , 4, 7, 8 and 12 for all of them are in use.
Can we control servo motors with Bluetooth module when servo connected to Motor Shield. Could u please explain it
Yes you can use servo motor, you have to use spare pins like A0 to A5
Sir I need your help so, I am making a All in one robot car with arduino of DIY channel and they are using only the smaller version of the motor driver which only have 1input and 1 output and I don't want to buy another one so can you please help me connect the regular motor driver with the code used in all in one car? If you can then please 🙏 help me. If you can make a different video about to make a all in one robot car then please make it of normal motor driver without buying the kit thank you.
Ok I will make All in one car and upload in upcoming videos.
@@UtGoTech thanks brother
Welcome
Sir how much volt battery and mah will be suitable , in order to provide power to motor shiels , so tgat it works.
7.4Volt 3000mAh
Sir will it work on 5200 mah
Yes, but use authentic battery
How much supply you have given to motor driver. I am using 9V battery but my battery is Discharging very fast. Could you please suggest which battery to use.
You can use lithium ion or lithium polymer batteries
I connected the Adafruit Shield driver to an Arduino Uno and then connected four DC motors to the Adafruit Shield driver, following the instructions in your video. The code was also identical and compiled successfully. I provided power to the Arduino board using a DC jack with two lithium-ion batteries, each supplying 3.7V.
Both the Arduino and Adafruit Shield are powered, but after starting to run the motors, the ICs inside the Adafruit Shield overheat. In fact, we can't run the four motors for even six seconds. Could you please help me solve this problem?
Look for speed setpoint, try reducing speed.
Check the actual voltage of the battery pack.
Don't use high power DC motor. You can use small DC motors.
Nice video. Well explained!
Thanks
Bro what if I Connect 7.4v DC Jack in the Arduino board will the shield works for 4 motors
Yes, It will work but not for long due to heating of voltage regulator in Arduino board.
@@UtGoTech yeah the same problem I have faced and my last shield damaged and now it's not working and also my last Arduino gone so please suggest me where should I give this 7.4v power and what should I do for that
this thing for doing human following bot
Connect power to motor shield.
Hi can i use 14v battery , two 5v dc motor and two 12v motor
14V is too high for the 5V motor.
You can try reducing the speed of 5V motor but this will reduce motor life.
for simple dc motors,Which command should we code like forward backward like which command for turning right or left
Can you explain in detail what you want.
@@UtGoTech Im typing a code for dc motor I want to turn it left what command should i type
For running in one direction use FORWARD command and for another direction use BACKWARD command.
@@UtGoTech and for left and right?
One motor can be rotated in either clockwise direction or in anticlockwise direction. No other direction is possible.
Super excellent 💯
👍
Sir what is the max power supply that the shield can handle
Can it handle 11 v 2400mAh,if not then what is the max mAh &voltage that it can handle.sir please help me
To be save give max upto 12 volts.
mAh is not issue.
Nice video. My question is; Since the motor shield sits directly on the arduino, can the arduino board be used to control any other device. Lets say an ESP8266 chip or any other motor driver
Yes. Although all the motors are connected there are still some gpio pins which are free and can be used for other purposes.
@@UtGoTech Thanks
Thank you very much!!!
Welcome
bro what is the power supply you have given to the motor shield
I have used 12v power adapter.
Excellent 👌
Thanks 👍
Hello sir, i have some question. Can i control the speed not from code ? For example control speed from potensio, or reading from sensor. Thanks
Yes
Do you have some example or reference for that ?
Don't have it yet
Hi,just found your videos. I'm currently working on some small project,and i think i can use this to solve my problem. I have zero knowlegde about arduino, i need to control 4 dc motors to run alternately, can you help me,maybe you know some website i can copy the code or learn to write my own code
You can follow this tutorial. You will be able to write your own code as per your requirement.
Thanks bro,i'll try to learn this a bit more before i use it on my project
Ok👍
Thanks!
Welcome!
Arduino uses 5vdc....if I want to puke around with 24v or 48vdc ....can I use Arduino shield....thanks pls
No
thank u sooo much sir..this video was very very helpfull...just subscribed :)
Thanks 👍
hello, can you help me about how to accord your code for a Shield motor L298P ? for motors i use TP101 kit and it not work.
This code uses Adafruit Motor Shield V1 Library which is designed for L293 motor drivers, you have to use different libraries which are designed for L298 Motor Driver.
I made a four wheel drive car, but the motors connected in motor 3 and 4 slot are running slower than the motor 1 and 2, is there any fix for this?
Have you used same motor ?
What is setSpeed for motor 3 and 4 ?
Can it be used with arduino uno wifi rev 2?
Yes