Project showcase
PlayStation Remote Controlled Wireless Car

PlayStation Remote Controlled Wireless Car © GPL3+

Who does not love gaming? Racing and fighting in the virtual world of PlayStation and Xbox! Let's bring that fun to real life!

  • 5,230 views
  • 4 comments
  • 10 respects

Components and supplies

Apps and online services

About this project

In this tutorial I have shown how anyone can convert a simple car to wireless remote controlled car that can be controlled by any PlayStation remote using some of the most common and easy-to-use components of electronics.

The use of PS2Xlib for Arduino IDE developed by Bill Porter makes it easier for us to to make use of any PlayStation remote control with some simple line of code!

Code

PS controller TransmitterArduino
This piece of code is to be uploaded to the arduino board being used at the transmitter end
#include <PS2X_lib.h>
#include<SoftwareSerial.h>
SoftwareSerial mySerial(6,7);  //HC-12 tx pin, rx pin
PS2X ps2x;
void setup() {
  ps2x.config_gamepad(5,4,3,2, false, false);      //GamePad(clock, command, attention, data, Pressures?, Rumble?)
  Serial.begin(9600);   
  mySerial.begin(9600);
}
void moveForward(){
    mySerial.println("1");
    Serial.println("FORWARD");
  }
void moveBackward(){
    mySerial.println("2");
    Serial.println("BACKWARD");
  }
void turnRight(){
    mySerial.println("3");
    Serial.println("RIGHT");
  }
void turnLeft(){
    mySerial.println("4");
    Serial.println("left");
  }
void turnClockwise(){
    mySerial.println("5");
    Serial.println("clock");
  }
void turnAnticlockwise(){
    mySerial.println("6");
    Serial.println("anticlock");
  }
void loop() {
ps2x.read_gamepad();
int Ry=ps2x.Analog(PSS_RY);  //Read the analog value up down movement from right joystick
delay(75);
int Rx=ps2x.Analog(PSS_RX); //Read the analog value right left movement from right joystick
delay(75);
int Ly=ps2x.Analog(PSS_LY); //Read the analog value up down movement from left joystick
delay(75);
int Lx=ps2x.Analog(PSS_LX); //Read the analog value right left movement from left joystick
delay(75);

if(Ly==0 && Ry==0){
    moveForward();
  }
if((Ly==255 || Ly==254) && (Ry==255 || Ry==255)){
    moveBackward();
  } 
if(Ry==0 && Ly!=0){
    turnRight(); //turn off left motor
  }
if(Ly==0 && Ry!=0 ){
    turnLeft(); //turn off right motor
  }
if(Ly==0 && (Ry==255 || Ry==254)){
    turnClockwise();
  }
if((Ly==255 || Ly==254) && Ry==0){
    turnAnticlockwise();
  }
PS controller ReceiverArduino
This piece of code is to be uploaded to the arduino board at the receiver end.
#include<SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);  //HC-12 tx pin, rx pin
int in1=4, in2=5, in3=6, in4=7; //Motor driver pins

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
}
void moveForward(){
      digitalWrite(in1, LOW);
      digitalWrite(in2, HIGH);
      digitalWrite(in3, LOW);
      digitalWrite(in4, HIGH);
  }
void moveBackward(){
      digitalWrite(in1, HIGH);
      digitalWrite(in2, LOW);
      digitalWrite(in3, HIGH);
      digitalWrite(in4, LOW);
  }
void moveLeft(){
      digitalWrite(in1, LOW); 
      digitalWrite(in2, LOW);
      digitalWrite(in3, HIGH);
      digitalWrite(in4, LOW);
  }

void moveRight(){
      digitalWrite(in1, HIGH); 
      digitalWrite(in2, LOW);
      digitalWrite(in3, LOW);
      digitalWrite(in4, LOW);
  }
void clockwise(){      
      digitalWrite(in1, LOW);
      digitalWrite(in2, HIGH);
      digitalWrite(in3, HIGH);
      digitalWrite(in4, LOW);
}
void anticlockwise(){      
      digitalWrite(in1, HIGH);
      digitalWrite(in2, LOW);
      digitalWrite(in3, LOW);
      digitalWrite(in4, HIGH);
}
void loop() {
  
  if(mySerial.available()>0){
          int input = mySerial.read();
          if(input=='1'){
          Serial.println("FORWARD");
          moveForward();
        }
      if(input=='2'){
          Serial.println("BACKWARD");
          moveBackward();
        }
      if(input=='3'){
          Serial.println("RIGHT");
          moveRight();
        }
      if(input=='4'){
          Serial.println("LEFT");
          moveLeft();
        }
      if(input=='5'){
          Serial.println("CLOCKWISE");
          clockwise();
        }
      if(input=='6'){
          Serial.println("ANTICLOCKWISE");
          anticlockwise();
        }
  delay(190);
  }   
       else{ 
        digitalWrite(in1, LOW);
          digitalWrite(in2, LOW);
          digitalWrite(in3, LOW);
          digitalWrite(in4, LOW);
       } 

}
PS2X Arduino library
This library is can be used to run our play station remote in coordination with our arduino board.

Custom parts and enclosures

Designs for the Chassis
This is the sketchup file for the designs of the various pats used for the making of the chassis of the car.
It contains one rectangular plate( 2 pieces will be required ), one C-shaped plate( 2 pieces will be required), one Caster wheel mount, and one small L-shaped bracket to attach the Caster wheel mount to the rectangular plate(2 pieces will be required).
car_chassis_9o8pvnBh8S.skp

Schematics

Transmitter End Schematic
Img 20180204 165456 coc98yfl2x
Receiver End Schematic
Img 20180204 165203 e7nagnuj49
Play Station Pinout
Images (8) fqtjycqvxz

Comments

Similar projects you might like

Smartphone Controlled Arduino 4WD Robot Car

Project in progress by Andriy Baranov

  • 53,245 views
  • 43 comments
  • 98 respects

Robotic Car Controlled over Bluetooth by Andriod Phone

Project showcase by S.Ranjith Reddy

  • 4,706 views
  • 0 comments
  • 9 respects

Remote Controlled Car

Project showcase by Jeremy Vestal

  • 2,654 views
  • 2 comments
  • 9 respects

How to Make a Remote Controlled Robotic Hand with Arduino

Project showcase by Gabry295

  • 35,363 views
  • 5 comments
  • 110 respects

Bolt Controlled Robot Car

Project tutorial by Team Bolt

  • 1,508 views
  • 1 comment
  • 13 respects
Add projectSign up / Login