Jasmeet Singh
Published © GPL3+

PlayStation Remote Controlled Wireless Car

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

IntermediateShowcase (no instructions)15 hours8,136
PlayStation Remote Controlled Wireless Car

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×2
HC-12 wireless communication module
×2
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
DC motor (generic)
×2
play station remote controller
×1
Robotic wheel
×2
Ball Caster Wheel
×1
Axle Lock
×4

Software apps and online services

Arduino IDE
Arduino IDE
sketchup

Story

Read more

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).

Schematics

Transmitter End Schematic

Receiver End Schematic

Play Station Pinout

Code

PS controller Transmitter

Arduino
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 Receiver

Arduino
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.

Credits

Jasmeet Singh

Jasmeet Singh

12 projects • 9 followers

Comments