Arduino Robotic Arm Controlled By Xbox 360 Wireless Controller

This is a guest contribution by Sergei Dines
It is often said that robots may rule the world one day. And with the convenience and ease of making robots today within our private homes, we may not be too far away. In essence, each robotic project adds a new insight into the world of mechatronics. As such, the following article presents a simple way to control a robotic arm with an XBOX 360 wireless controller. This project was inspired by Barrett Anderies’ RC car controlled by a PS3 controller.

Requirements

To build this project you will need:

  • Arduino Uno ($23.25)
  • USB host shield for Arduino Uno ($15.99)
  • XBOX 360 controller ($16.00)
  • XBOX 360 Wireless adapter ($17.49)

If you do not have a robotic arm already:

SOFTWARE:

  • Autodesk Inventor 2014
  • Arduino IDE
  • USB Host Shield Library
  • Final Code uses XBOXRECV

Optional software: Fritzing: circuit drawing software

MECHANICAL:

  • Breadboard [400 pt]
  • Standard Servo

ELECTRICAL:

  • Jumper wires
  • Power source : 3000 mAh or higher, 7Volts or higher : preferably a NiMH Venom battery as shown in the photos
  • Jumper Wires
  • Electrical Tape

STEP 1 :Important parts to buy first

Xbox controller with adapter, Arduino UNO (with cable), USB host shield for Arduino UNO, a servo and wires are the core parts you should order right away. The reasoning; you want to make sure your Xbox controller, adapter, USB host shield, and Arduino all talk to each other nicely.

Important parts to buy first

Important parts to buy first

STEP 2 : Putting everything together

Buy the core material. The arrival date for some of these parts can vary; there is a joke in the engineering design community in which you buy what you need first and then you design later.

1. Connect Arduino USB host shield to Arduino UNO

Connect Arduino USB host shield to Arduino UNO

Connect Arduino USB host shield to Arduino UNO

2. Xbox 360 adapter to USB jack on the shield

Xbox 360 adapter to USB jack on the shield

Xbox 360 adapter to USB jack on the shield

Warning: Make sure to not force the pins down, gently wiggle USB host shield until pins are completely covered
NOTE: make sure it’s a Microsoft adapter

3. Yellow/ White wire of servo to digital pin 2
NOTE: The pins on the shield are the same as the Arduino pins that are directly below

4. Black/ Brown wire of servo to GND

5. Red / Orange wire of servo to 5V

6. GND from Arduino to GND rail

7. V_in from Arduino to Red rail

Your wiring should look like this:

Your wiring should look like this

Your wiring should look like this

8. Connect Out + [ of Regulator] to Red Rail

9. Connect Out – [of Regulator] to GND rail

Connect Out

Connect Out

10. Strip the other end of alligator clip (that came with battery charger) like so:

Strip the other end of alligator clip

Strip the other end of alligator clip

WARNING: make sure the wires cannot touch when in the terminal as shown (I used electrical tape).

VERY IMPORTANT:
The Regulator steps down the voltage so that the Arduino board and servos can work.The “Out” side of the regulator should read 4.8 – 6 Volts (depending on your servo). I have mine set at 5.5 V and it works well. – Do not just connect the regulator without turning the golden potentiometer (gold circle with arrow above it) to this voltage.

Do not just connect the regulator without turning the golden potentiometer

Do not just connect the regulator without turning the golden potentiometer

a. Connect red alligator clip to battery
b. Connect other end to In +
c. Connect black alligator clip to black battery
d. Connect other end to In –

Connect the alligators

Connect the alligators

If you wired everything right you should see the following:

If you wired everything right you should see the following

If you wired everything right you should see the following

STEP 3: Code

In order for your Xbox controller and adapter to talk to the USB shield and the Arduino, you will need to download the USB host shield library found here: https://github.com/felis/USB_Host_Shield_2.0 simply click “download zip” on right hand side.
NOTE : you can probably find other websites with the similar examples, just make sure you get the XBOXRECV, as this is the Xbox 360 wireless library needed.

Don’t know how to place new libraries in the Arduino IDE? Go here: Libraries
I have included many versions of the code as well as the final code. Barrett Anderies helped develop a PS3 code that has much smoother controls than that previous attempts. The previous attempts are to illustrate other possible routes to accomplish the same task; it’s a good idea to look over the commenting and approaches to broaden your perspective.

Six servo controller(Xbox360 Wireless)

Incremental control of Servo(s) Using Xbox 360 Controller

The code, by default, will output:
NOTE: you must press A to start the robot by the default code

Start-Stop Functions
AStarts Robot
BSafety Stop
ButtonDigital Pin
LT, RT2
Right Hat Y3
Left Hat Y4
Left Hat Y5
Left Hat X6
Right Hat X7
Controls Capture Final

Controls Capture Final

Controls Table

Controls Table

STEP 4 [Optional]: Build Complete AXIOM ARM or your own robotic arm

If you want to design a robotic arm from start to finish, then the following mechanical parts may be mechanical parts useful: download mechanical parts

1. Download Autodesk Inventor 2014

  • Go to: Autodesk to create a free profile
  • NOTE: When prompted, the material content library is useful but not necessary

2. Download AXIOM ARM Inventor Parts
3. The claws are ready to be 3D printed as is

However: the servo brackets may need adjustments. Amazon has a great servo bracket kit for $90, if you do not plan on designing and modifying the brackets parts;

Parts:

  • Polycase
  • Toggle Switch w/ Blue Light
  • 3D printed Parts
    • Buy SainSmart 17DOF Biped Black Educational Robot Kit
    • Or : 3D print parts (parts available below)
  • Rubber bands

Everything stays the same, the only difference is your circuit will look something like this:

Circuit MAKE

Circuit MAKE

Axiom Arm

Axiom Arm

The Arduino robotic arm controlled by Xbox 360 Wireless controller

The Arduino robotic arm controlled by Xbox 360 Wireless controller

The Arduino robotic arm controlled by Xbox 360 in action

ABOUT SERGEI DINES:
Sergei Dines is a mechanical engineer senior at USF, in FL. His interests include product design and robotics. He states, “going through the design process from scratch is very rewarding; it makes you think how everything is associated and forces you to ask help and connect with like-minded robotic enthusiasts”.
He would like to personally thank Barrett Anderies, Dr. Schlaf [USF], and Anthony Rose [USF] for their expertise.

  • Posted in: Tutorials

7 comments » Write a comment

  1. hey i’m trying to do this exact project but more complicated and also without the shield i want it so the controller is connected with the arduino do you know what to change to incorporate that and 3 more motors

  2. It seems that this project requires multiple (6) servos, but I can only see the wiring for one of the servos… Probably missed something, but could you help me understand? Thanks!

  3. Where do you get the money to do this stuff? I know You probably have a job but dang. also the robot looks like it isn’t very stable. has the robot ever broke or fallen apart?

  4. xbox360_wireless:61: error: ‘USB’ does not name a type ….. how solustion this wrong?

Leave a Reply to jeo Cancel reply

Required fields are marked *.