Project showcase
Bluetooth Mini Car

Bluetooth Mini Car © TAPR-OHL

A toy car controlled by mobile.

  • 9,576 views
  • 2 comments
  • 34 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

Its a simple project for beginners that you can do at home, but it cant be your first project because you have to be a little familiar with the Arduino scripting. 

The car is moving by two dc motors and turn by setting one motor forward and the other one backward. 

That's how my car is organised :

Note : Each battery of these is 4v and 700 mAh and its better to put them in series to get a higher voltage.

It's much butter if you solder the cables in the battery and the motors to get the 100% conductivity.

And please if you have any questions don't hesitate to ask.

Code

Bluetooth 2WD carArduino
This code is compatible with any serial Bluetooth app like "Bluetooth terminal" or you can create your own app using "appinventor.mit.edu" or simply test it with or without bluetooth module using the serial monitor.
char junk;
String inputString="";
long time = 0; 
int state = HIGH;
int frontled = 7;
int frontled2 = 3;
int buzzer = 4;

void setup()                    // run once, when the sketch starts
{
 Serial.begin(9600);     
 pinMode(3, OUTPUT);
 pinMode(buzzer, OUTPUT);
 pinMode(redled, OUTPUT);
 pinMode(redled2, OUTPUT);
 pinMode(12, OUTPUT); 
 pinMode(9, OUTPUT);
 pinMode(13, OUTPUT);
 pinMode(11, OUTPUT); 
 pinMode(8, OUTPUT); 
 pinMode(frontled, OUTPUT);
 pinMode(frontled2, OUTPUT); 
}

void loop()
{
  if(Serial.available()){
  while(Serial.available())
    {
      char inChar = (char)Serial.read(); //read the input
      inputString += inChar; //make a string of the characters coming on  serial
    }
    Serial.println(inputString);
    while (Serial.available() > 0)  
    { 
    junk = Serial.read() ; 
    }      // clear the serial buffer
    if(inputString == "a"){         //in case of 'a' turn the LED on
      if (state == HIGH)
      state = LOW;
    else
      state = HIGH;

    time = millis();    

    digitalWrite(frontled, state);
    digitalWrite(frontled2, state);
    }
    else if(inputString == "f"){   //incase of 'f'= forward
      digitalWrite(12, HIGH); //Establishes forward direction of Channel A
      digitalWrite(9, LOW);   //Disengage the Brake for Channel A
      analogWrite(3, 255);   //Spins the motor on Channel A at full speed
      digitalWrite(13, HIGH); //Establishes forward direction of Channel B
      digitalWrite(8, LOW);   //Disengage the Brake for Channel B
      analogWrite(11, 255);   //Spins the motor on Channel B at full speed
    }
    else if(inputString == "b"){  //incase of 'b'= brakes
      digitalWrite(9, HIGH);  //Engage brakes for channel A
      digitalWrite(8, HIGH);  //Engage brakes for channel A
    }
    else if(inputString == "l"){  //incase of 'l'= left
      digitalWrite(12, HIGH); //Establishes forward direction of Channel A
      digitalWrite(9, LOW);   //Disengage the Brake for Channel A
      analogWrite(3, 100);   //Spins the motor on Channel A at half speed
      digitalWrite(13, LOW); //Establishes backward direction of Channel B
      digitalWrite(8, LOW);   //Disengage the Brake for Channel B
      analogWrite(11, 100);   //Spins the motor on Channel B at half speed
    }
    else if(inputString == "r"){  //incase of 'r'= right
      digitalWrite(12, LOW); //Establishes backward direction of Channel A
      digitalWrite(9, LOW);   //Disengage the Brake for Channel A
      analogWrite(3, 100);   //Spins the motor on Channel A at half speed
      digitalWrite(13, HIGH); //Establishes forward direction of Channel B
      digitalWrite(8, LOW);   //Disengage the Brake for Channel B
      analogWrite(11, 100);   //Spins the motor on Channel B at half speed
    }
    else if(inputString == "w"){   //incase of 'w'= backward
      digitalWrite(12, LOW); //Establishes backward direction of Channel A
      digitalWrite(9, LOW);   //Disengage the Brake for Channel A
      analogWrite(3, 255);   //Spins the motor on Channel A at full speed
      digitalWrite(13, LOW); //Establishes backward direction of Channel B
      digitalWrite(8, LOW);   //Disengage the Brake for Channel B
      analogWrite(11, 255);   //Spins the motor on Channel B at full speed
    }
    inputString = ""; //we clear the variable for the next commande
  }
}

Schematics

Screenshot%202016-02-21%2019.38.55%20(2).png
Screenshot%202016 02 21%2019.38.55%20(2)

Comments

Similar projects you might like

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 11,971 views
  • 1 comment
  • 11 respects

Robotic Car controlledover Bluetooth with Obstacle Avoidance

Project showcase by S.Ranjith Reddy

  • 9,589 views
  • 5 comments
  • 17 respects

Robotic Car Controlled over Bluetooth by Andriod Phone

Project showcase by S.Ranjith Reddy

  • 4,430 views
  • 0 comments
  • 9 respects

Bluetooth Controlled Car

Project tutorial by JANAK13

  • 2,284 views
  • 7 comments
  • 15 respects

Bluetooth Controlled Car

Project in progress by samanfern

  • 4,132 views
  • 16 comments
  • 31 respects

Bluetooth Controlled Light Switch

Project showcase by Team The Instrumentation Crustaceans

  • 23,402 views
  • 4 comments
  • 26 respects
Add projectSign up / Login