Arduino Bluetooth Control RC Car

Arduino Bluetooth Control RC Car © GPL3+

Control rc cars with smartphones using Arduino and Bluetooth module

  • 567 views
  • 0 comments
  • 0 respects

Components and supplies

About this project

This work is the completion work of Bongilchoen High School Fab Lab academy.

We have to make something for assignment with Laser cutter or 3D printer. After distress , we decide to make RC car. This works by Arduino. We figured out how to make a rc car and decided to use two motors and a l239d motor ic. So we created a circuit diagram, coded it, constructed a basic operation mechanism, and ran the frame with a laser cutter. , The output was insufficient, so that 4 AA batteries were connected and an additional 6v was supplied I also wanted to add a led light function, but I did not add it off the clock (there is a trace in the source code)

Code

RC carArduino
It is RC car
#include<SoftwareSerial.h>
 
SoftwareSerial BT(2,3);
char innum;
int motSpeedPin=9;
int rightMotA=5;
int rightMotB=6;
int leftMotA=7;
int leftMotB=8;
int headLedRight=9;
int headLedLeft=10;
int motSpeed=255;
int ledPower=0;
 
void chanhololicon(char innum);
 
void setup()
{
  Serial.begin(9600);
  BT.begin(9600);
}
 
void loop()
{
  if(Serial.available())
  {
    innum=Serial.read();
    Serial.println("OK.");
    chanhololicon(innum);
  }
}
 
void chanhololicon(char innum)
{
   if(innum=='a')//Go forward
 {
  digitalWrite(rightMotA,HIGH);
  digitalWrite(rightMotB,LOW);
  digitalWrite(leftMotA,HIGH);
  digitalWrite(leftMotB,LOW);
 }
 else if(innum=='b')//back
 {
  digitalWrite(rightMotA,LOW);
  digitalWrite(rightMotB,HIGH);
  digitalWrite(leftMotA,LOW);
  digitalWrite(leftMotB,HIGH);
 }
 else if(innum=='c')//right
 {
  digitalWrite(rightMotA,HIGH);
  digitalWrite(rightMotB,LOW);
  digitalWrite(leftMotA,LOW);
  digitalWrite(leftMotB,HIGH);
 }
 else if(innum=='d')//left
 {
  digitalWrite(rightMotA,LOW);
  digitalWrite(rightMotB,HIGH);
  digitalWrite(leftMotA,HIGH);
  digitalWrite(leftMotB,HIGH);
 }
 else if(innum=='e')//stop
 {
  digitalWrite(rightMotA,LOW);
  digitalWrite(rightMotB,LOW);
  digitalWrite(leftMotA,LOW);
  digitalWrite(leftMotB,LOW);
 }
 else if(innum=='f'&&ledPower==0)//headled(on)
 {
  digitalWrite(headLedRight,HIGH);
  digitalWrite(headLedLeft,HIGH);
  ledPower++;
 }
 else if(innum=='f'&&ledPower==1)//headled(off)
 {
  digitalWrite(headLedRight,LOW);
  digitalWrite(headLedLeft,LOW);
  ledPower--;
 }
 else if(ledPower>1&&ledPower<0)
 {
  ledPower=0;
 }
 }

Schematics

Arduino bluetooth rc car Circuit diagram
Arduino bluetooth rc car Circuit diagram
Untitled sketch bb blhzgldxyo

Comments

Add projectSign up / Login