mdanna0722CRISTIAN SARVIADanna1302
Published © LGPL

Pluto Bluetooth RC Car

Pluto is a 2WD Bluetooth car on which is placed a self-balancing plane.

BeginnerFull instructions provided2 hours5,850
Pluto Bluetooth RC Car

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
6 DOF Sensor - MPU6050
DFRobot 6 DOF Sensor - MPU6050
×1
DC Motor, 12 V
DC Motor, 12 V
×2
L298N Driver Motor
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2
9V battery (generic)
9V battery (generic)
to power the Arduino board
×1
AA Batteries
AA Batteries
To power the DC motor
×8
Battery Holder, AA x 8
Battery Holder, AA x 8
×1

Software apps and online services

Arduino IDE
Arduino IDE
Ultimaker Cura
SolidWorks 2019/20

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Hot glue gun (generic)
Hot glue gun (generic)
Soldering Station, 110 V
Soldering Station, 110 V

Story

Read more

Custom parts and enclosures

Rod

Car

Plan A

external plane

Plan B

Internal Plane

cover

Schematics

Elettrical connections.

Code

Pluto car code

Arduino
is usefull for the operation of the car
char t;
#include <Wire.h>          //include the required libraries
#include <MPU6050.h>       //include MPU6050 libraries
#include <Servo.h>
MPU6050 sensor ;          //create an instance of the MPU6050 named sensor
Servo sg90y;
Servo sg90x;
int servo_pinX = 2;
int servo_pinY = 3;
int motor1A = 4;
int motor1B = 5;
int motor2A = 6;
int motor2B = 7;

int16_t ax, ay, az ;      //declare 6 16 bit integer variables
int16_t gx, gy, gz ;      //declare 6 16 bit integer variables

void setup() {
  pinMode(servo_pinX, OUTPUT);
  pinMode(servo_pinY, OUTPUT);
  pinMode(motor1A, OUTPUT);
  pinMode(motor1B, OUTPUT);
  pinMode(motor2A, OUTPUT);
  pinMode(motor2B, OUTPUT);
  pinMode(A5, INPUT);
  pinMode(A4, INPUT);
  sg90x.attach ( servo_pinX );
  sg90y.attach ( servo_pinY );
  Wire.begin ( );                  //begins the trasmission with MPU6050
  sensor.initialize ( );           //initialise the sensor
  Serial.begin(9600);
  delay(400);
}
void forward() {
  digitalWrite(motor1A, LOW);
  digitalWrite(motor1B, HIGH);
  digitalWrite(motor2A, LOW);
  digitalWrite(motor2B, HIGH);
}

void reverse() {
  digitalWrite(motor1A, HIGH);
  digitalWrite(motor1B, LOW);
  digitalWrite(motor2B, LOW);
  digitalWrite(motor2A, HIGH);
}
void right() {
  digitalWrite(motor1B, HIGH);
  digitalWrite(motor1A, LOW);
  digitalWrite(motor2B, LOW);
  digitalWrite(motor2A, HIGH);
}
void left() {
  digitalWrite(motor1B, LOW);
  digitalWrite(motor1A, HIGH);
  digitalWrite(motor2B, HIGH);
  digitalWrite(motor2A, LOW);
}
void nomove() {
  digitalWrite(motor1B, LOW);
  digitalWrite(motor1A, LOW);
  digitalWrite(motor2B, LOW);
  digitalWrite(motor2A, LOW);
}
void loop() {
  sensor.getMotion6 (&ax, &ay, &az, &gx, &gy, &gz);   //read 6 values into 6 variables
  ay = map (ay, -17000, 17000, 0, 180) ;              // change the range of the ay value from -17000/17000 to 0/180
  sg90y.write (ay);
  ax = map (ax, -17000, 17000, 0, 180) ;              // change the range of the ax value from -17000/17000 to 0/180
  sg90x.write (ax);
  if (Serial.available()) {

    t = Serial.read();
    Serial.println(t);                               //Read the incoming data and store it into variable t
    if (t == 'F') {
      forward();
    }
    else if (t == 'B') {
      reverse();
    }
    else if (t == 'L') {
      left();
    }
    else if (t == 'R') {
      right();
    }

    else if (t == 'S') {
      nomove();
    }
  }
}

Credits

mdanna0722

mdanna0722

1 project • 0 followers
CRISTIAN SARVIA

CRISTIAN SARVIA

1 project • 0 followers
Danna1302

Danna1302

0 projects • 0 followers

Comments