Source Code: github.com/MertArduino/Multiple-Servo-Motor-Control-with-Joystick-and-Arduino 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 Banggood Spring Sale - bit.ly/3slMbOn
@GhostRiderSpiritOfVengeance3 жыл бұрын
I spent my entire weekend looking for a tutorial that describes how to set this up in full detail from a beginner standpoint. Thank you.
@Julians_vlogs7 ай бұрын
Same
@samuelhawksworth19237 жыл бұрын
I’m subbing to you dude, I’ve been needing this help with my project for a year and your the first person to help me in an easy way
@vidmantasjuska40847 жыл бұрын
Here is code people //add the servo libary #include //define our servos Servo servo1; Servo servo2; //define joystick pins (Analog) int joyX = 0; int joyY = 1; //variable to read the values from the analog pins int joyVal; void setup () { //attaches our servos on pins PWM 3-5 servo1.attach(3); servo2.attach(5); } void loop () { //read the value of joystick (betwen 0-1023) joyVal = analogRead(joyX); joyVal = map(joyVal, 0, 1023, 0, 180); //servo value betven 0-180 servo1.write(joyVal); //set the servo position acording to the joystick value joyVal = analogRead(joyY); joyVal = map (joyVal, 0, 1023, 0, 180); servo2.write(joyVal); delay(15); }
@Melon-eu1sr7 жыл бұрын
Vidmantas Juska your a life saver!!
@maevebaksa7 жыл бұрын
Thanks from Budapest!
@MrHristoB7 жыл бұрын
Aciu!!! :-)
@mettigel13577 жыл бұрын
Thank You
@pablo271idn97 жыл бұрын
thx
@dngineer9 ай бұрын
Perfect. Came in clutch for my Engineering NEA exam. Thank you so much
@MrHenryrolls7 жыл бұрын
Lovely clear tutorials Mert. Thank you. Just one concern, the servo in my kit looks identical (SG90), yet checking its operating voltage online it's 3.0-7.2v (ideally 4.8v). I don't want to blow it on my first attempt.
@derrickchilders6185 Жыл бұрын
It’s blew my board! Don’t try it.
@mikeoxmaul9386 Жыл бұрын
@Frectieyou don't need to add a battery if that is the servo spec, just plug it straight into the board
@lordnever16 жыл бұрын
This is my very first Arduino project and it worked great! I am so happy that I watched this video. Time for my next project, thanks a lot great video!
@kamenstefanov28116 жыл бұрын
Didn't you have error in the code?
@kkrokingkiller4564 жыл бұрын
@@kamenstefanov2811 for me it does't work
@kamenstefanov28114 жыл бұрын
@@kkrokingkiller456 it was a long time ago but i remeber that the mistake was very simple if you look closely you'd find it
@kkrokingkiller4564 жыл бұрын
@@kamenstefanov2811 thanks
@MultiCreasey8 жыл бұрын
Thank you, a really clear and helpful video. Appreciate your time in making it and for sharing.
@maevebaksa7 жыл бұрын
Agreed! +1 Subscriber!
@luisangelherndezramirez4334 жыл бұрын
Holaaaa
@daxliniere3 жыл бұрын
The problem is that when you release the joystick, the motor returns to the centre position. The code also needs some averaging to account for the jittery values from the A/D converter.
@PatrickGreil-n6j Жыл бұрын
Have you found a solution to this?
@Maggot-ov4eu6 жыл бұрын
This is so under appreciated. Thy is had to be the best tutorial
@zzzzzz...99027 жыл бұрын
It works! It works! The dislike button works! Joke, the circuit works and the like button works. Runs like my girlfriend.
@zzzzzz...99027 жыл бұрын
Your welcome. Sorry to hear about your computer, I fix them for a living, xd.
@tommybirchify6 жыл бұрын
@@zzzzzz...9902 good one XD
@hieroja14 жыл бұрын
wtf bro
@mateom72014 жыл бұрын
So dirty?
@realSethMeyers3 жыл бұрын
I have tuberculosis
@FerencHegyi Жыл бұрын
Thank you, it was very useful for me. Greetings from Hungary.
@indivsultanabinavsi89097 жыл бұрын
Not All Heroes wearing capes. Thank you for the tutorial
@dokepravin29162 жыл бұрын
cleanest video made for any Arduino project. Thank you for sharing!
@aniketpratap83873 жыл бұрын
Excellent and Such a simple explanation ….. People like you make this world a better place....
@MarineSimFan2 ай бұрын
Maker 101 it's a nice teacher. (btw nice tutorial thank you) I don't think anyone on KZbin has ever shown how to control both servos with a single 2-axis joystick in different way. both the same time and.... The scheme of this operation is apparently simple, using one 2-axis joystick, but I don't know how to program it. Of course, a bidirectional version for servos is enough. description: joystick front: both engines forward joystick reverse: both engines reverse joystick left: left engine reverse right engine forward joystick right: left engine forward - right engine reverse It would be useful for a tank with A2122 brushless motors - connected to ESC controllers, but I haven't seen such a tutorial on Arduino yet. 😓
@benfree_man5 жыл бұрын
I appreciate this so much. Helped me a ton!
@zTowerDive2 жыл бұрын
Awesome video, dude. First time using servos and i feel very accomplished. +1 like
@aldrinlimos51594 жыл бұрын
Just bought an Arduino recently, and I hadn't read any of the documentation yet. Took me an hour to try and fiddle with the wonky 0-512,512-1024 range with some crude equations to have the servo move with the switch. Kept freezing and moving occasionally before I decided to look for a video like this :P.
@spamton_bigshot283 ай бұрын
I understand this very well but could you please tell if and how it possible to add more joysticks and servos for those ones all at once. If so thankd ❤
@MadhuVishwanath7 жыл бұрын
Why was the battery used? The modules could be powered by the arduino right?
@KIVPush7 жыл бұрын
Hello, wonderful video. I built one with 4 servos. 2 servos are controlled if the button is not pressed. The other 2 are controlled when the button IS pressed. I can only control the second 2 when the button is pressed and held down. Is there a way to write a code so each time you click the button it switches back and forth between each servo set? Like if I click the button and then release it, it switches to one set. If I click it again and release it, it switches back to the first set. Is there a way to do this?
@JustinS062 жыл бұрын
I know I'm late, but for those looking for the same thing here it is: First of all, it's really easy. You just need a boolean which is either True (1st mode) or False (2d mode). At the start of loop(), check if the button has been pressed, if so do this: bool Mode = True// True will be the 1st mode and False is the 2d mode. void loop(){ if (the button has been pressed) Mode = !Mode // Doing this sets mode equal to the opposite of mode. So: if it's True, it will be False and vice versa. // check if Mode is true, if so, control the first 2 servos // check if Mode is false, if so control the last 2 servos }
@andreabinotto99307 жыл бұрын
Thank you, great tutorial ;), what's the name of this song?
@saqibcom6 жыл бұрын
//add the servo library #include //define our servos Servo servo1; Servo servo2; //define joystick pins (Analog) int joyX = 0; int joyY = 1; //variable to read the values from the analog pins int joyVal; void setup() { //attaches our servos on pin PWM 3-5 servo1.attach(3); servo2.attach(5); } void loop() { //read the value of joystick (between 0-1023) joyVal = analogRead(joyX); joyVal = map (joyVal, 0, 1023, 0, 180); //servo value between 0-180 servo1.write(joyVal); //set the servo position according to the joystick value joyVal = analogRead(joyY); joyVal = map (joyVal, 0, 1023, 0, 180); servo2.write(joyVal); delay(15); }
@rebeccatorbergsen3 жыл бұрын
this is why i follow you, quality videos
@fazmisharaff88397 жыл бұрын
Plz make a wireless version using a bluetooth module but great video you just got a new sub!
@vivekdixit51496 жыл бұрын
Fazmi Sharaff i am agree with u
@charlescaudill670 Жыл бұрын
Is there any way to control the servos as a unit. I need both servos to go forward when i push the joystick forward but one to back off as i pull the stick sideways. All I’ve been able to find is the configuration shown in this video
@teedee93936 жыл бұрын
Does the battery need to be connected directly to the breadboard, or can I connect it via the Arduino's power port?
@ZenHulk7 жыл бұрын
i'm a beginner....can i hook it up just as you directed, but have two servos work on the Y and one on the X axis. Thank You i find lots of useful stuff on your tutorials.
@pepmichael90457 жыл бұрын
Can I ask you some question? Why does some of my servo rotate 360 degree? Thx. for tutorial. It's easy to understand :)
@adin_3360 Жыл бұрын
did servo need library for programing it?
@dhakshingk4 жыл бұрын
hi there, awesome video, but do you know if it is possible to connect the joystick ground and vcc to the breadboard?
@magicianofelectronics9514 жыл бұрын
if I have got you right, Yes, you can do it by making common Vcc and ground line on bread board,
@JustinS062 жыл бұрын
No I wouldn't. There are two circuits here: the 9v circuit for the 2 servo's, and the 5v circuit for the joystick. You could of course hook the ground up to the other side of the bread board. As long as it isn't interfering with the other circuit, you'll be fine.
@乇R-u6r Жыл бұрын
Que librerías ocupa ?, es que tengo problemas con el codigo y supongo son por las librerías
@thedirty5306 жыл бұрын
Awesome Videos! Content and editing are great!
@danieldemaria3 жыл бұрын
Se pueden conectar 6 servos en paralelos 3 que se muevan en X y 3 que se muevan en Y? con este mismo procedimiento?
@Profe_Zandor Жыл бұрын
wow soy de Colombia y me gustó el canal video, tiene un curso completo de Arduino?, Thanks
@stefan77457 жыл бұрын
Hi 👋🏻, do you use a normal 2 axis arduino joystick?
@kaidnl7 жыл бұрын
Hello Mert, I want to do the same as this, only I want the stepper to make little steps as I move the joystick. and when I centre the joystick It should stay at the last location until I move the joystick again, hope you understand what I mean. Can you show us how you would change the code for that?
@turtlebrownies87016 жыл бұрын
is it ok if instead of using a custom battery unit, I use a power supply module?
@scara67093 жыл бұрын
can i connect two joysticks to the 9v and the gnd of the battery?
@lookyloo7777 жыл бұрын
I would like to know can that be made to handle a LARGE stepper motor,just on one axes(back and forth )
@wahidaaziz95887 жыл бұрын
Thank you for the video. It really help me. How about use 3 servo motor?
@agustinvercesi97647 жыл бұрын
Hi, would the code work the same with an arduino nano or change into something? Thank you
@Fitzling3 жыл бұрын
I think it would be the same, just watch out. A servo needs to be connected to PWM and in don't know if the Nano has enough
@rajeevabariar77378 жыл бұрын
great dude hey I wanted to make a simple nano quad using small DC motors(the one used in RC helicopters) but how can I vary the speed of four motors simultaneously please reply
@reeceburns56814 жыл бұрын
is there anyway to get the servos to hold their position until you want it to go more or another way?
@loganmitchell23884 жыл бұрын
best tutorial ive seen so far! how would I make the servo stop at its givin location when I let off of the joystick?
@b3dubbs722 жыл бұрын
probably set the position of the servo if the joystick returns to neutral as the last read value. I'm not sure how to you'd go about doing that but I'm sure there's a 'last' function
@notoikmo3 жыл бұрын
hey just asking if i wanted a second joystick that controlled to more servos how would i do it?
@lot10games5 жыл бұрын
Is it ok to connect to 5V of the arduino board a 9V battery? The VIN pin is more suitable for that... I think .Cool video
@83eroastery967 жыл бұрын
Deciding on Arduino or Phidgets then I found your site. My project is controlling a valve with a 10k pot. I am told the only type I can use is a speed pot. But none available at 10k only 5k. The has 0-10vdc. As you turn to the left it closes the valve and to the right opens it. It needs to be somewhat sensitive. Can this be done with Arduino Thanks Charlie
@juliennbitt33764 жыл бұрын
What is the big white board thing that you plug the wires in to called??
@magicianofelectronics9514 жыл бұрын
Bread board
@thesheikhtutor49822 жыл бұрын
Can I control 5bldc motors and 1 servo motor with this joystick??
@xiaosan121620096 жыл бұрын
谢谢,好视频,通俗易懂,看了就想自己尝试一下
@Harlequin437 жыл бұрын
Do you know where I can possibly get a generic sketch for a generiric arduino powered hexapod? So that I could control with a PS dualshock gamepad via bluetooth. I'm way too stupid to write it myself.
@chenariana34825 жыл бұрын
Where can I get the external battery VCC/GND... I mean that part which connects to the wires
@manishkarsh6836 Жыл бұрын
Please provide a grip for grabbing the object by using this 🙏🙏
@rontan84335 жыл бұрын
Um.. applying 9V to arduino and to the servo? Is that right?
@hkiceman0017 жыл бұрын
Thank you, a very helpful video for me. I watch all your video to learn arduino...thx too much
@stefan77457 жыл бұрын
Your video helped out a lot in the turret project I was doing, thank you very much!
@frobinson24136 жыл бұрын
I know I am a late starter. But I would like to use the same setup but control 2 stepper motors instead. I am a complete noob, but could I use the same code?
@Electromaniaworld7 жыл бұрын
thanks. i was looking for this to control servo for toy truck. i want to add servo to my police car shown in my recent video. any suggestions. i want to have moving wiper
@princening6794 жыл бұрын
Sir if we move forward joy forward arm should move forward even joystick come to original position code please
@Electromaniaworld7 жыл бұрын
are you using arduino IDE ? if yes, how did you make the background dark ?
@lobot47804 жыл бұрын
Hey, does it have to be an Arduino Uno, or could I use a pro micro or a nano?
@zaido87357 жыл бұрын
Breadboard un toprağını arduino nun toprağına bağlamandaki sebep nedir? Ayrıca anlatım tertemiz çok başarılı.
@CoyoteFPV7 жыл бұрын
Could you share the code to enable the joypads momentary switch to scroll through a 3rd servo channel. it 1000us 1500us and then on the third press 2000us
@user-wg6ik1wi6s4 жыл бұрын
What about a Wireless joystick for servo motor control? Can that be done with Arduino?
@magicianofelectronics9514 жыл бұрын
Yes
@francohidalgo17046 жыл бұрын
Hello, im from Argentina. How can i do if i want to use 4 servos ( and other joystick)?
@VirtualWater3 ай бұрын
Can you make a video on how to control a servo motor using a digital joystick and maybe add eye tracking?
@mangeshmahajan44457 жыл бұрын
thank you! what music is playing?
@nuradlinathirah53404 жыл бұрын
Hello..may i ask.. can i control 6 servomotor by using only one joystick?
@zackmilleryt39453 жыл бұрын
Is there a way to control a third servo with a single joystick?
@durvesularevanth17977 жыл бұрын
can u pls instruct me how to controll aesc with rc tx interfacing with arduino .....reading the signal and then delivering them to the esc.
@MrTaz65528 жыл бұрын
Great to see some new, good, arduino videos. Thanks
@romeo12455 жыл бұрын
how about 1 small servo and big servo do i need to add other components thanks?
@smibawazir47616 жыл бұрын
Can i connect sticks directly to a flight controller?
@realtrickybilly7 жыл бұрын
Thank you. I have made your project, used different materials for the arms though. Awesome robot arm.
@mushahidhassan34375 жыл бұрын
Can u guide me ? And how can i contact you ?
@deepakgoyal45536 жыл бұрын
hello Mert Arduino and Tech.I am making a hand controlled accelerator in which i am using a potentiometer which will sense the movement and give the input to arduino. Thereafter Arduino will scale the input rotate the servo motor which will press the accelerator pedal. Canyou tell me which type of potentiometer should i use and how to code it
@charantadisetti86784 жыл бұрын
do we need the adapter?
@poyraz.arc.7 жыл бұрын
mert, 4 servo ve iki jeostik ile yapılan robot kolun kodlarını paylaşabilir misin?
@JesseGunnRocksnyc6 жыл бұрын
Nice! I think this is what I was looking for! But is there a way to add ease in and ease out? In other words smoothing when starting and stopping. So it is not abrupt.
@JesseGunnRocksnyc6 жыл бұрын
Also I noticed that I have 6 wires 3 black red and white on top and 3 on the side. Do they share the red wire?
@acifans40164 жыл бұрын
Can you show how to put 13 servo motor on the arduino and breadboard.
@四喜丸子-c7q7 жыл бұрын
hello ! I like your video very much. It is clear and funny. What' s more, the music and the background are very well. However, I have a question: How can I use arduino with mini-joystick to control serve motor wirelessly ? I don't know if you have time to reply me, but I look forwarding to hearing from you.
@musabmahmood11967 жыл бұрын
sir if i want to connect servos on one aurdino and connect to NRF24L01 module and joystick on other aurdino with another NRF24L01 wireless module................then something change in code will occur or not?? can i put servos code to one ardino and analog joystick code on other ardiuno then it would be correct or not ?? if not then plz help me
@omicron296 Жыл бұрын
Parabéns pelo vídeo e por compartilhar o seu conhecimento! 🙂
@varcelymif63346 жыл бұрын
Hi,how can I do to use switch (bouton ) of joystick?
@grahamtech7 жыл бұрын
hi im building a robotic hand , and i wanted to know if thers any way you could tell me how to control 5 servos with analog joysticks or one joystick to control all five
@mohamedosama93126 жыл бұрын
my servos were good and the projectwas very good. and it worked well. i unpluged the arduino. and after 30 minutes i pluged it again the 2 servos become crazy.
@veronicastanley-hooper98615 жыл бұрын
Bad servo motor or tired battery. Mine did this on start up and I swapped out the motor and it worked fine. Later the set-up didn't work. I swapped out the battery and it worked beautifully.
@jus4uvacationrental4627 жыл бұрын
Hello i have got a 3dr iris+ and i have just bought a pan/tilt mount with sg90 servo is it possible that you would know how to connect it to i believe it is call a pixhawk v2.4.5 Thank you don
@embhahlangpakyntein42237 жыл бұрын
so i'd like to know how would i change the code if i dont want the motor to return to its initial position if i let go of the stick
@albertodeleon11696 жыл бұрын
I only have a snap connector that connects through the arduino's voltage input. Is there a way to make this circuit using that (without breaking my snap connector)?
@veronicastanley-hooper98615 жыл бұрын
Yes. I just did this. You need to connect your breadboard + to the 5v on the Arduino and the GRD on the Arduino to the - on the breadboard. Then plug in the 9v with your snap connector on the arduino.
@tman160HTM5 жыл бұрын
can you provide a wiring diagram, please?
@damiengarcia21263 жыл бұрын
how can i double it for 4 servos with 2 joysticks. cant get it to work
@connordavine5377 жыл бұрын
are you able to make this without the battery??
@samopal117 жыл бұрын
GOOD video!.. can you make it with nfr24l01 please??...
@kung-fupanda-vu5ns7 жыл бұрын
thank you for the video.. at last I got the exact video which I wanted
@CarsonScholz7 жыл бұрын
why is the joystick value between 0-1023?
@lucamazzariol595 жыл бұрын
I might bee long but isn't 9v too much for the servos? please someone tell me if I'm right or wrong
@mohamedelbachirbelalmi37517 жыл бұрын
how muh value of the battery that you used
@romeo12455 жыл бұрын
is it possible to use other servo like 1 small ad 1 big servo in this code ?
@jexter65785 жыл бұрын
Yup . Servos are powered from external supply , only signal is coming from uno , u can use any other ..
@XxSL77xSnIpErxX6 жыл бұрын
What would the code look like if no libraries were used...?
@Melon-eu1sr7 жыл бұрын
How can I power the bread board from my uno? (Use newbie terms, I only got it yesterday)
@LionelTellem7 жыл бұрын
on the breadboard you will see on the different horizontal long lines, a blue(negative) and a red(positive) long line.SO you take from any GND pin of your UNO board to thet Blue line and the *5V pin --****> Red line* ..from there all the remaining holes on a horizontal bar having blue(is GND) while the red one(Vcc)..Hope it helps and please visit and *SUBSCRIBE* to my channel please