How to build a Bluetooth Controlled Automobile

SUPPLIES AND PARTS

  • Arduino UNO
  • HC-05 Bluetooth Module
  • SparkFun Dual H-Bridge motor drivers L298
  • Pimoroni Maker Essentials – Micro-motors & Grippy Wheels
  • Jumper wires (generic)
  • Li-Ion Battery 1000mAh
  • LED (generic)

CONTENT AND ONLINE SERVICES

Arduino Bluetooth RC Car

Assembly

I wanted to build and test it as soon as I had all the pieces. However, a chassis was missing. I searched the area and discovered a DVD case. Although it’s not the ideal option, for the moment it works. I attached 4 motors to the chassis using cable ties. I utilised a rechargeable 7.4V 1800mAh Li-ion battery from a walkie-talkie as the power source.

Code

char t;
 
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
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, right side motors doesn't rotate)
  digitalWrite(11,HIGH);
}
 
else if(t == 'R'){      //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)
  digitalWrite(13,HIGH);
}

else if(t == 'W'){    //turn led on or off)
  digitalWrite(9,HIGH);
}
else if(t == 'w'){
  digitalWrite(9,LOW);
}
 
else if(t == 'S'){      //STOP (all motors stop)
  digitalWrite(13,LOW);
  digitalWrite(12,LOW);
  digitalWrite(11,LOW);
  digitalWrite(10,LOW);
}
delay(100);
}

Schematics

A calm person can achieve anything

KP

“Be the pure soul, Everything else will come after you” – KP

Be a good listener

KP

Helping Hands.

About the author

pondabrothers

You can download our apps and books for free..
Search - Incognito Inventions

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *