Paul Vincent Bezzina
Published © GPL3+

Bluetooth Arduino Car Project [V2]

My Journey of making a Bluetooth controlled RC car

BeginnerShowcase (no instructions)8 hours167
Bluetooth Arduino Car Project [V2]

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
DC Motor, 12 V
DC Motor, 12 V
×4
DC Motor Wheels
×4
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×4
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×4
Through Hole Resistor, 270 ohm
Through Hole Resistor, 270 ohm
×4

Software apps and online services

Arduino IDE
Arduino IDE
Fusion
Autodesk Fusion

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Overall Circuit

Code

Receiver Code

Arduino
Code to interpret Bluetooth signals sent by application
#include <SoftwareSerial.h>
#include <Servo.h>

SoftwareSerial Bluetooth(10, 11); // RX, TX

int Data; // the data received
int motorPinRB = 5;
int motorPinRT = 8;
int motorPinLB = 13;
int motorPinLT = 9;
int servopin = 12;

Servo myservo; 

void setup() {

   myservo.attach(servopin);
   
   Bluetooth.begin(9600);
   Serial.begin(9600);

   pinMode(motorPinRB, OUTPUT);
   pinMode(motorPinRT, OUTPUT);
   pinMode(motorPinLB, OUTPUT);
   pinMode(motorPinLT, OUTPUT);
      
}

void loop() {
  
Serial.println(Data);

if (Bluetooth.available()) {
Data= Bluetooth.read();

if (Data == 83) {
  analogWrite(motorPinRB, 0);
  analogWrite(motorPinRT, 0);
   analogWrite(motorPinLB, 0);
    analogWrite(motorPinLT, 0);

     myservo.write(92);
 
  }
    
if (Data == 70){// Straight
  
analogWrite(motorPinRB, 255);
  analogWrite(motorPinRT, 255);
   analogWrite(motorPinLB, 255);
    analogWrite(motorPinLT, 255);

    myservo.write(100);     
       
  }
  
  } else if (Data == 76) { // Left
    
 analogWrite(motorPinRB, 255);
  analogWrite(motorPinRT, 255);
   analogWrite(motorPinLB, 255);
    analogWrite(motorPinLT, 255);
     myservo.write(260);  
 
     
  }  else if (Data == 82) { // Right
    
 analogWrite(motorPinRB, 255);
  analogWrite(motorPinRT, 255);
   analogWrite(motorPinLB, 255);
    analogWrite(motorPinLT, 255);
     myservo.write(55);    
     
  } 

}

Credits

Paul Vincent Bezzina
5 projects • 7 followers
Aspiring electronics enthusiast and sixth form student. Always eager to learn and experiment with new technologies and hands-on creations.
Contact

Comments

Please log in or sign up to comment.