Accéder au contenu principal

Interfacing Wireless PS2 Controller with Arduino


Hi, in this tutorial we’ll try to interface a PS2 wireless controller with Arduino UNO board, it is very interesting since all the controller’s buttons would be inputs for the Arduino board and not only that but also wireless, using 2.4GHz Radio Frequency communication protocol, which can be very useful to control robots, vehicles, servos…


I bought this controller with A servo dedicated board for 30 USD, you can get the controller/Receiver much cheaper, but don’t forget that these cheap things have some problems (you can see it in the video), the sensitivity is not that good comparing it with the original controller, but that’s not a big deal for the moment.

You can learn a lot about this controller visiting this website:

Since here we don’t talk too much lets get to the wiring.


Considering from which side you are observing this is the order I followed, the pins #3 and #8 don’t have a connector at all, also we’re not using the pin #9.


This is my wiring sorry it’s not very esthetic.


Wiring with the usual LCD i2c screen, I used with the code I made.


Libraries and codes:

-LCD i2c Library

-PS2X Library

-Code using LCD

The code I’ve used in the tutorial: The first one you’ll find it in the library, it shows different functions you can use such as reading the analog stick values, detect if a button is pressed, released or being held…., also it detects which type of controller you are using or showing you an error if there is one.

The second code just takes few functions and shows the value or the buttons that are being pressed on the screen, here I only associated printing on lcd screen for every function, but for you, you can control servos, dc motors, leds… overall it’s just an example for the tutorial.

Hope you like it, and if you have any problem you can contact me.


Yassine Tout afficher

Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.

10 commentaires sur “Interfacing Wireless PS2 Controller with Arduino Laisser un commentaire

  1. brother, I want to do a counter using some axis of the stick to control servos later,
    the problem is that I want to use the value (controlps.Analog (PSS_LY), DEC); and use conditional « if » to increase or decrease said counter.
    when doing this, the « ++ or — » operation does not respond, but the function does recognize the real-time position of the stick,
    can you support me to determine the fault ?.

    #include //

    PS2X controlps; // create PS2 Controller Class

    int contadorservo;//—–>counter variable

    void setup() {

    controlps.config_gamepad(13,11,10,12, false, false); // GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error

    void loop() {
    byte vibrate = 0;
    int lectura=(controlps.Analog(PSS_LY), DEC);
    controlps.read_gamepad(false, vibrate);

    if(lectura==0) {contadorservo=contadorservo++;} //condicional only for fast test

    Serial.print(contadorservo); //—–> print the data
    Serial.print( » « );
    Serial.println(controlps.Analog(PSS_LY), DEC);

    Best regards and grace for the support


  2. Try this writing


    Try not to copy/paste this directly it may result in some errors like « stray ‘\342’ in program » and it won’t compile.


  3. brother could you make a post with the code with the project that you tell me, I would like to have a reference with a functional project, the example of arduino has several functions running and on the internet I only find projects using buttons and no stick

    thank you for your support my email is



Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:


Vous commentez à l'aide de votre compte Déconnexion /  Changer )

Photo Google

Vous commentez à l'aide de votre compte Google. Déconnexion /  Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion /  Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion /  Changer )

Connexion à %s

%d blogueurs aiment cette page :