Playstation 2 Controller With Raspberry Pi

38,645

198

5

Introduction: Playstation 2 Controller With Raspberry Pi

This tutorial will show how to use the Playstation 2 Controller (PS2) with the Raspberry Pi. We use the Arduberry to adapt the shield to the Raspberry Pi.

Step 1: Hardware Required

  1. Raspberry Pi
  2. Arduberry
  3. Dexter Industries Playstation 2 Controller Shield for Arduino
  4. A Playstation 2 controller or a similar clone (Please Check the wiki for the compatible clones)

Step 2: Stack the PS2 Controller

Stack the PS2 controller connector to the PS2 shield and slide the shield on to the Arduberry. Slide the Arduberry on to the Raspberry Pi and power it on.

Step 3: Setting Up the Software

Clone the library from the Github Repository to /usr/share/Arduino/libraries.

cd /usr/share/arduino/libraries
sudo git clone  https://github.com/DexterInd/Arduino-PS2X.git

Rename the library from Arduino-PS2X to Arduino_PS2X

sudo mv Arduino-PS2X/ Arduino_PS2X/

Step 4: Upload the Code to Arduberry

Open Arduino, and open the example PS2X_Example from the Arduino_PS2X folder. Change the programmer to Raspberry Pi GPIO and upload the sketch to the Arduberry(use Ctrl+Shift+U).

Step 5: Setting Up Serial Port

The data that is coming from the PS2 shield is coming at 57600 baud, so we need to configure minicom. Follow Access the Serial port using minicom guide to change the baud rate to 57600.

Step 6: Getting the Data on the Serial Port

Make sure that the controller is connected to the Arduino shield and switched on. Press reset on the Arduberry to start receiving the data.

The PS2 Controller is now ready to be used in any project that you like.

Gadget Hacking and Accessories Contest

Participated in the
Gadget Hacking and Accessories Contest

Be the First to Share

    Recommendations

    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020

    5 Discussions

    0
    scott!
    scott!

    5 years ago on Introduction

    What is the benefit to this over a USB to PS2 adapter?

    0
    HenriR1
    HenriR1

    Reply 4 years ago

    you could use this on phone tablet retropi etc or even multiply the presses you make

    0
    mfrontuto
    mfrontuto

    6 years ago on Introduction

    could the controller be used as a remote control for XBMC if installed on the Pi?

    0
    dexter_industries
    dexter_industries

    Reply 6 years ago on Introduction

    You can get the button states in Python and C, so if you know how to control the XBMC using any of those two languages, then it should be pretty easy to use the controller as a Remote Control.