Professional Documents
Culture Documents
Section: B
Group Members
13-EE (E&T)-011
Haroon Jamal
13-EE (E&T)-016
13-EE (E&T)-104
Submitted to
Introduction:
RC cars are often controlled by specific radio frequencies. Rarely any toy cars are
available in market that can be controlled by modern technologies i.e. Wi-Fi, Bluetooth etc.
Using such technologies can widen the scope and use of such car and can be controlled at a
lot of platforms.
Our objective was to convert an RC car into a Bluetooth controlled car so that we can
use other platforms to control the car i.e mobiles, tablets, PCs etc. Our target involved the
following processes:
1) Designing and sketching of functions of car
2) Developing and Android app for bluetooth control
3) Establishing connections of car with Arduino MEGA 2560.
At the end, we were successfully able to implement our idea and run the RC car with
our required control and platform.
Components:
1)
2)
3)
4)
5)
6)
7)
8)
9)
Working of Car:
We used http://ai2.appinventor.mit.edu/, a developer platform provided by MIT
University to develop Android apps. We used the following platform inorder to develop our
own app with the functionalities we require.
The app consists of several buttons which are used to control the motor, lights and
horn of the car. Each button, when pressed generates a numerical value which is sent to
Bluetooth module via the app. Arduino receives the value and correspondingly performs the
respective action assigned with the numerical value. Similarly all the functions of car have
been controlled by this simple method.
Code:
int blight=A1;
int rlight=A2;
int lind=A4;
int rind=A5;
int revlight=A9;
int frolight=A10;
int baclight=A12;
int dimmer=A13;
int horn=A7;
int forward=50;
int reverse=51;
int right=46;
int left=47;
int c;
int a;
//duration of tone
int freq = 0;
void setup()
{
Serial.begin(9600);
//setting data rate 9600 bits per second for serial communication
pinMode(blight, OUTPUT);
pinMode(rlight, OUTPUT);
pinMode(lind, OUTPUT);
pinMode(rind, OUTPUT);
pinMode(dimmer, OUTPUT);
pinMode(horn, OUTPUT);
void loop()
{
a=0;
//initializing value of a.
if (Serial.available())
{
c = Serial.read();
if( c == 0)
{
digitalWrite(forward,HIGH); //move car forward
digitalWrite(reverse,LOW);
}
else if( c == 1)
{
digitalWrite(lind,HIGH);
delay(400);
//delay of 400 ms
digitalWrite(lind,LOW);
delay(400);
digitalWrite(right,LOW);
digitalWrite(rind,LOW);
}
else if( c == 5)
{
digitalWrite(left,LOW);
digitalWrite(lind,LOW);
digitalWrite(right,LOW);
digitalWrite(rind,LOW);
}
else if( c == 6)
{
digitalWrite(right,HIGH);
digitalWrite(rind,HIGH);
delay(400);
//delay of 400ms
digitalWrite(rind,LOW);
delay(400);
digitalWrite(left,LOW);
digitalWrite(lind,LOW);
}
else if( c == 7)
{
digitalWrite(left,LOW);
digitalWrite(lind,LOW);
digitalWrite(right,LOW);
digitalWrite(rind,LOW);
}
else if(c == 8)
{
while(a<5)
//number of loops
{
digitalWrite(blight,HIGH); //turn on bluelights
delay(50);
//delay of 50ms
//delay of 300ms
a++;
}
}
else if(c == 9)
{
digitalWrite(blight,LOW);
digitalWrite(rlight,LOW);
//turn on bluelights
}
else if(c == 10)
{
for (freq = 150; freq < 1800; freq += 1) //turn siren on
{
tone(horn, freq, time);
delay(1);
//horn pin,frequency,duration
//delay of 1ms
}
for (freq = 1800; freq > 150; freq -= 1)
{
tone(horn, freq, time);
delay(1);
}
}
else if(c == 11)
{
digitalWrite(horn,LOW);
}
else if( c == 12)
{
while(a<5)
{
digitalWrite(lind,HIGH);
digitalWrite(rind,HIGH);
delay(400);
//delay of 400ms
digitalWrite(lind,LOW);
digitalWrite(rind,LOW);
delay(400);
a++;
}
}
else if(c == 13)
{
digitalWrite(lind,LOW);
digitalWrite(rind,LOW);
}
else if(c == 16)
{
digitalWrite(frolight,HIGH); //turn on front lights
digitalWrite(baclight,HIGH); //turn on back lights
}
else if(c == 17)
{
digitalWrite(frolight,LOW);
digitalWrite(baclight,LOW);
}
else if(c == 14)
{
digitalWrite(horn,HIGH);
}
else if(c == 15)
{
digitalWrite(horn,LOW);
}
else if(c == 18)
{
digitalWrite(dimmer,HIGH);
}
else if(c == 19)
{
digitalWrite(dimmer,LOW);
}
}
}
Improvements:
1) Wi-Fi Shield can be used instead of Bluetooth inorder to extend the operation range of
the car.
2) Further refining and improvement in the app and code can make the functions of car
much more realistic.
3) A high power battery can be used and its safety circuit too, in order to fulfill the power
requirements of car, as the car needs so much power to run.