Project showcase
Arduino RC Car with I2C Display!

Arduino RC Car with I2C Display! © CC BY

An Arduino Rc Car but it has LCD i2c for sending messages and debugging.

  • 8 views
  • 0 comments
  • 0 respects

Components and supplies

Apps and online services

About this project

It's all started when I got my HC-06 BT module and I wanted to make a useful project with it, first I was about to make an bus then a smart speaker but finally I found that RC car is the most useful project with the HC-06.

I found some RC cars on the web and I didn't want to remake other creations, I wanted my own unique project so I added an I2C display (which uses less cables than the regular by the way) and some optimizations like two 9V rechargeable batteries so I don't buy a lot of them, one battery for the motors and one for Arduino, which was surprisingly great. That's it!

Code

RC Car's CodeArduino
That's the code guys
#include <LiquidCrystal_I2C.h>

#include "SoftwareSerial.h"// import the serial library\

const int IN1=3;
const int IN2=5;
const int IN3=6;
const int IN4=9;
 int BluetoothData;
 SoftwareSerial HC05(10, 11); // RX, TX
 LiquidCrystal_I2C lcd(0x27, 16, 2);
 int  SPEED_Control=200;
void setup() {
  // fIRST , define the Motor's pin as an OUTPUT
lcd.begin();
lcd.backlight();
pinMode( IN1 ,OUTPUT);// Right Motor 1st wire
pinMode( IN2 ,OUTPUT);// Right Motor 2nd wire
pinMode( IN3 ,OUTPUT);// left Motor 1st wire
pinMode( IN4 ,OUTPUT);// left Motor 2nd wire
 HC05.begin(9600);
 lcd.clear();
 lcd.print("Starting");
}
void FORWARD(int Speed){
  //When we want to let Motor To Rotate clock wise
  // just void this part on the loop section .
  lcd.clear();
  lcd.print("FORWARD");
  analogWrite(IN1,0);
  analogWrite(IN2,Speed);
  analogWrite(IN3,Speed);
  analogWrite(IN4,0);
}
void BACKWARD(int Speed){
  //When we want to let Motor To Rotate Counter clock wise
  // just void this part on the loop section .
  lcd.clear();
  lcd.print("BACKWARD");
  analogWrite(IN1,Speed);
  analogWrite(IN2,0);
  analogWrite(IN3,0);
  analogWrite(IN4,Speed);
}
void LEFT(int Speed){
  //When we want to let Motor To Rotate Counter clock wise
  // just void this part on the loop section .
  lcd.clear();
  lcd.print("LEFT");
  analogWrite(IN1,0);
  analogWrite(IN2,Speed);
  analogWrite(IN3,0);
  analogWrite(IN4,Speed);
}
void RIGHT(int Speed){
  //When we want to let Motor To Rotate Counter clock wise
  // just void this part on the loop section .
  lcd.clear();
  lcd.print("RIGHT");
  analogWrite(IN1,Speed);
  analogWrite(IN2,0);
  analogWrite(IN3,Speed);
  analogWrite(IN4,0);
}

void Stop(){
  //When we want to let Motor To Rotate clock wise
  // just void this part on the loop section .
  analogWrite(IN1,0);
  analogWrite(IN2,0);
  analogWrite(IN3,0);
  analogWrite(IN4,0);
}

void loop() {
 //Rise Up

  if (HC05.available()){
 BluetoothData=HC05.read();
 Serial.println(BluetoothData);
   
  if(BluetoothData=='F'){   // if number 1 pressed .... 
   FORWARD(SPEED_Control);
   }
  if(BluetoothData=='B'){   // if number 1 pressed .... 
  BACKWARD(SPEED_Control);
   }
  if(BluetoothData=='L'){   // if number 1 pressed .... 
  RIGHT(SPEED_Control);
 
   }
  if(BluetoothData=='R'){   // if number 1 pressed ....
   LEFT(SPEED_Control);
   }
    if(BluetoothData=='S'){   // if number 1 pressed ....
  Stop();
   }
   if(BluetoothData=='0'){  SPEED_Control=0 ;}//Speed 
   if(BluetoothData=='1'){  SPEED_Control=50; }//Speed 
   if(BluetoothData=='2'){  SPEED_Control=100; }//Speed 
   if(BluetoothData=='3'){  SPEED_Control=120; }//Speed 
   if(BluetoothData=='4'){  SPEED_Control=140; }//Speed 
   if(BluetoothData=='5'){  SPEED_Control=160; }//Speed 
   if(BluetoothData=='6'){  SPEED_Control=180; }//Speed 
   if(BluetoothData=='7'){  SPEED_Control=200; }//Speed 
   if(BluetoothData=='8'){  SPEED_Control=220; }//Speed 
   if(BluetoothData=='9'){  SPEED_Control=240; }//Speed 
   if(BluetoothData=='q'){  SPEED_Control=255; }//Speed   
  }
}

Schematics

Schematic
Made using Fritzing
Untitled sketch bb xh0hcsql4x

Comments

Similar projects you might like

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 16,522 views
  • 2 comments
  • 20 respects

Arduino 4WD RC Car

Project tutorial by Andriy Baranov

  • 23,386 views
  • 7 comments
  • 64 respects

Android Arduino RC Car

Project tutorial by RAFI RASHEED T C

  • 20,367 views
  • 3 comments
  • 41 respects

RC Car to BT Car Controlled with Blynk

Project tutorial by Daxes Hacks

  • 6,136 views
  • 2 comments
  • 7 respects

Biometric Car Entry - True Keyless Car

Project showcase by Rajeev Velikkal

  • 7,134 views
  • 9 comments
  • 41 respects
Add projectSign up / Login