Тёмный

Multiple Servo Control with Arduino Uno R3 

Maker 101
Подписаться 165 тыс.
Просмотров 397 тыс.
50% 1

DIY Home Security - New Video: • DIY Simple PIR Motion ...
In this tutorial, we will learn how to use multi-servo with Arduino. We will control 4 servo motors with Arduino PWM outputs.You can implement your robotic arm projects with reference to this tutorial. Of course we will use external battery / power when doing this.
In the next tutorial, I'll show you how to use multiple servos with potentiometers. Do not forget to subscribe. Thank you for your support.
I did not share the code because it is short and it varies according to the number of servos. You can write code by watching the tutorial. This is a better way to learn. I will continue to share long and complex codes.
Required Hardware
Arduino Board:
goo.gl/UyGYeF
amzn.to/2LZr6t4
Servo Motor x4 :
goo.gl/iOkPgu
amzn.to/3avwe1N
Wires :
goo.gl/VRzUN4
amzn.to/3doetmT
Breadboard :
goo.gl/yCa8hX
amzn.to/3qxLxwm
Recommended Items:
Use Your Muscles in Project - amzn.to/3wdL45C
37 Sensor & Module Packages - amzn.to/3m66WeQ
Try this Robot Arm - amzn.to/3fq8DCl
Best Resin 3D Printer - amzn.to/39tY8KB
Arduino Compatible Kits - bit.ly/2J2AFF7
Connections:
The external battery VCC / GND connect to the breadboard.
The Arduino GND connect to the breadboard's GND input
The servo connections we use in this project are as follows;
Orange Input - Signal Input
Red Input - Power Input (VCC)
Brown Input - Ground Input(GND)
The Servo1 VCC and GND connect to the breadboard's VCC / GND inputs
The Servo1 Signal connect to the Arduino Digital PWM 3
The Servo2 VCC and GND connect to the breadboard's VCC / GND inputs
The Servo2 Signal connect to the Arduino Digital PWM 5
The Servo3 VCC and GND connect to the breadboard's VCC / GND inputs
The Servo3 Signal connect to the Arduino Digital PWM 6
The Servo4 VCC and GND connect to the breadboard's VCC / GND inputs
The Servo4 Signal connect to the Arduino Digital PWM 9
Source:
Web Site: www.mertarduino.com
Social Media:
/ mertarduino
/ mertarduino

Наука

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

 

12 дек 2016

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 279   
@govorilegko
@govorilegko 7 лет назад
I love your videos so much (those comments and descriptions to the code) thank you
@3flyingkitty3
@3flyingkitty3 5 лет назад
Thank you Mert, I was able to realize I had a few fried microservos in the bunch.
@sultansrv
@sultansrv 7 лет назад
exactly what i was looking for !! im using 3 of the same servo motor and 1 a bit larger with metal casing. im gonna try this now. thanks.
@cwrigh13
@cwrigh13 7 лет назад
best Arduino servo video on RU-vid
@fox.q3055
@fox.q3055 3 года назад
by TR
@TehnoVito
@TehnoVito Месяц назад
This video helped my a lot in my robotic learninng proces. Good job!
@BJamesThompson
@BJamesThompson 3 года назад
THANK YOU!!! This is exactly what I was looking for :)
@AliRaza-ku9io
@AliRaza-ku9io 7 лет назад
my first video to learn about arduino coding for servo motors :) great work man.. liked and subscribed.. ☺
@AliRaza-ku9io
@AliRaza-ku9io 7 лет назад
+Mert Arduino and Tech always welcm :)
@Kipyminyman
@Kipyminyman 7 лет назад
Oh my goodness, you are a life saver, thank you!
@nihalkeetha
@nihalkeetha 7 лет назад
I always wanted to know how do we control multiple servos with arduino now u did that
@mariobaracus2619
@mariobaracus2619 3 года назад
You helped me alot understanding how to do this without friying any servo, im using expensive ones so it would be bad to frie them
@XxGameBusterxX
@XxGameBusterxX 4 года назад
I really enjoyed this video alot it was simple and I'm super glad you commented oh what the program does I'm a novice when it comes to this so it was great and easy to follow thanks alot
@leandro3710
@leandro3710 6 лет назад
thanks for the video, and thanks to the mute option too
@CobraEditx404
@CobraEditx404 10 месяцев назад
as i can see all the motors are moving in a same direction but I want the each motor to rotate different directions is possible
@unglaubichuberlieber8048
@unglaubichuberlieber8048 5 лет назад
good tutorial, thanks !!! one question, if these servos were attached via a shield like l298n/vnh2sp30 what needs to be changed ??? thanks for you attention
@wojciechchojnacki7757
@wojciechchojnacki7757 2 года назад
Good video, but what gets me is this: On your code delay of 100ms seems to be controlling servo's angular offset speed (time interval between each angular step?). So therefor 15ms between each angular offset step results with faster operation of the servo. When I'm using the same code, delay acts on a time interval between each full 180 degree sweep. So with a 100 ms my servos are shaking (as they cannot reach full 180 travel in that time) and I need something like 2000 for them to perform full sweep. I have used a breadboard first, than an expansion shield with Tower pro Sg90 servos, both operate more or less the same. Do you have any idea why is it acting different?
@fatmahanc2211
@fatmahanc2211 4 года назад
Very instructive and clean code.
@minecraftvideos3435
@minecraftvideos3435 4 года назад
Thank u so much this video has helped me alot
@petermaker76
@petermaker76 7 лет назад
thank you for upload this
@computertime4336
@computertime4336 Год назад
This was a very good video i learned a lot 👍
@juanbriones1760
@juanbriones1760 7 лет назад
Mert Thanks for your videos tutorials. .can you please do ir remote control car with old fashion motor shield no who you solder the pins up like the video number 2
@ddhruvarora8034
@ddhruvarora8034 5 лет назад
Thanks a lot for this .
@shipcake12
@shipcake12 7 лет назад
I love This Chanel
@jeremy11allen
@jeremy11allen 5 лет назад
Would using an external power source like this work for powering a larger 20kg servo that has a 6v power requirement?
@cordellbrooks6365
@cordellbrooks6365 7 лет назад
Can I use any signal inputs?????
@amritlalsingh7780
@amritlalsingh7780 7 лет назад
if you keep uploading videos like this .one day you will be the greatest arduino channel
@drcarrosdepapel
@drcarrosdepapel 2 года назад
Nice video, u help me much... thx :)
@MamunKarimtoyforusrc
@MamunKarimtoyforusrc 7 лет назад
im facing problem with 2 pen tilt servo... using valu flysky th9x reciver with arduino ... 1 servo is working but when i use two serov ..thats the problem start...can u plz helm me
@recepselimagrman829
@recepselimagrman829 2 года назад
I can't believe such important point is missed there, those servos (SG90s) are rated at 4.8V-6.0V absolute ratings. 9V is way pushing it. This might (probably will) fry the motors!
@akihasc7047
@akihasc7047 Год назад
no..at least 8.3 V needed to run this project..
@recepselimagrman829
@recepselimagrman829 Год назад
@@akihasc7047 Not really.
@isagumus1
@isagumus1 Год назад
Would be true if only a constant voltage DC power source was used but in this case, there’s only a simple 9V battery. Mind the voltage drops after running 4 of the servos. So it’s totally fine.
@atharvsalunke5390
@atharvsalunke5390 Год назад
No brother
@galagatron5319
@galagatron5319 Год назад
Im confused too because I read the same data on these servos. THinking these would be fried. Could I also have a theory that since there are 4 servos that sharing 9 volts would give each servo about 2 and 1/4 volts. Damn this connudrum.
@KyawZawHlyan
@KyawZawHlyan 4 года назад
nice and simple to understand
@Mintsel
@Mintsel 6 лет назад
Can you do that in the same way with the arduino pro mini?
@frankschulz3849
@frankschulz3849 2 года назад
Hello, yes, I was looking for that too. But I have a problem. Since 2 of my servos are mounted in a twisted position, servo 1 and servo 3 should always run backwards. That is, in the first pass of the movement. So servo 1 and servo 3 from 0 to 180 degrees and at the same time servo 2 and servo 4 from 180 to 0 degrees.Can this also be realised in the Sketch?
@margieblack1922
@margieblack1922 6 лет назад
Wow that is awesome
@josdodemont9570
@josdodemont9570 7 лет назад
Thanks for your videos tutorials but is it possible to connect 5 or 6 servo,s ? Thanks !!!
@dkumarin
@dkumarin 7 лет назад
Thank you for sharing the video. It is a good idea that you could avoid the motor shield. Please respond.
@alejandrosiabato4229
@alejandrosiabato4229 2 года назад
Bro, es posible dentro de un ciclo for, meter un(if) o sea un condicional para lograr mover dos servomotores al mismo tiempo, y que giren en el mismo sentido los dos?
@Racerr258
@Racerr258 2 месяца назад
Are you able to make each servo move independently of each other with this method? Or will they always be in sync
@boombastic1324
@boombastic1324 3 года назад
If i use 5 tower Pro mg 996r servos is it going to work
@tayyaraga3666
@tayyaraga3666 5 лет назад
Birbirinden bağımsız (servo 1 60 derece, servo 2 90 derece, servo 3 180, servo 4 110 derece) döndürmek mümkün mü?
@jeremyrivera9085
@jeremyrivera9085 2 года назад
How would you add a button to this set up and how would you write the code for it? Thanks!did this set up, my only problem I ran into was my power supply wasn’t strong enough, so I’ll get one or two servos working, just waiting on a new power supply thanks for any info!
@raymundorojano8183
@raymundorojano8183 7 лет назад
it´s only comment and why my AR-3606HB's servo model gives out a bucnh of movement and do not makes smaall circles by largest circles
@Nai-cq5yq
@Nai-cq5yq Год назад
Let say I want command 4 servo at the same time and same position like in the video, can't I connect it parallel in one pwm pin? Im looking for an answer for this.
@thenews25
@thenews25 3 года назад
Best informative video...... Thanks
@mohamedelbachirbelalmi3751
@mohamedelbachirbelalmi3751 7 лет назад
thx so much............you Saved me
@Marcus-pv9le
@Marcus-pv9le 5 лет назад
I heard if you can hook up a mic panel connect to arduino and control panel you can operate multiple servos with voice command is that possible
@krishnadas6832
@krishnadas6832 7 лет назад
Great Work.Thanks a lot.
@thoreyolfmster4400
@thoreyolfmster4400 4 года назад
Amazing video anyway :>
@NickB2513
@NickB2513 2 года назад
Hello, I'd like to be able to make servo 1 move 180degrees then after 5 seconds make servo 1 move 180 degrees. And so on for all 4 servos. I've tried to do this using the delay but all the servos are moving at the same time. Can you help? Thank you
@HOBBY-MASTER
@HOBBY-MASTER 3 года назад
Awesome video ! Can you please tell how to control multiple servo motors with switch without using arduino
@karabgut
@karabgut 3 года назад
merhaba ben toplamda dört servoyu bir ardunioya bağlayıp HCRS04 'den gelen verilere göre servonun açısını değiştirmek istiyorum while döngüsünde uzaklık örnek olarak 10 cm olursa 45 derece döndür diyorum olmazsa başka bir while döngüsü yapıyorum fakat ilk uzaklık değerini aldıktan sonra servom açı değiştirmiyor,bana yardımcı olabilir misiniz? Uzaklık her defasında ölçebiliyorum ama servo sadece bir kere çalışıyor.While'ın içine gelen değerim değişken acaba o değeri bir kez okuyp döngüden çıkamıyor mu anlayamadım
@jogithajohn5689
@jogithajohn5689 5 лет назад
how do you control one servo after another? what change should be made
@jacopotech
@jacopotech Год назад
hi, i'm new with arduino, i have a question: can i also attach the 9v battery directly to the arduino board and not to the breadboard or i need to attach one battery to the arduino board and one to the breadboard? and also, i can rotate it only at 180° or it can rotate at 360°?
@ChadManCreations
@ChadManCreations 7 лет назад
How long will the 9v battery last running 4 servos
@gijsdollenkamp8471
@gijsdollenkamp8471 3 года назад
what if you want 2 servos to do 2 different things at the same time?
@elijahbyrd3370
@elijahbyrd3370 4 года назад
What could I do to control all 10 of my servos?? How many pins would I use?
@ArluxmanTukaNgoprek
@ArluxmanTukaNgoprek 6 лет назад
thank's to tutorial..
@stefane7219
@stefane7219 7 лет назад
Great video I will be trying to make a project with arduino .. Will try using more then one servo... and diffrent angel!... Do you have some video about it!? I will use 2 servo trying to do some cool with it
@Cavi587
@Cavi587 2 года назад
Isn't 9V a bit too much for these micro servos?
@muhammadyezabaihaqi2215
@muhammadyezabaihaqi2215 3 года назад
why do you use 9v? As I know mini servo maximum voltage is 5v
@rabinlamichhane2657
@rabinlamichhane2657 7 лет назад
Can i use a 6 v battery instead ? Will it work fine or not ?
@alexagordn
@alexagordn 7 лет назад
how can I connect 2 gps modules NEO-7M to arduino?
@Foxionos
@Foxionos 7 лет назад
could you tell me how i could make these run on different speeds (delays)
@mohamedahmed534
@mohamedahmed534 3 года назад
@Jörgen #2 where?
@aiversity5975
@aiversity5975 3 года назад
Change the delay of the code in different servos
@flybobbie1449
@flybobbie1449 3 года назад
delay(100) roughly delay(25000) is 20 seconds, just working on this now. I read wrong you want different speeds. Delay is before next step. Try; void loop() { myservo1.write(pos); delay(2500); // delay before activate servo 25000 is about 20 sec for (pos = 0; pos
@blevlabs
@blevlabs 3 года назад
Program the Arduino using the servo library
@matharjun
@matharjun 3 года назад
Using for loops
@anilkanojia3361
@anilkanojia3361 4 года назад
I am also trying something new.. So please answer that how many servo motrs can be controlled using different digital io pins at a single arduino board...
@plavali_znaem
@plavali_znaem Год назад
May I ask stupid question: so there’s a voltage supply both from computer and from the 9V battery ? Or is it so that he uploaded the code, and after that disconnected the arduino Uni from the computer, and only battery used as the source of energy?
@jordandecade8266
@jordandecade8266 7 лет назад
what is that piece that you put in the battery called?
@yunusemreturan2750
@yunusemreturan2750 3 года назад
Thank you
@magical_spirit_wolf
@magical_spirit_wolf 5 лет назад
How do you make the connections permanent and not use the bread board?
@AmbieWolfie
@AmbieWolfie 6 лет назад
Great video! Please excuse my ignorance of the subject, but how does the 1 signal wire enable the servo motor to travel in both a clockwise and anticlockwise direction? I always thought reversing the direction of the motor required switching the polarity of the positive and negative terminals -- though this is for general motors, rather than servos.... gaps in my knowledge, ah! Any advice is very much appreciated, thank you :)
@matthewwells1826
@matthewwells1826 2 года назад
the servo is controlled by PWM ( DC current but in pulses, the width or "time on" of the pulse determines the servo position),
@ethanc3552
@ethanc3552 3 года назад
Is there anyway to control all of them with a single push button/ switch???
@nilimakulkarni4541
@nilimakulkarni4541 9 месяцев назад
can i use uno or nano instead of R3 for the same?
@johncaballero4333
@johncaballero4333 2 года назад
Hello sir, I my servo doesn't react to servo.write(angle). it only react to for loop code. Why is that? I'm using same sg90 servo motor.
@jamesholden8982
@jamesholden8982 7 лет назад
How do I get the servo to run continuously?
@xxBSWgamesxx
@xxBSWgamesxx 5 лет назад
If you wanted to start the servos off at different positions could you just do int servo1Pos= 0; int servo2Pos= 90; int servo3Pos = 120; or would you have to do something else? also is there a way to make it so it would stop once it gets to a certain degree then press a button to return to the starting position? what we would i need?
@sidhath98
@sidhath98 7 лет назад
Can someone tell me what would happen if I do not use common ground for arduino and servo?
@ismailtaiwo2034
@ismailtaiwo2034 3 года назад
I love dis
@fawzibryankairouani9539
@fawzibryankairouani9539 7 лет назад
How can you make them run all at the same time, but each one at a different frequency and a different duty cycle? For example, the first one would do 0 to 45deg back and forth while the second one is doing 0 to 90deg and the third one 0 to 180deg back and forth.
@stephenkamin1345
@stephenkamin1345 5 лет назад
I his is very difficult to do as the servos are noisy. I was only able to run two from one arduino... any more and the added one ran erratically.
@Robonza
@Robonza 5 лет назад
I did a video on fully independent control.
@vishnupriyatummala801
@vishnupriyatummala801 4 года назад
@@stephenkamin1345 yeah same problem I was able to run only 2 servos from one arduino...
@Iliuzija666
@Iliuzija666 3 года назад
When I connect one servo, it works but when I connect more than one, every servo starts rotating without paying attention to the for loop. Looks like I checked everything. I even took another UNO, nothing has changed. Why is that?
@jimbobbyrnes
@jimbobbyrnes 4 года назад
i can only get one servo to move all the rest stay still. they are high torque servo's running on a high output lithium pack.
@vishnupriyatummala801
@vishnupriyatummala801 4 года назад
I am able to run only 2 servos... The signal is coming from only 2 pins,even though I write code for 4 pins... pls help me out
@saadaljurais8083
@saadaljurais8083 7 лет назад
Thank you so much. I have 3 important questions 1) Is this connection series or parallel? 2) If i have 5 servo motors (MG996R) and I want to use (Battery) what is the value of voltage and current that i need to apply so it works very well and there will be no damage ? 3) Do i have to care more about the current or voltage, so they can run ?
@mohamedelbachirbelalmi3751
@mohamedelbachirbelalmi3751 7 лет назад
from the video the connection are in parallel .....we have the same problem bro i hop he lestting to us
@larttv518
@larttv518 7 лет назад
we have the same problem :(
@just2jimify
@just2jimify 7 лет назад
If you put the motors in a parallel circuit then they will all recieve the same voltage which is a good thing! You want the voltage to be fixed at the voltage required by the servo (the allowable range will be quoted by the servo supplier. probably somewhere between 3.7 and 5v) You then want a battery that supplies enough mAH to keep your servos running for as long as you require.
@dragosbalmau
@dragosbalmau 6 лет назад
Did you found a solution ?
@nihalkeetha
@nihalkeetha 7 лет назад
I have a suggestion for another video for u where can I say that can u say me
@plavali_znaem
@plavali_znaem Год назад
is it ok to use 9V battery? Won't I burn the servos?
@sinanozgur530
@sinanozgur530 6 лет назад
bende birisi çalıştı diğerleri çalışmıyor neden ?
@sumitpanwar5408
@sumitpanwar5408 7 лет назад
can i connect more servos to this please make a video adding more servos to this project
@alainav1
@alainav1 4 года назад
the 4 motors can be cable on a single pin
@diontiksna2443
@diontiksna2443 7 лет назад
Why do my servo keep vibrating and won't rotate properly? Thank you in advance
@isaiahschwartz1381
@isaiahschwartz1381 6 лет назад
Do you need to have your uno plugged into the computer to control the servos or can it run just on the battery?
@CATCATDovahkiin
@CATCATDovahkiin 6 лет назад
You can just run it on the battery.
@jordandecade8266
@jordandecade8266 7 лет назад
and where can you find it?
@opgamer-abhi9476
@opgamer-abhi9476 6 лет назад
Which software u use to burn coding
@schoolexamhelp1440
@schoolexamhelp1440 3 года назад
Can we also connect 10 motor in this circuit
@rocioguevaraobando9075
@rocioguevaraobando9075 6 лет назад
Gracias
@nanaagyarko6516
@nanaagyarko6516 6 лет назад
How do we programme the servo to work one after the other but not at the same time
@spencerdebenedetti5204
@spencerdebenedetti5204 5 лет назад
delay(100);
@sadhankumar7908
@sadhankumar7908 5 лет назад
@@spencerdebenedetti5204 what to do with the delay(100)?
@spencerdebenedetti5204
@spencerdebenedetti5204 5 лет назад
@@sadhankumar7908 if you write delay(300); or any other number after a line of code it will delay before the next line.... So for example with LEDs ( i dont know servo code by heart) it would be digitalWrite(LED1 HIGH); delay(300); digitalWrite(LED1 LOW); this puts a delay in between the commands. I hope this helps
@eriknestaas2270
@eriknestaas2270 7 лет назад
could you also use a 9V battery with a jack that fits into the arduino?
@saysoy1
@saysoy1 5 лет назад
Sure arduino supports 9v
@ehsiehs368
@ehsiehs368 5 лет назад
@@saysoy1 what is the maximum volt support of this arduino uno r3?
@kartechindustries3069
@kartechindustries3069 3 года назад
How u are using 5v servo with 9v supply
@stormmaster1403
@stormmaster1403 Год назад
help every time i televeers it gives me this Sketch uses 2302 bytes (7%) of program storage space. Maximum is 32256 bytes. Global variables use 61 bytes (2%) of dynamic memory, leaving 1987 bytes for local variables. Maximum is 2048 bytes.
@iflystuff8955
@iflystuff8955 2 года назад
I typed out everything you did but for 2 and it’s not working. They only move like a mm? What am I doing wrong
@dipentandel10
@dipentandel10 6 лет назад
Please give me a answer.... What a Arduino pin 1,2,4,7,8,12,13 connect with servo motor ?????
@mohjishankhan2047
@mohjishankhan2047 5 лет назад
yes bro i also want reason.
@omerfarukboyrac9740
@omerfarukboyrac9740 7 лет назад
How can I read position of servo?
@MakerDan55
@MakerDan55 7 лет назад
You haven't shown how the Arduino gets power. Can you explain that? thanks,
@linuxphone9063
@linuxphone9063 5 лет назад
exactly he shows how to power the servo but not the arduino
@minecraftvideos3435
@minecraftvideos3435 4 года назад
The 9volt battery has powered the servo and with the uno if u connect the cable with it to a computer it will just come on u do not need a battery source for the uno
@DIYTechGuyShow
@DIYTechGuyShow 3 года назад
You need to run a wire from the Positive Rail to the VCC input on the Arduino. The Negative Rail should also be connected to the GND Pin of the Arduino.
@phuocattran8338
@phuocattran8338 7 лет назад
i love u very much
Далее
Using Servo Motors with Arduino
43:06
Просмотров 1,4 млн
Multiple Servo Control with Potentiometers and Arduino
7:59
Arduino multiple servo's the simple way
18:34
Просмотров 32 тыс.
Connect Up To 992 Servos To An Arduino, Using I2C
7:47
Arduino UNO Tutorial #3 - Servo Motor Project (Set Up)
11:16
Positional vs Continuous Rotation Servo Motors
6:48
Просмотров 76 тыс.
DC motor PID speed control
15:29
Просмотров 226 тыс.
Top 20 Arduino Projects | Arduino project compilation
24:55
Servo Motors, how do they work?
15:12
Просмотров 1,9 млн
Basic Arduino Servo Control for Model Railroads
19:55
iPhone 16 - 20+ КРУТЫХ ИЗМЕНЕНИЙ
5:20
ЗАБЫТЫЙ IPHONE 😳
0:31
Просмотров 20 тыс.