Iain
Published

PlayStation One Analog Sticks With Arduino

Here I show how to take apart an old PlayStation analog stick, show what it's comprised of, and how to make it work with an Arduino!

IntermediateFull instructions provided3 hours7,534
PlayStation One Analog Sticks With Arduino

Things used in this project

Hardware components

Arduino Pro Mini 328 - 3.3V/8MHz
SparkFun Arduino Pro Mini 328 - 3.3V/8MHz
Note: Any Arduino will do — I just love the Pro Mini!
×1
SparkFun FTDI Basic Breakout - 3.3V
SparkFun FTDI Basic Breakout - 3.3V
Necessary if you're using the Pro Mini or something that could use the FTDI serial.
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
Necessary if you're using the Pro Mini or something that could use the FTDI serial.
×1
SparkFun Breadboard Power Supply Stick - 5V/3.3V
SparkFun Breadboard Power Supply Stick - 5V/3.3V
If you're using the Pro Mini or similar, any Breadboard power supply will do so long as you can get 3.3V out of it.
×1
Jumper wires (generic)
Jumper wires (generic)
×13

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

PlayStation One Analog Stick Circuit Diagram

The components shown (button, potentiometers) are representing the analog stick's parts. Connect them to the Arduino accordingly.

Also, you don't need a pro mini to use this! I'm just a big fan of it!

Code

PlayStation One Analog Stick Test

C/C++
To use this, simply paste it into the Arduino IDE and connect the pins accordingly. The potentiometers can be finicky, but they return values depending if the value has changed from the last value, and there's a slight delay to the loop to prevent the values from changing the serial at the slightest touch.
/**
 *
 * PlayStation One Analog Stick Test file
 * Author: @iainiscreative
 *
 * This is a program to check if the analog stick is working okay.
 * The analog stick has two potentiometers and a button.
 * This program checks the values of the potentiometers and prints it to serial,
 * while an LED is also placed to test the button.
 *
 * This code is open source for you to use and even modify.
 *
 */

// Store each pin in a variable
int BUTTON = 7;
int LED = 9;
char POTENTIOMETER_X = "A0";
char POTENTIOMETER_Y = "A1";

// Set last values for each potentiometer
int lastValueX = 0;
int lastValueY = 0;

// Begin Setup
void setup() {
  Serial.begin(9600);
  // Set the button to a input pullup
  // NOTE: since the button is a pullup, the controls are inversed
  pinMode(BUTTON, INPUT_PULLUP);
  // Set the LED in the circuit as an output for testing the button
  pinMode(LED, OUTPUT);
}

// Begin Loop
void loop() {
  // Add a tiny delay to the loop
  delay(100);
  // Store values of each input
  int buttonValue = digitalRead(BUTTON);

  // Read each Potentiometer's value and store in a variable
  int sensorValueX = analogRead(POTENTIOMETER_X) / 10.2;
  int sensorValueY = analogRead(POTENTIOMETER_Y) / 10.2;

  /**
   *
   * If the value's of each potentionmeter do not match their respective last
   * value, update the values and update to serial.
   *
   */

  if(sensorValueX != lastValueX) {
    Serial.print("Potentiometer X:");
    Serial.println(sensorValueX);
    lastValueX = sensorValueX;
  }

  if(sensorValueY != lastValueY) {
    Serial.print("Potentiometer Y:");
    Serial.println(sensorValueY);
    lastValueY = sensorValueY;
    // Apply a slight delay to the loop
  }

  /**
   *
   * Button Test
   *
   * Since the button acts as a pullup, its controls are inversed.
   * Therefore, when it's pressed it will give a LOW value.
   * Should there be a low value, turn the LED on.
   * Otherwise, keep the LED off.
   *
   */
  if(buttonValue == LOW) {
    digitalWrite(LED, HIGH);
  } else {
    digitalWrite(LED, LOW);
  }

}

Credits

Iain

Iain

5 projects • 71 followers
Hello! I'm Iain, a digital creator. I like making projects with code, art, and robots. Follow me for awesome projects and fun tidbits!

Comments