Hook up PS3 controller to USB Host shield

PS3 controller connected to Arduino USB Host Shield

PS3 controller connected to Arduino USB Host Shield

Another HID example has been added to Github repository of USB Host Shield for Arduino (which you can purchase in my store) . Richard Ibbotson sent me this nice piece of code along with some pictures. He also posted a short description of his sketch in comments section:

I wrote a sketch for the interface of the PS3 controller over USB. I have two controllers, one Sony and one Madcatz wireless with a USB dongle. Both of these work fine to the USB host shield. I only made one minor change to the library to increase the NAK count. The sketch tests all the function, buttons, joysticks, accelerometer/gyro, leds and rumble. This is not yet under bluetooth just USB. I can set the host bluetooth adddress on the controller though which is needed for bluetooth pairing.

Did not make much attempt to reduce code or data size, so only have about 4K of program space and 240 bytes of data space left, but sketch is pretty long. The actual PS3 part is very small and could be made to a small library.

Next is to move to the bluetooth part, from what I have found on the direct USB, I am pretty confident this will fit even on the 168.

PS3 controller support opens some very interesting possibilities. Not only can it be used as a normal “joystick plus buttons” type of control, but you can also utilize it’s accelerometer/gyro. With wireless variant of the controller all kinds of very powerful radio control are possible. Who is going to be the first to make a mechanical dog, which follows you around and brings back the controller when you throw it away?

If you want to try the sketch, make sure you have the latest library code as well – there are some small but important changes made recently in NAK handling.

MadCatz wireless controller to USB Host Shield

MadCatz wireless controller to USB Host Shield

Wireless mini keyboard connected to USB Host Shield

Wireless mini keyboard connected to USB Host Shield

5 comments to Hook up PS3 controller to USB Host shield

  • Djhg2000

    This works out perfectly with a project I’ve been planning for a while; DS3 for X360 😀
    All I’ve got to do is to find a suitable USB Client chip (for X360 controller emulation).

    Now I REALLY want to get a hold of an Arduino + USB shield…

    Looking forward to some sleepless nights of reverse-engineering the X360 controller interface 😛

  • Mikey

    Good luck with RE’ing the 360 interface — there’s crypto involved, and it’s hard core.

  • Richard

    Thanks Mikey.
    I have not used the X360 Controller, but as you say there appears to be a security device identified on one USB endpoint. This validates the game controller as “acceptable” to the Xbox. As this ssecurity does not seem to encrypt the other endpoints the game controller can be used on other devices as in the N64 controller below, however making an alternative controller for the XBox may not be possible.

  • Sam

    Hi. I’m in my school’s robotics club and we’re following these guides to try and sync up a PS3 controller to an arduino board to control our robot. We have got the PS3LCD sketch to compile (finally) and now have absolutely no idea where to connect the pins? Is there a clear picture of how to connect it all up? We really need to know just what pins to plug into where from where and all that.

    Any help would be incredibly appreciated. 🙂
    Thanks so much and keep up the good work.

  • Hello,

    This is exactly what I was looking for, thank you very much for all this information, it’s a very good work.