Hey There!!
I just completed making my new project which is a Android controlled Robot car
“Android controlled” made this robot very attractive
So without wasting any time let me tell you how I made this
Parts I used
- Arduino UNO
- 2x Dc geared motors
- Bluetooth module
- Car chassis
- 2xtires
- Breadboard
- Jumper wires
- Motor driver <L298N>
- Battery
- Android Phone
- Double sided tape <if you want>
Connection:
The Main Part CODE:
Upload the code to Arduino:
int M1A = 5;
int M1B = 6;
int M2A = 10;
int M2B = 11;
int spe = 255;
int rev = ‘g’;
void setup() {
Serial.begin(9600);
pinMode(M2A, OUTPUT);
pinMode(M2B, OUTPUT);
pinMode(M1A, OUTPUT);
pinMode(M1B, OUTPUT);
}
void loop() {
if(Serial.available()>0){
rev = Serial.read();
}
if(rev==’a’){ // Forward
Serial.println(rev);
analogWrite(M2B, 0);
analogWrite(M1B, 0);
analogWrite(M2A, spe);
analogWrite(M1A, spe);
}
if(rev==’d’){ // right
Serial.println(rev);
analogWrite(M2B, spe);
analogWrite(M1B, 0);
analogWrite(M2A, 0);
analogWrite(M1A, spe);
}
if(rev==’c’){ // Stop
Serial.println(rev);
analogWrite(M2B, 0);
analogWrite(M1B, 0);
analogWrite(M2A, 0);
analogWrite(M1A, 0);
}
if(rev==’b’){ // left
Serial.println(rev);
analogWrite(M2B, 0);
analogWrite(M1B, spe);
analogWrite(M1A, 0);
analogWrite(M2A, spe);
}
if(rev==’e’){ // Reverse
Serial.println(rev);
analogWrite(M2A, 0);
analogWrite(M1A, 0);
analogWrite(M2B, spe);
analogWrite(M1B, spe);
}
if (rev ==’f’){
}
if (rev==’g’){
}
}
Download the app
Arduino Bluetooth controller
After downloading Open the app ad connect to your robot and configure the buttons
For Forward: a
For Right: d
For Stop: c
For left: b
For reverse: e
Have a look at my car