Project tutorial
Car Control with Arduino Uno and Bluetooth

Car Control with Arduino Uno and Bluetooth © MIT

With this project, you can remotely control your car with Bluetooth.

  • 6,973 views
  • 10 comments
  • 40 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

I wanted to check a car but I have different ways to try it remotely. I wanted to do with bluetooth after the necessary tools for this and after the software was written. and this will be my second project in the hackster

Code

arduino codeArduino
char buffer[67];

byte Pino02 = 2;
byte Pino03 = 3;
byte Pino04 = 4;
byte Pino05 = 5;
byte Pino06 = 6;
byte Pino07 = 7;
byte Pino12 = 12;
byte Pino13 = 13;


void setup(){
  Serial.begin(9600);
  Serial.flush();
  pinMode(Pino02, OUTPUT);
  pinMode(Pino03, OUTPUT);
  pinMode(Pino04, OUTPUT);
  pinMode(Pino05, OUTPUT);
  pinMode(Pino06, OUTPUT);
  pinMode(Pino07, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
}
void loop(){
  if (Serial.available()>0){
    int index=0;
    delay(100);//deixe o buffer encher
    int numChar = Serial.available();
    if(numChar>65){
      numChar=65;
    }
    while(numChar--){
      buffer[index++] = Serial.read();
    }
    splitString(buffer);
  }
}
void splitString(char* data){
  Serial.print("Dados inseridos: ");
  Serial.println(data);
  char* parameter;
  parameter= strtok (data, " ,");
  while(parameter != NULL){
    setLED(parameter);
    parameter = strtok (NULL, " ,");
  }
  //Limpa o texto e os buffers seriais
  for (int x=0; x<66; x++){
    buffer[x]='\0';
  }
  Serial.flush();
}
void setLED(char* data){
  
  if (data[0] == 'A'){
    analogWrite(9, 50);
    analogWrite(10, 50);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİSOL

    if (data[0] == 'C'){
    analogWrite(9, 50);
    analogWrite(10, 50);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİSAĞ
  
  if (data[0] == 'B'){
    analogWrite(9, 25);
    analogWrite(10, 25);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,LOW);
    digitalWrite(13,HIGH);
    }//GERİ1

    if (data[0] == 'M'){
    analogWrite(9, 75);
    analogWrite(10, 75);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,LOW);
    digitalWrite(13,HIGH);
    }//GERİ2

     if (data[0] == 'N'){
    analogWrite(9, 125);
    analogWrite(10, 125);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,LOW);
    digitalWrite(13,HIGH);
    }//GERİ3

    if (data[0] == 'P'){
    analogWrite(9, 175);
    analogWrite(10, 175);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,LOW);
    digitalWrite(13,HIGH);
    }//GERİ4

    if (data[0] == 'L'){
    analogWrite(9, 225);
    analogWrite(10, 225);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,LOW);
    digitalWrite(13,HIGH);
    }//GERİ5
    
  if (data[0] == 'D'){
    analogWrite(9, 25);
    analogWrite(10, 25);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİ1

    if (data[0] == 'H'){
    analogWrite(9, 75);
    analogWrite(10, 75);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİ2

    if (data[0] == 'I'){
    analogWrite(9, 125);
    analogWrite(10, 125);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİ3

    if (data[0] == 'K'){
    analogWrite(9, 175);
    analogWrite(10, 175);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİ4

    if (data[0] == 'L'){
    analogWrite(9, 225);
    analogWrite(10, 225);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    digitalWrite(12,HIGH);
    digitalWrite(13,LOW);
    }//İLERİ5
  
  if (data[0] == 'U'){
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, LOW);
    digitalWrite(12,LOW);
    digitalWrite(13,LOW);
    }//DUR
     
  if (data[0] == 'E'){
    analogWrite(9, 50);
    analogWrite(10, 50);
    digitalWrite(Pino02, LOW);
    digitalWrite(Pino03, HIGH);
    digitalWrite(Pino04, LOW);
    digitalWrite(Pino05, HIGH);
    }//YAVAŞ İLERİ
      
  if (data[0] == 'F'){
    analogWrite(9, 50);
    analogWrite(10, 50);
    digitalWrite(Pino02, HIGH);
    digitalWrite(Pino03, LOW);
    digitalWrite(Pino04, HIGH);
    digitalWrite(Pino05, LOW);
    }//YAVAŞ GERİ

    
    
  
 }

Custom parts and enclosures

app inventor apk
arduinoslider2_dxxyKBsRDa.apk

Comments

Similar projects you might like

Arduino Bluetooth Car Control

by TayfMavi

  • 5,599 views
  • 1 comment
  • 11 respects

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 11,981 views
  • 1 comment
  • 11 respects

Control Arduino Uno Using ESP8266 WiFi Module and Blynk App

Project tutorial by Adithya TG

  • 5,752 views
  • 10 comments
  • 21 respects

Robotic Car Controlled over Bluetooth by Andriod Phone

Project showcase by S.Ranjith Reddy

  • 4,598 views
  • 0 comments
  • 9 respects

Bluetooth Controlled Car

Project in progress by samanfern

  • 4,783 views
  • 16 comments
  • 34 respects

Hacking A RC Car To Control It Using An Android Device

Project tutorial by MJRoBot

  • 21,107 views
  • 0 comments
  • 39 respects
Add projectSign up / Login