Dithira Hettiarachchi
Published © GPL3+

Bluetooth Car

Smartphone controlled 4WD Bluetooth Car

IntermediateProtip10,099
Bluetooth Car

Things used in this project

Hardware components

HC-06 Bluetooth Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
4wd robot car chassi
×1
L298D motor driver
×1
LED (generic)
LED (generic)
×1
Arduino UNO
Arduino UNO
×1
18650 battery
×2
Slide Switch
Slide Switch
×1

Software apps and online services

arduino car

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Schematics

bluetooth car diagram

Code

car code

Arduino
char t;
 long g=1000;
void setup() {
pinMode(13,OUTPUT);   //left motors forward
pinMode(12,OUTPUT);   //left motors reverse
pinMode(11,OUTPUT);   //right motors forward
pinMode(10,OUTPUT);   //right motors reverse
pinMode(9,OUTPUT);//Led
pinMode(8,OUTPUT);//BACK LIGHT
Serial.begin(9600);
 
}
 
void loop() {
if(Serial.available()){
  t = Serial.read();
  Serial.println(t);
}
 
if(t == 'F'){            //move forward(all motors rotate in forward direction)
  digitalWrite(13,HIGH);
  digitalWrite(11,HIGH);
}
 
else if(t == 'B'){      //move reverse (all motors rotate in reverse direction)
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
  
}
 
else if(t == 'L'){      //turn right (left side motors rotate in forward direction,)
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(9,HIGH);



   
}
 
else if(t == 'R'){      //turn left (right side motors rotate in forward direction, )
  digitalWrite(13,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(9,HIGH);

}

else if(t == 'W'){    //turn led on or off)
  digitalWrite(9,HIGH);
  
}
else if(t == 'w'){
  digitalWrite(9,LOW);

}
else if(t=='w'){
  digitalWrite(8,HIGH); //turn back led on
}
else if(t=='w'){
  digitalWrite(8,LOW);
}
else if(t=='M'){
  digitalWrite(8,HIGH);
  
}
else if(t=='m'){
  digitalWrite(8,LOW);
  
}

else if(t == 'S'){      //STOP (all motors stop)
  digitalWrite(13,LOW);
  digitalWrite(12,LOW);
  digitalWrite(11,LOW);
  digitalWrite(10,LOW);
  digitalWrite(9,LOW);
  digitalWrite(8,LOW);
}
delay(100);
}

Credits

Dithira Hettiarachchi

Dithira Hettiarachchi

7 projects • 5 followers
Python Cooking Web3

Comments