Step 3: Connecting the thumbstick (joystick)

The follwing connection will confuse you a little, just follow the picture.
Again using a bread board will make things easier.

1. The thumbstick has one U/R+ and one L/R+ this two connections will provide power to the joystick. Connect them to the Arduino 5V connection.
2.  Also the joystick has two L/R connections and two U/D connections it is important that you connect both of them to the respective arduino pin.
3.  Do the same to both GND connections on the joystick.

Thumbstick                     Arduino

L/R+  ----------------------     5V
U/D+ ----------------------     5V
GND  GND ---------------    GND
U/D U/D ------------------     Analog 4
L/R L/R -------------------    Analog 3

NOTE: Always double check the connections!!!
<p>Hi, i love this project!! I wonder how <br>to let the camera reach the initial position (for example x=90 Y=90) when the <br>joystick button is pushed.</p><p>Thank you for your help</p>
<p>Hi, thanks a lot for this wonderful tutorial.</p><p>I am new to arduino and this being my first project, I am basically making a Rotary head for my Camera.</p><p>What I wanted was it to hold the position when I leave the Joystick. </p><p>Any suggestions?</p><p>Thanks </p>
<p>Look up while loop.</p><p>int pos = 0; </p><p>while(joy &gt; 0){ </p><p>pos++;</p><p>if(pos &gt; 180){</p><p>pos = 180;</p><p>}</p><p>servo.write(pos);</p><p>}</p><p>obiously this code wont work on its own but if you manage to fit this code into the one given my the autor it will sum 1 to the servo variable.</p>
<p>Hello,</p><p>Thanks for creating this instructable. I was just wondering, is it possible to power these 2 servos with my arduino, won't the burn overheat, get damaged or any other thing like that, especially when I am using a joystick as well :l Otherwise, great instructable.</p><p>Samuel</p>
<p>The Key on making this and other tutorials from INSTRUCTURABLES is that if it does not work, the start over again....all of us when doing an instructurable like this one wealso make mistakes so we start over and over again,,,just don't give up and HAVE FUN!!! (Bi()ME(H75</p>
<p>Hi there !</p><p>I'm doing my project which involves 1 Arduino DC Motor and 1 2-Axis Joystick REV B 27800 .</p><p>Struggling to put the pieces together so that the joystick is able to control the D Motor to move front and back according to the direction of the joystick i move to. With the use of the arduino board as well.</p><p>Please Help ! :(</p>
<p>Hi there!<br><br>I'm trying this tutoril for my project, </p><p>I'm using two servo: HS311 and HS422, A joystick (Keyes_SJoys), of course an Arduino, and I'm using a battery of 5v for the joystick.</p><p>I think i have the conections all right, but when I upload the program on the arduino, the servos start vribating, and don't respond to the joystick, i kept checking the conections on the joystick and it's all right, </p><p>What could else be?</p><p>Please help! D:</p>
<p>Well after whining like a baby to arduino on facebook and being upset with the lack of results from these instructions i deconstructed and reconstructed and finally got it. THANKS!!!!</p>
<p>Looks great! Can you add a gyroscope to horizontal axis to keep it level? Or even override the horizontal axis with a joystick if you wanted to?</p>
<p>Hello, I'm still very new to Arduino as well. I got everything hooked up and noticed an issue in the code. The left/right worked as planned, but the up/down did not respond. After going over the wiring, I looked at the code. I found that you have pwm pin 4 for the up/down, it is set to pin 3 in the code. Once I made the adjustment with the wiring, it worked great. Thank you for taking the time to make this Instructable. I found it very easy to follow, pictures helped a lot, and was fun. </p>
<p>i used 2 100k pots insted of a joystick and a pro mini 3v insted of a arduino uno but for some reson the servos arent moveing they only make the servo sound, so i thought maby it was becuse there not getting enouf power so i attached all the + wires to RAW and used 9 volts but it still only makes the sound if u have any idea what could fix this i'd realy like the help</p>
<p>hi the joystick that i found is different ,...</p><p>could you tell me,if will it be compatable with your project??</p><p>tanx,...</p>
<p>Yes, I will refer to his diagram.</p><p>Vcc is +5 (Red). Gnd is 0V (Black). Xout is L/R(yellow). Yout is U/D (blue)</p>
How to control the speed of brushless motor(esc) With The thumbstick
<p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/y52lG8M6kBY" width="500"></iframe></p><p>With laser added for effect. Everything was hot glued and shot under poor lighting, but it's still worth watching once. </p><p>The sound playing has one section of adult language!!!</p>
<p>Great Tutorial! What if I wanted to run two servos with two controllers? I am attempting to use modified continuous servos to drive wheels. With a tank steering, all I need is a u/d (or fwd/bwd motion. Any suggestions on how to code this?</p>
<p>i hooked it up to my sumo bot</p>
<p>For the bluetooth use XBEE shield for Arduino</p>
<p>Hi Biomech75 very nice Job. </p><p>I ask me if you got some troubles with delivering power to the servos I used a micro servo SG90 and it seems to not work that good as suppouse. </p><p>I know about a external source but when I attach the servo goes directly to one side and no moves. </p><p>Thanks for answering and create this tutorial.</p>
<p>arduino does not have enough current to power 2 servos and a joystick, especially not 2 of each. need a alternae power supply for either the joystick(s) or servos</p>
<p>That's the point a lot of tutorial teach to attach the servos at the arduino when this is not recomended by a lot xperts. </p>
<p>Thanks very much Biomech75! My first project on Arduino!</p><p>Just one question, I'm using a different joystick and there is one pin called &quot;SW&quot;</p><p>I didn't connect it but everything works great. Do you know the function for this pin? </p><p>I will try 4 servos now :)</p><p>Cheers!!!</p>
<p>The SW pin is used for a push button build in in the joystick, if you press on the joystick it wil activate the button.</p><p>Here i have a link to a website that maybay complain some thing about the SW pin and how to use it.</p><p><a href="http://www.learningaboutelectronics.com/Articles/Arduino-2-axis-thumb-joystick.php" rel="nofollow">http://www.learningaboutelectronics.com/Articles/Arduino-2-axis-thumb-joystick.php</a></p>
<p>(sorry for my bad english, I am dutch)</p><p>A very usefull tutorial!! I am using it to control my electric BBgun (still a prototype)</p><p>I have one question: how can i control the (vuur meganisme) firemeganisem with a butten. It's a motor that needs to run on 9-12 Volts. </p><p>The joystick I am using has a small pussbutton build in it.</p>
<p>i almost forgot </p><p>I have also a Ka03 Motorshield. maybay usefull for the motor? i can have a max ammount of 50 external volt's.</p>
<p>Nice notes!!</p><p>And I have two questions</p><p>First, how can I move the joystick a little bit and back, then the servo move and stop right there not back to original place?</p><p>Second, how can I use bluetooth to connect two arduino boards? One is for sending signal and the other one for receiving the signal.</p>
<p>i hooked it up to my mini sumo bot and it still worked</p>
<p>Great tutorial,how could i sent joystick data via Bluetooth any help with a basic code example would be very much appreciated. </p>
<p>am looking for the same thing ... if u find the code can u send it 4 me </p>
<p>nice ... can u give me the code if i used the two servp motors one of them 360 deg and the other 180 deg ... and if i used arduino esplora instead of joystick how is that done ? plz help i need this in my project</p>
<p>Does anyone have any idea how to do this using a Raspberry Pi instead of Arduino?</p>
is there any way to make the servos stay in one position instead of going back to their zero position? <br>
<p>yes just change the value position on the code</p><p>myservo2.write(servoVal); // sets the servo position according to the scaled value <br><br> // Read the horizontal joystick value (value between 0 and 1023)<br> servoVal = analogRead(joyV); <br> servoVal = map(servoVal, 0, 1023, 70, 180); // scale it to use it with the servo (result between 70 and 180)</p>
You can try this : Change the value of the bold number from 0 to your desire position. I hope this works If not let me know ;)<br> <br> // Display Joystick values using the serial monitor outputJoystick(); // Read the horizontal joystick value (value between 0 and 1023) servoVal = analogRead(joyH); servoVal = map(servoVal, <strong>0</strong>, 1023, <strong>0</strong>, 180); // scale it to use it with the servo (result between 0 and 180) myservo2.write(servoVal); // sets the servo position according to the scaled value // Read the horizontal joystick value (value between 0 and 1023) servoVal = analogRead(joyV); servoVal = map(servoVal, <strong>0</strong>, 1023, 70, 180); // scale it to use it with the servo (result between 70 and 180)
buy or mod the servo to a 360 degrees servo. I have a tutorial on how to mod radioshack servos Hope this help
<p>I've even given it a Freakin' Laser!</p>
<p>WAOOOOO niceeeeeeeee!!!! JornG</p>
<p>@alumpkins, you need more power for either the Arduino or the servos. I had the same problem.</p>
<p>when I upload and move the joystick it resets my board</p>
<p>how do I get it to hold postion</p>
<p>I tried your project and very effective.</p><p>that I can do to convert 2 PWM inputs (rc servo) to 5Vdc analog output?</p>
Thanks biomech75! I recently attempted this with great success. Note: To make this portable, wire 3 9v batteries to the servos instead of connecting them to the Arduino, and use 4 AA batteries to power the board. Overall a wonderful design and easy build. Thanks again!
how would you so this if you wanted to use continual rotation servos? <br>Would you need to change the wiring as well as the code?
I have to apologize in the code it should said 4 instead of 3... But I know that all of you fix this already on your codes Thank you for the corrections ;) #include const int servo1 = 4; // first servo const int servo2 = 10; // second servo const int joyH = 3; // L/R Parallax Thumbstick const int joyV = 4; // U/D Parallax Thumbstick
Thanks fot Tutorial and Software. Its works:) <br> <br><iframe frameborder="0" height="315" src="//www.youtube.com/embed/_EIeOfgw5Qw" width="420"></iframe>
Not a problem keep up the good work.. And remember use your Imagination with this project (4servos???) Try it ;)
Hello Biomech75 - Loving this project!!!!! Tony here and well I am so brand new to Arduino, that I am still in diapers...I get the gist of what its all about, and your Arduino + 2 Servos + Thumbstick is just what I am looking for. With that said I have made all the connections as you stated and I can get the R-L movement down, but the U + D are not working. I constructed, deconstructed, reconstructed several times, but still only obtaining a R-L. Now I did notice in STEP 2 regarding the grounding wire for the Up &amp; Down servo; that is connected to the same &quot;-&quot; spot as STEP 3 which shows the thumbstick ground. Thinking that may have been my issue, I tied the U&amp;D ground to the ground of the thumbstick - still only getting the R &amp; L. <br>Am I doing something wrong? Using the Aruino UNO, running the 1.0.4 version. Oh also note that my t/stick has been temp connected with small female connectors stripped the opposite end, twist and tie to the wires that are put into the breadboard. This is because I will need when I get it running will need to have some space between the board and the switches once I get the project up and running. Also is there a way not allow the servo to go back to position 0 once the stick is released? I know I just dumped a lot, but I hope you can assist. I am a quick learner, :) <br>Tony.
for the arduino software I am using the old 0023 version. It seems to be more stable and I will not trade it with a newer one just yet. I have not had a problem with my arduino with this version. Also the thumbstick I am using Its old. But it will work. I got Issues with it (joystick) but be patient It will work. Now for step 2 yes I have use the same ground for everything. And the connection for UP//Down Double check because I got the same problem when doing this project I hope this help If not let me know again TONY ;)
Hello Biomech75, <br>Thanks for the project, I am somewhat confused by the pictures that show the wiring of the thumbstick, then I see the thumbstick in the breadboard, and i can not get my head around how these two pictures make sense, i am very new to all of this, and so I wonder if there is a way for you to help me get past this &quot;dummie&quot; stage, when trying to copy what you are showing. <br>Thanks <br>Chris <br>

About This Instructable


259 favorites


Bio: Evo 8, Honda K, B Engines Mods
More by biomech75: Arduino thumbstick controller Arduino+Servo+Potentiometer Arduino Robotic Arm
Add instructable to: