Jeremy Vestal
Published © GPL3+

Remote Controlled Car

Remote controlled Car designed to navigate a course and lift a small amount of weight.

IntermediateShowcase (no instructions)Over 1 day5,630
Remote Controlled Car

Things used in this project

Hardware components

Servos (Tower Pro MG996R)
5 servos were used on the car
×5
Arduino UNO
Arduino UNO
Arduino UNO and Arduino USB host shield were used
×1
Relay (generic)
2 Channel really board was used to control the motor
×1
Slide Switch
Slide Switch
Power on/off switches
×2
9V battery (generic)
9V battery (generic)
9v Battery holder
×1
4xAA battery holder
4xAA battery holder
with 4 AA batteries
×1

Story

Read more

Schematics

Controls Schematic

This is the schematic for all of the electronics. Its kind of complicated in the center of the diagram, however the bluetooth dongle receives what the PS3 controller is telling it and it sends it through the Arduino USB host shield that is plug in to the Arduino UNO which tells everything else that to do.

Code

Play Station 3 controls coding

Arduino
This code is used to control the arduino
Team 7 bluetooth set up and drive code. 
Modified by Glen Smith April 15, 2016

 */

#include <PS3BT.h>                                                    //Include the necessary libraries.
#include <Servo.h>

USB Usb;
BTD Btd(&Usb);
PS3BT PS3(&Btd); 

Servo servo1;                                                         //Create instances of type Servo. servo1 and servo2 are drive servos. servo3 is for the stabalizer. 
Servo servo2;
Servo servo3;

int position=90; 

void setup() 
{
  Serial.begin(115200);                                              
  if (Usb.Init() == -1)
  {                                            
    Serial.print(F("\r\nOSC did not start"));
    while(1); //halt
  }
  Serial.print(F("\r\nPS3 Bluetooth Library Started"));              
  
  
  servo1.attach(5);                                                  //Drive servo1 and servo2
  servo2.attach(3);                                                   
  servo3.attach(6);                                                  //Crane arm on servo3
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  digitalWrite(7,LOW);
  digitalWrite(8,LOW);
}
void loop() 
{
  Usb.Task();

  if(PS3.PS3Connected || PS3.PS3NavigationConnected)                //Drive code 
  {
    
    servo1.write(map(PS3.getAnalogHat(RightHatY), 0, 255, 0, 165));
    servo2.write(map(PS3.getAnalogHat(LeftHatY), 0, 255, 180, 15));

    if(PS3.getButtonPress(DOWN) && position<178)                      //servo3 for stabilization drive out. the in and out need to be teste dto make sure everything goes the correct way.
    {
     servo3.write(position++);
     delay(10);
      }

    if(PS3.getButtonPress(UP) && position>3)                     //servo3 drive in
    {
      servo3.write(position--);
      delay(10);
      }
     
   if(PS3.getButtonPress(X))                                //DC drive out. Needs limiting factrs for crane and testing with the shield 
   { digitalWrite(7,HIGH);
      delay(10);
      }
      else
      { digitalWrite(7,LOW);
        }
    
    if(PS3.getButtonPress(TRIANGLE))                                       //DC drive in.
    { digitalWrite(8,HIGH);
      delay(10);
      }
      else
      { digitalWrite(8,LOW);
        }   
  }
  
  }
   

Credits

Jeremy Vestal

Jeremy Vestal

1 project • 3 followers
UNCC MEGR student

Comments