Project showcase
Bluetooth-Controlled Car

Bluetooth-Controlled Car © GPL3+

How to make a Bluetooth-controlled car.

  • 2,843 views
  • 1 comment
  • 8 respects

Components and supplies

About this project

Hi.

I am making a Bluetooth-controlled robot using Arduino Uno and a shield made by me. The app for the robot I have made using MIT App Inventor and you can find the app in MIT App Inventor 2 gallery under the name "robogear". These two videos will show you things step by step.

Code

BLUETOOTH CONTROL CAR CODEC/C++
ARDUINO CODE FOR BLUETOOTH CONTROL CODE
#define LMP  2
#define LMN  4
#define RMP  7
#define RMN  5


int firstSensor = 0;         // first analog sensor
int secondSensor = 0;    // second analog sensor
int thirdSensor = 0;        // digital sensor
int inByte = 0;               // incoming serial byte
char BYTE;
boolean status_unlock;
boolean status_bluetooth;

long interval = 1000;           // interval at which to blink (milliseconds)
long previousMillis = 0;        // will store last time LED was update
int minite,sec;


void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
  //pinMode(2, INPUT);   // digital sensor is on digital pin 2
  establishContact();    // send a byte to establish contact until receiver responds 
  
  pinMode(LMP, OUTPUT);
  pinMode(LMN, OUTPUT);
  pinMode(RMP, OUTPUT);
  pinMode(RMN, OUTPUT);


  
  digitalWrite(LMP, LOW);  // switch off MOTOR
  digitalWrite(LMN, LOW);  // switch off MOTOR
  digitalWrite(RMP, LOW);  // switch off MOTOR
  digitalWrite(RMN, LOW);  // switch off MOTOR
    

  status_bluetooth = true;
  status_unlock = false;
  sec = 0;
}

void loop()
{
  if (Serial.available() > 0)
  {   
       
    inByte = Serial.read();                      // get incoming byte:  

 if(inByte == 'A')
    {    
      digitalWrite(LMP, HIGH);         
      digitalWrite(LMN, LOW);
      digitalWrite(RMP, HIGH);
      digitalWrite(RMN, LOW);
            
      inByte = 0;     
    }    
   
    if(inByte == 'B')
    {    
      digitalWrite(LMP, LOW);         
      digitalWrite(LMN, HIGH);
      digitalWrite(RMP, LOW);
      digitalWrite(RMN, HIGH);
    
                      
      inByte = 0;     
    }
        
    if(inByte == 'D')
    {    
       digitalWrite(LMP, HIGH);         
      digitalWrite(LMN, LOW);
      digitalWrite(RMP, LOW);
      digitalWrite(RMN, LOW);
          
      inByte = 0;     
    }
    
   if(inByte == 'C')
    {    
      digitalWrite(LMP, LOW);         
      digitalWrite(LMN, LOW);
      digitalWrite(RMP, HIGH);
      digitalWrite(RMN, LOW);
    
      Serial.print('D', BYTE);                  
      inByte = 0;     
    }
       
    if(inByte == 'E')
    {    
      digitalWrite(LMP, LOW);         
      digitalWrite(LMN, LOW);
      digitalWrite(RMP, LOW);
      digitalWrite(RMN, LOW);
    
     
      Serial.print('E', BYTE);                   
      inByte = 0;     
    }
    
  if(inByte == 'G')
    {    
     digitalWrite(LMP, HIGH);         
      digitalWrite(LMN, LOW);
      digitalWrite(RMP, LOW);
      digitalWrite(RMN, HIGH);
        
      inByte = 0;     
    }
    
    if(inByte == 'F'){    
       digitalWrite(LMP, LOW);         
      digitalWrite(LMN, HIGH);
      digitalWrite(RMP, HIGH);
      digitalWrite(RMN, LOW);
     
      
      Serial.print('G', BYTE);  
      inByte = 0;     
    }
    
  
    
    if(inByte == 'S'){    
      
      Serial.print('S', BYTE);                  // send a char
      status_bluetooth = true;
      sec = 0;
          
    }    
  } // if(Serial
  
  /*
  unsigned long currentMillis = millis();
      
              if(currentMillis - previousMillis > interval) {            
                previousMillis = currentMillis;         // save the last time you blinked the LED 
                
                sec++;
                
                if(status_unlock==true){
                
                  if(sec== 11){
                
                      digitalWrite(LED_PIN1, HIGH);        // switch on LED
                
                      delay(800);
                      digitalWrite(LED_PIN1, LOW);        // switch off LED
                
                      status_unlock = false;                  
                      sec = 0;
                  }
                }
                else sec = 0;                
                
              }
  
 */ 
    
} //Loop

void establishContact() {
  while (Serial.available() <= 0) {
    Serial.print('.', BYTE);                   // send a capital A
    delay(500);
  }
}

Schematics

circuit design of bluetooth control car
its all about schematic diagram of connecting arduino + l293d + hc 05 with a robot car
Fritzing j045vsxmie

Comments

Similar projects you might like

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 11,972 views
  • 1 comment
  • 11 respects

Bluetooth-Controlled Car

Project tutorial by Yogeshmodi

  • 27,966 views
  • 3 comments
  • 39 respects

RC Car to BT Car Controlled with Blynk

Project tutorial by Team Daxes Hacks

  • 3,612 views
  • 2 comments
  • 6 respects

Voice Controlled Car

Project tutorial by Yug_Ajmera

  • 5,090 views
  • 0 comments
  • 9 respects

Fabrizzio and Casey Arduino Car

Project showcase by Fabrizzio and Casey's Robot Cars

  • 1,586 views
  • 0 comments
  • 2 respects

Android controlled robot car

Project showcase by Isara Naranirattisai

  • 8,112 views
  • 2 comments
  • 13 respects
Add projectSign up / Login