SparkFun will be closed on Tuesday, November 5th to support our team in being able to go out and vote! Orders placed after 2 pm MT Monday, November 4th will ship on Wednesday, November 6th. Thanks for your patience and understanding.
This product has shipping restrictions, so it might have limited shipping options or cannot be shipped to the following countries:
This is similar to your standard PlayStation 2 controller; two thumb-sticks, a D-Pad, 4 buttons, 4 triggers, start and select. But wait, that's a whole lot of control! Use this with your next project to control ground vehicles, air vehicles, on-screen elements, ~~killer robots~~, or just about anything you want. Check the link below for an article on interfacing this controller with an Arduino. There's even an Arduino library available!
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
No reviews yet.
Strikeout or not, this is going on my next killer robot.
I see there are several people concerned about cutting the wires on this controller. I cut the cable of mine yesterday and didn't have any trouble soldering on a different connector.
!!!WARNING!!! The joysticks do NOT have 8-bit resolution. The resolution on these are 5-bit. This is a big disappointment. Instead of getting values from 0 to 255 as expected with 8-bits the numbers outputted were: 0, 11, 20, 27, 36, 43, 52, 59, 68, 75, 84, 91, 100, 107, 116, 123, 132, 139, 148, 155, 164, 171, 180, 187, 196, 203, 212, 219, 228, 235, 244, 255. 32 different possible values instead of 256.
There is a lot of dead area with the joysticks. The joystick values only change within the ceter two thirds of possible travel.
I believe the buttons on these controllers are supposed to output analog values depending on how hard they are pressed. I haven't been able to access any analog values from the buttons.
I'm using a Propeller chip to interface with this controller. I want to find a Sony version of the controller to compare this one against.
I'm hoping someone else can post thier results using this controller. I'm pretty sure about the joysticks only being 5-bits but I'm not sure I'm reading the button information correctly.
I've taken this controller apart and I don't see how the buttons can output analog values but I might be wrong.
Watch out if any of you take this controller apart. The screws easily strip thier connecting posts.
Edit(4/24/12): PlayStation 2 controllers do have analog buttons. I've modified a driver to read the analog pressures with a Propeller chip. It is attached to post #4 of this thread.
Correct me if I am wrong but only the PS3 controllers have the triggers where it depends on how hard they are pressed.
I'm back to correct you and myself. The PS2 controller does have pressure sensitive buttons (12 of them).
These analog readings have to be enabled by entering config mode and then turning on the analog buttons. The controller needs to be in analog mode before turning on the analog buttons. Switching back to digital mode turns off the analog buttons.
The controller I purchased from SF doesn't work anymore so I don't know if the analog buttons work. If they do work I bet they don't output 8-bits of data for each button.
Edit: Magruder and I were both wrong about the PS2 controller's buttons. See my post below this one.
I don't think your wrong about the buttons and triggers. I purchased a Sony controller (only $5 more than this one) and the buttons all behaved the same as this controller's buttons. The joysticks on this are the problem. This controller scales a 5-bit value up to 8-bits. I suppose 5-bits is probably enough for a lot of uses one my have for this controller but I'd like to have the extra resolution myself.
Back to triggers. I know some controllers (I think XBox) have analog triggers (not the PS2). I had read something online that led me to (incorrectly) believe PS2 also had analog tiggers.
The library link is now broken (well points to an empty zip), as that version had bugs. Go here to get the newest version: http://www.billporter.info/playstation-2-controller-arduino-library-v1-0/
Fixed, thanks!
Is there anyway we can get a C example, I do not have the .pde extension
Is there anyway we can get a C example, I do not have the .pde extension
Lynxmotion has connectors for these
http://www.lynxmotion.com/p-73-ps2-controller-cable.aspx
There are a lot of online retailers selling these cables, such as RobotShop, etc
When I was using ps2 controllers I just cut off the end and crimped the wires into a rj-45 connector.
I was working on writing this into a library, Never finished it.
Glad someone else did.
Just ordered one. So, can you cut the wires or not? Anyone know for sure? Anyone at Sparkfun actually try cutting the wire??
Yes, you can cut the wires. See my reply above.
I added a link to a $5 female breakout for PS2 controllers on my library page. I'll add a link to SFE's when they get there butt in gear and start selling their own as well.
I actually just put an original ps2 controller on my arduino mega. I scavenged the port connector from an old 1st gen playstation. I found the PSX2 Library to be the better one. The PSX2 library is a definite must have.I had the controller up and running in minutes.
If this is a SPC-10010 do NOT cut the cable. It has ~26 gauge wire that is twisted with plastic fibers that makes the copper very delicate. Instead buy a extension cable to cut.
I cut the cable off mine yesterday. The wires are fine (there are eight). I didn't have any trouble soldering them to female headers to make a plug. The colors of the wires match the online guides I've seen.
See my other comment below about problems this controller does have.
I added a link to a $5 female breakout for PS2 controllers on my library page. I'll add a link to SFE's when they get there butt in gear and start selling their own as well.
AAHH! It's rear in gear! NNNooooooooooooooo... Acckkppcchhtthh... Hurgh... (dies)
On the Arduino Project page linked above it has someone using the wireless Guitar Hero controller, would it work the same way with an actual wireless PS2 controller as well?
Yes, though there has been mixed results depending on brand of controllers. Official Sony seems to work best.
For those of you looking to hook this up to a bipod robot the nice people at Lynxmotion have already done most of the work for you. here you can find a biped kit that suports ps2 controllers. althogh the kit comes with a wireless ps2 controller reciver you could just substitute the reciver with the end of the controller wire
What's in these things anyway? Two variable resistor things (analog sticks), several buttons, and some motors? If you decide you don't want it for a project it's not bad to take apart and grab the parts later too. Decent price I think.
Where would the motors be?
the vibration motors inside the dual shock 2 controllers.
seconding the breakout board, with all the fixin's. that way i can still use the controller for ps2 playing when its not controlling my robot.
You REALLY need a breakout board for these. I've tried (And eventually succeded) in cutting the wires manually, but they're tough to use and UNBELIEVABLY fragile, I had to solder them to a protoboard first to avoid excess stress. I can confirm that the library works well however, I've used it in a past project with great results. Only thing is that my controller (Like some others) needed a resistor between two of the lines, which ones I can't recall. Anyway, great library, useful product, and thanks Bill Porter (Madsci) for the epic library, was really helpful a couple months ago.
No problem Striker!
And it was most likely a resistor between VCC and DATA, to bring up the 3.3V logic levels a little higher to be read by a 5V Arduino.
Wow, linked from a product post, I'm honored.
To SFE staff: I'd rather you just link my page so people could see the wiring diagram, notes on power supply, etc. Though would understand if you wanted to keep a direct link but it creates problems when new library versions come out and the file name changes. I created a generic download here to solve the problem:
http://www.billporter.info/wp-content/uploads/static/Arduino-PS2-Controller-Library.zip
I'll update the generic file as new library versions are released.
To all: Checkout the library page for notes on power, an easy to follow wiring diagram and lots of examples and video using the library. Any problems, leave a comment there and I will try to help. 213 support comments and counting.
The library is very Guitar Hero Controller friendly as well.
I'd also like to see a breakout board for the connector, as it would solve many problems people have when getting started, and be easier on me :). Proper level shifting (both ways) and a voltage regulator and you would be good to go.
Hey, Thats where I found the adapter.
Very nice work on the lib.
V1.5 is awesome.
(V1.6 is buggy though)
Let me know what you experienced so I can fix it!! On my blog if you can.
Additionally, this controller is supported by WebbotLib:
http://webbot.org.uk/iPoint/30.page
Hum, I guessed we assumed people would just hack off the connector and break out the wires. Not a bad idea to make a breakout board. Noted.
There is a breakout connector, as seen here http://www.lynxmotion.com/p-73-ps2-controller-cable.aspx.
(HINT HINT SPARKFUN)
(Just noticed this was already mentioned. haha oops.)
I ended up just buying a £2 PS2 controller extension cable on fleabay and chopping that up instead. Then your friends don't moan so much when you steal their controllers for your projects. :)
Could we also see maybe the female port for the connector?
are you guys going to do a breakout connector
Here's an Arduino shield for the PS2 Controller on Tindie:
https://tindie.com/shops/DexterIndustries/arduino-playstation-dualshock-shield/