Use a PS3 Controller to control an Arduino NXT Bot

 by nahamancygig

Step 5: Assemble the Arduino Hardware

Take a look at that i2C cable from Mindsensors.  (you could also sacrifice one from your NXT set, but this one is a bit more hacker-friendly because the wires can be stripped more easily.)

First cut the cable in half!  You only need one half in this case.


With an exacto knife, separate the individual strands of the wire.
(Be Gentle!  separate them just over an inch apart from each other.)

Next, (Gently) strip the insulation off of each wire except the red one.

From your stack of header pins, give yourself 4 separate individual header pins.  Solder the following:

One header pin to the 5V wire
One header pin to the two Ground wires (just twist those two ground wires together)
One header pin to the SCL wire
One header pin to the SDA wire

Insulate all of your solder joints with some tape!

Next: the Arduino assembly

Attach an Xbee radio to the Xbee shield from Sparkfun.
Mount this shield onto the Arduino.

Attach the modded NXT wire to Arduino as follows.
5V goes to the Arduino 5V
Grounds go to the Arduino Gnd
SCL goes to Arduino's analog pin 5
SDA goes to Arduino's analog pin 4
(For the last two connections, you'll have to twist the NXT wire because the wire connections are reversed.)

Next: connect the mindsensors multiplexor to the Arduino.  Insert it into the NXT socket because our Arduino is "mimicking" the NXT by speaking in the i2c protocol that the NXT uses to communicate to the motors.

Lastly:
connect the motor chassis motor cables in the corresponding M1 and M2 connections.  If you find that you're controlling the motor that doesn't correlate to the correct analog stick, simply switch the connections here in the future.

From here on out:  Simply mount everything onto the chassis!  (I used Gaffers Tape here.)
 
Remove these adsRemove these ads by Signing Up
devilmaycry says: Jul 31, 2011. 8:29 AM
I m about to order every thing but i cant find theI2ccable that the only thing misiing from my list. Can u please give me a Url or type or name of the cable and for the robot chassia aswell please.
nahamancygig (author) in reply to devilmaycryJul 31, 2011. 11:17 AM
For the i2c cable, check out this website: http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=136

I actually built the robot chassis using spare lego technic parts. The chassis itself doesn't matter for this instructable, so feel free to build your own, as long as it uses two nxt motors: one for each side of the robot.

Don't forget that you'll also need the multiplexor board to connect the motors into the cable also! You can find that here:

http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=134

Have fun, and i'd love to here how it goes!

devilmaycry in reply to nahamancygigAug 1, 2011. 6:26 AM
Thanks
jsut need to orderthe stuff now.Could u please help me with processing (controller test)

=============================================================

Failed to poll device: Failed to poll device (8007000c)
Failed to poll device: Failed to poll device (8007000c)

0
0
0
0

<<< available PLAYSTATION(R)3 Controller sliders: >>>

0: Z Rotation absolute
1: Z Axis absolute
2: Y Axis absolute
3: X Axis absolute
4: Pointer absolute

<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<<< available PLAYSTATION(R)3 Controller buttons: >>>

0: Button 0
1: Button 1
2: Button 2
3: Button 3
4: Button 4
5: Button 5
6: Button 6
7: Button 7
8: Button 8
9: Button 9
10: Button 10
11: Button 11
12: Button 12
13: Button 13
14: Button 14
15: Button 15
16: Button 16
17: Button 17
18: Button 18

<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Exception in thread "Animation Thread" java.lang
.NullPointerException
at Test.draw(Test.java:60)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!