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.

  • 10,727 views
  • 10 comments
  • 48 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

  • 14,398 views
  • 3 comments
  • 22 respects

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 20,684 views
  • 2 comments
  • 25 respects

Bluetooth Control RC Car

Project tutorial by electronicprojects

  • 3,359 views
  • 2 comments
  • 15 respects

Control Arduino Uno Using ESP8266 WiFi Module and Blynk App

Project tutorial by Adithya TG

  • 48,918 views
  • 14 comments
  • 46 respects

Bluetooth Controlled Car

Project in progress by Saman Fernando

  • 177,703 views
  • 113 comments
  • 147 respects

Robotic Car controlledover Bluetooth with Obstacle Avoidance

Project showcase by S.Ranjith Reddy

  • 14,558 views
  • 8 comments
  • 25 respects
Add projectSign up / Login