

The Analog PS2 Controller by Sony is a game controller designed for the PlayStation 2 console. It features a combination of digital and analog input methods, including a directional pad, two analog sticks, and multiple buttons. This versatile input device is widely used not only for gaming but also in DIY electronics projects, robotics, and other applications requiring user input.








| Parameter | Specification |
|---|---|
| Manufacturer | Sony |
| Part ID | Analog PS2 Controller |
| Communication Protocol | Serial (SPI-like protocol) |
| Operating Voltage | 3.3V to 5V |
| Current Consumption | ~5mA (idle), ~15mA (active) |
| Number of Buttons | 12 (including Start, Select, and L3/R3) |
| Analog Sticks | 2 (X and Y axes for each stick) |
| Cable Length | ~2 meters |
| Connector Type | Proprietary PS2 connector |
The PS2 controller uses a proprietary connector with the following pinout:
| Pin Number | Name | Description |
|---|---|---|
| 1 | Data | Serial data line (controller to host) |
| 2 | Command | Serial command line (host to controller) |
| 3 | VCC | Power supply (3.3V to 5V) |
| 4 | Ground | Ground connection |
| 5 | Attention | Chip select (active low, used to initiate communication) |
| 6 | Clock | Serial clock line (host to controller) |
| 7 | N/C | Not connected (reserved for future use) |
| 8 | ACK | Acknowledge signal (controller to host, optional in some implementations) |
Below is an example of interfacing the PS2 controller with an Arduino UNO to read button states and analog stick positions:
#include <PS2X_lib.h> // Include the PS2X library for PS2 controller communication
PS2X ps2x; // Create PS2X object
// Pin definitions for PS2 controller
#define PS2_DAT 12 // Data pin
#define PS2_CMD 11 // Command pin
#define PS2_SEL 10 // Attention pin
#define PS2_CLK 13 // Clock pin
void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
// Initialize the PS2 controller
int error = ps2x.config_gamepad(PS2_CLK, PS2_CMD, PS2_SEL, PS2_DAT, true, true);
if (error == 0) {
Serial.println("PS2 Controller successfully connected!");
} else {
Serial.print("Error connecting PS2 Controller: ");
Serial.println(error);
}
}
void loop() {
ps2x.read_gamepad(false, 0); // Read the controller state
// Read button states
if (ps2x.Button(PSB_START)) {
Serial.println("Start button pressed");
}
if (ps2x.Button(PSB_SELECT)) {
Serial.println("Select button pressed");
}
// Read analog stick positions
int leftStickX = ps2x.Analog(PSS_LX);
int leftStickY = ps2x.Analog(PSS_LY);
int rightStickX = ps2x.Analog(PSS_RX);
int rightStickY = ps2x.Analog(PSS_RY);
Serial.print("Left Stick: X=");
Serial.print(leftStickX);
Serial.print(", Y=");
Serial.println(leftStickY);
Serial.print("Right Stick: X=");
Serial.print(rightStickX);
Serial.print(", Y=");
Serial.println(rightStickY);
delay(100); // Add a small delay to avoid flooding the serial monitor
}
Controller Not Responding:
Incorrect Button States or Analog Values:
Library Errors:
By following this documentation, users can effectively integrate the Sony Analog PS2 Controller into their projects and troubleshoot common issues with ease.