Xbox 360 Wireless + Arduino

Published

Introduction: Xbox 360 Wireless + Arduino

About: Transformational Speaker - Writer - Philosopher - Futurist - Inventor - Philosophy Portfolio : http://www.strainbalanced.com/ Robotic Portfolio : http://www.surgerobotics.com

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 ]

Share

    Recommendations

    • Planter Challenge

      Planter Challenge
    • Woodworking Contest

      Woodworking Contest
    • Oil Contest

      Oil Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    48 Comments

    Hi, I don't know if this problem has been resolved yet, but my receiver will not show a solid green light when connected to the USB host, but it does when connected to the computer. I can press the sync button on the receiver and then the light will blink for a little bit, but then it will turn off. I do not know if this is a hardware, software, or battery power issue. Please let me know if anybody has resolved this issue. (And yes, I tried changing the USB port and it did not work). I'm using Arduino uno.

    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.

    1 reply

    I'm Having the same problem. Using SainSmart USB Host-Shield, arduino uno, xbox wireless adapter for windows, and xbox one controller. I have tried connecting to pc, the dc jack, and the Vin pin but I cannot get the adapter to power up on the shield. The adapter works fine when connected to the pc and syncs with the controller easily, so no problem with the adapter. Any suggestions??

    I'm using the ATmega 2560.
    so far, I've got the controller to communicate with it.
    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

    3 replies

    to hook up some DC motors you will need to buy a DC motor Board. You can get one for a 2WD or 4WD car. Also you should get an extra battery pack so that there is extra power for the motors.

    What code did you use to connect/communicate the Xbox controller with the USB dongle?

    1 - If you haven't already, I'd suggest getting the arduino with those chips ,not just smd stand alone

    2 - email me at sergeidines@gmail.com and I can help with the motors

    Would i be able to use stepper motors instead?

    @Sergei Dines 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.

    3 replies

    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.

    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.

    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.

    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]

    In the XBOXRECV and XBOXONE, it says Xbox.getButtonClick(... ) and that's for the ONE and 360 controller

    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)

    Hope that helps somewhat - and that's a good idea for the throttle - keep up the good work

    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.

    1 reply

    email me at sergeidines@gmail.com and I can help with the motors

    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.

    1 reply

    And yet you speak good English :)

    Hey i am using my Arduino Yún to work with a wireless xbox controller. Im not sure if it will work cause of the bridge. Do you have any advice ?

    2 replies

    Only Advice I can give is try it out and don't be afraid to have stuff fry

    I uploaded the XBOXREC scetcch and the serial monitor gives me :

    Xbox Wireless Receiver Library Started

    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

    suggegtions how to solve this ?

    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?