loading

Purpose :

Quick setup to get your robotic projects

wirelessly controlled with an Xbox 360 Controller

*Update ( 11 / 24 / 2015) :

If using the pc and having trouble ( especially with adapter not being recognized or having a green solid light) try the following:

http://www.microsoft.com/hardware/en-us/d/xbox-360...


Author :

Sergei Dines

Writer - Inventor - Philosopher

Website http://www.surgerobotics.com/

MECH Database : http://www.surgerobotics.com/surgerobotics-databas...

Includes : Servo CAD Files, Arduino Codes, Robot Project Ideas , and whatever you'd like to add

Step 1: PARTS

  • Xbox 360 Controller : Here

Note : has to be Microsoft - Do not cut corners else I cannot promise it will work with other controllers / receivers

  • Xbox 360 PC Adapter : Here : Also , THIS ONE is confirmed :
  • Arduino Uno : Here Should Come with PC Cable
  • Usb Host Shield : Here

Total : About $98

But : Once you purchase this setup, you can control servos, motors, and any robotic project wirelessly

Step 2: WIRING : Connections

  1. Connect USB Host Shield to Arduino Uno
  2. Connect Xbox 360 Wireless Reciever to USB Host Shield
  3. Plug Arduino UNO Into PC

Step 3: COMPUTER : Software + Libraries

  1. Download Arduino IDE : Here
  2. Download USB Host Shield Library : Here : Scroll Down a little and Click " Download Zip" Right- Hand - Side
  3. Import Library by following the steps on Arduino Website : Here
  4. Close out Arduino IDE and Open it Again

Or Follow These Steps to Import the Library :

  • Open Arduino IDE
  • Sketch --> Include Library --> Add .zip Library ...
  • Add Zip File from Step 2 Above

Step 4: Confirmation

To Confirm :

  1. Open Arduino IDE
  2. Go to File [ Upper Left Hand Corner ]
  3. Examples
  4. Scroll Down to : " USB_Host_Shield_2.0-master" Or whatever you called the .zip library
  5. Hover Over " USB_Host..."
  6. Select Xbox --- >XboxRECV
  7. Upload Sketch to Arduino
  8. Open Serial Monitor [ Upper Right Hand Corner of Arduino IDE ]
  9. Should see the name of the button stressed followed by a number

Arduino Interface image from : http://diamondage.co.nz/help/quick-start/configura...

Step 5: CODE : Controlling Robotic Arms & Rovers & Stuff

  • NEWEST CODE : http://www.surgerobotics.com/coding.html#c++
  • OR Below -- > servo_xbox360_simple = my own code ( very simple and easy to follow )
  • Any questions / contracted work email : sergeidines@gmail.com

See Codes Belowfor older version of code and another to control motors with speed control

See :

https://www.instructables.com/id/AXIOM-ARM

  • -For Controlling a robotic arm with the Xbox 360 controller [ 6 Servo control CODE INCLUDED ]

Note * Motor Control Sketch May Need Editing + Confirmation but should work

Step 6: Conclusion

I'd like to thank Barrett Anderies for helping me with this setup

He has a similar setup, but with a PS3 Controller : see Here

Step 7: Troubleshooting

  • Receiver Light Not On When Plugged Into USB Port ----- > Switch USB Port
  • USB Host Shield Library Not Recognized / named correctly ---- > Get rid of periods, special characters, spaces, or numbers - don't start name with number.
  • Weird characters are showing up in the serial monitor --- > Match " Baud rate" within code with serial monitor baud rate
  • Weird characters are still showing --- > Make Sure XboxRECV Selected [ as mentioned in comments by CarsonH2 ]
  • Sync or Avrdude error --- > Select Correct Board [ Arduino Uno] , Port, and Programmer [ ArduinoISP ]
<p>my receiver won't show a solid green light when I connect it to the usb host shield and the Microsoft help page is no longer availiable. What can I do? I'm using the SainSmart USB Host-Shield with an Elegoo UNO R3 and the original Microsoft Reveiver. </p>
<p>Would i be able to use stepper motors instead? </p>
<p>I'm using the ATmega 2560.<br>so far, I've got the controller to communicate with it. <br>now all I need to do is have it control a few DC motors, though the code isn't working right and I can't find anything on how to wire DC motors up to the arduino(fairly new to this) any help would be most appreciated </p>
<p>What code did you use to connect/communicate the Xbox controller with the USB dongle?</p>
<p>1 - If you haven't already, I'd suggest getting the arduino with those chips ,not just smd stand alone</p><p>2 - email me at sergeidines@gmail.com and I can help with the motors</p>
<p>@<a href="https://www.instructables.com/member/Sergei%20Dines" rel="nofollow">Sergei Dines</a> I just want to know one thing is the Left and Right Trigger buttons i.e. LT and RT on the XBOX ONE or the XBOX 360 Controllers Analogous(0-255) or they just digital switches(0-1) because I love these controllers and I want one of these to fly my quadcopter and since the analog sticks both are center spring stick. I cannot use either of them for Throttle for my quad copter so I thought if the triggers were analogous I might be able to use the triggers for throttle.</p>
<p>I haven't gotten the Xbox One controller to work with this library, but I've used the 360. The triggers (LT/RT) are analog, 0-255. Of course, these have springs as well. But the bumpers (LB/RB) are digital.</p>
<p>If you or someone mails me the parts, I will gladly attempt + post a video + code</p><p>Xbox one controller + Adapter : <a href="http://amzn.to/2iPnoSZ" rel="nofollow">http://amzn.to/2iPnoSZ</a></p><p>Arduino uno : <a href="http://amzn.to/2k2e0Zp" rel="nofollow">http://amzn.to/2k2e0Zp</a></p><p>USB Host shield : <a href="http://amzn.to/2iZcWnf" rel="nofollow">http://amzn.to/2iZcWnf</a></p><p>Email : sergeidines@gmail.com</p><p>I'll return the parts , and code , and have it working for servos and lights</p><p>I can get it to work with motors, but that may cost yah hah</p><p>Let me know - offer stands for anyone</p>
<p>Very late, I know. But if you wanted to come back to this idea, I am pretty certain they are variable like you were thinking. In racing games, you can pull it partially to increase speed, its not like an all or nothing, its gradual. (Why controllers for racing and vehicle games are better) I don't know about xbox one, just 360. But not sure why they would downgrade.<br><br>Now shooting games don't need the variable, so their program just tells the gun to shoot after its half way or greater if you will.</p>
<p>I haven't used the 360 controller in a while but I believe it may be digital [ it has a spring in it that makes it feel like analogue] </p><p>In the XBOXRECV and XBOXONE, it says Xbox.getButtonClick(... ) and that's for the ONE and 360 controller</p><p>For the future , a good way to test would be to take the output of the function and serial print it to the monitor. For example : let x = int; ( before the void setup where you define variables) and then in the main loop x = Xbox.get .... then Serial.print(x)</p><p>Hope that helps somewhat - and that's a good idea for the throttle - keep up the good work</p>
<p>Hi, I'm hoping you could clear some issues I've been having trying to control a DC motors speed. For some reason when I run the code only the void setup runs. In the serial monitor the xbox controller is connected and feeding information but doesn't affect the speed. I'm relatively new at this so anything that might help as far as code and wiring world really help. I've spoken to my professor about it and she says that there is something wrong with the if (Xbox.XboxReceiverConnected) line she told me that the class this line is calling for is not defined in the library. Anything will help thank you.</p>
<p>email me at sergeidines@gmail.com and I can help with the motors</p>
<p>I would like to buy it, but only if you have an translation to portuguese. Because I do not speak english and I understand just some words.</p>
<p>And yet you speak good English :)</p>
<p>Hey i am using my Arduino Y&uacute;n to work with a wireless xbox controller. Im not sure if it will work cause of the bridge. Do you have any advice ?</p>
<p>Only Advice I can give is try it out and don't be afraid to have stuff fry</p>
<p>I uploaded the XBOXREC scetcch and the serial monitor gives me :</p><p>Xbox Wireless Receiver Library Started</p><p>The Receiver has either a green solid or the light is blinking. The serial monitor does not give any response by using the controller. I cannot even say if the controller is connected</p><p>suggegtions how to solve this ?</p>
<p>I'm sure I'm missing something blatantly obvious, but what are the pin outs for the servo? Or, how do I connect the servo to the USB Host pinouts? </p>
<p>This isn't a tutorial on servos , or controlling them with this set up [ although you can ]</p><p>This is : <a href="https://www.instructables.com/id/AXIOM-ARM/" rel="nofollow">https://www.instructables.com/id/AXIOM-ARM/</a></p><p>And very simple google searches will go far, both now and especially in the future</p>
<p>Works like a charm! Thank's a lot. Will try to build a remote controlled pan/tilt head now. :-)</p>
Dude that's awesome<br>No problem at all<br><br>I tried to make this as straight forward as possible for others to avoid some problems I had<br><br>Which receiver did you end up using?<br>Sounds pretty rad<br><br>Best of luck
<p>I got the original Microsoft one a long time ago when I started playing FIFA at the PC. ;-)</p><p>Have two original XBox 360 controller lying around as well.</p>
<p>That's good to hear</p><p>That's how I got into this and it working as well [ gaming on the pc]</p>
<p>I am trying to control a power wheels car with a arduino and a xbox 360 controller. Any thoughts?</p>
<p><a href="https://www.instructables.com/id/BARC-Jeep-An-XBOX-Controlled-Power-Wheels/">https://www.instructables.com/id/BARC-Jeep-An-XBOX-...</a></p><p>Try it out</p>
<p>hello, I can control servo with my control xbox one and raspberry pi?</p>
<p>I am working on a project where I can control an RC car using an Xbox one controller. So far I have purchased: an Arduino uno (smd), Sainsmart usb host shield, Sainsmart motor shield (To allow the uno the be able to power the servo motors), Xbox one controller, Xbox one wireless PC adapter, Arduino PC cable (came with uno), Arduino 9v external battery pack (came with uno), and RC car I am willing to take apart. This is what I have set up: usb host shield is attached on top of the uno, motor shield is attached on top of the usb host shield, Xbox one wireless PC adapter is plugged into the usb host shield, Arduino uno is connected to the PC, 9v external power supply is connected to uno, and the controller is ready to connect to the wireless PC adapter. The problem is that the Xbox wireless PC adapter does not seem to be receiving power. When the adapter is plugged directly into the computer, is works how it should, but when it is plugged into the host shield, it doesn't show any indication that it is even receiving power. I don't know if the code has anything to do with this but I need help. Thanks in advance! </p>
<p>My arduino does not seem to be applying enough power to the pc wireless adapter. help</p>
<p>Does this work with an Xbox one controller and Xbox one PC adapter? Please answer asap. thanks!</p>
New Library Should - https://github.com/felis/USB_Host_Shield_2.0
<p>Hi,</p><p>I am trying to turn on the receiver Light and troubleshoot it. In the troubleshooting section you mentioned, &quot;Receiver Light Not On When Plugged Into USB Port ----- &gt; Switch USB Port&quot;. But here is only one usb port on the shield. which one you want me to switch to. </p><p>ps: does it have something to do with vbus bin?</p>
<p>Switch USB port on Computer</p><p>If light still not on - </p><p>Unplug from usb host shield</p><p>Plug Xbox Receiver into computer</p><p>Computer should download the driver , verifying that you have a good receiver / controller.</p><p>Download xbox driver for windows here if device not recognized <a href="https://www.microsoft.com/hardware/en-us/d/xbox-360-controller-for-windows">https://www.microsoft.com/hardware/en-us/d/xbox-36...</a></p><p>if device cannot be found on computer, then you have a bad receiver or controller or either may not authentic Microsoft brand.</p><p>No idea about the vbus</p>
<p>thanks for the quick response. i can pair both the receiver and controller with my computer now while i am still unable to get the receiver powered on Arduino. it seems that the shield just doesn't deliver power to the receiver. Because when i tested several other pins on the shield, they worked properly. </p>
<p>Try powering the Arduino[ with the shield on top] through V_in - your usb may not be able to deliver the current needed [ I do remember having that issue sometimes ]</p><p>----&gt;Read up on V_in before doing so though : </p><p>And no problem</p>
<p>sorry, but could you please be more specific? i just wired the 5v pin from my mega and the v_in pin on the usb shield. The next thing i saw was the smoke from the Arduino's processor. </p>
<p>Not really sure why you did that - did you not like your board?</p><p>We all burn a few</p>
<p>Hi, </p><p>I am trying a similar project but with a non-wireless xbox 360 controller. I have everything wired up, I placed the libraries in the correct places, but when I plug the controller into the usb port on the arduino it fails to recognize the controller. The code spits out &quot;--&ucirc;&quot; to the serial port. I've tried downloading the driver for the controller on the computer (not sure if that was necessary, but I read it somewhere). Any tips would be much appreciated.</p>
<p>Are you using the XBOXUSB sketch rather than the XBOXRECV?</p>
<p>That's good advice</p><p>Also,</p><p>Make sure the baud rate on the bottom of the serial monitor matches that of the code</p>
Sorry, what do you mean with <br>5.Xbox<br>6. XboxRECV<br>?<br>Is it code you should write or what?
<p>Xbox is the main folder name : </p><p>file --&gt; USB_Host_Shield_2.0-master ( or whatever you named it) -- &gt; then Xbox ( which is a main folder) --&gt; then XBOXRECV</p><p>This gets you the functions and serial prints the values after you download the program to the arduino (with the xbox receiver hooked into the usb shield and usb shield on top of the arduino)</p><p>Hope that clears it up</p>
<p>Good work and good description .</p>
<p>Hey Thank You</p><p>Much Appreciation</p>
<p>Very cool!</p>
<p>Thank you Seamster - tried to make it as straightforward as possible</p>

About This Instructable

58,891views

99favorites

License:

Bio: Transformational Speaker - Writer - Philosopher - Futurist - Inventor - Philosophy Portfolio : http://www.strainbalanced.com/ Robotic Portfolio : http://www.surgerobotics.com
More by Sergei Dines:How to get started with robotics How to create an engineering / maker / technical portfolio Real Pipboy / IronMan : Wearable Heater + Runner Utility Light 
Add instructable to: