Introduction: Simple RC Car for Beginners (Android Control Over Bluetooth)

Picture of Simple RC Car for Beginners (Android Control Over Bluetooth)

This is a simple project of Android Bluetooth Car with Bluetooth control. Arduino controller is used

To control the car used Android-device with a built-in accelerometer. Tilt forward - car goes forward, tilt to the left - car turns to the left, tilt back - car goes back. Speed of movement or rotation depends on how much you tilt the device. Sensitivity and value of the tilt set in the configuration Android-apps. Also are provided a normal way to control: the buttons on the screen. In addition to all I implemented the touch control. Total 3 ways to control the RC Car.

Capabilities of the device you can see on the video above

Step 1: Android Device

Picture of Android Device

Parts needed

1. Android device

The most important part - Android device with accelerometer and Bluetooth: tablet, smartphone and other... As an Android device, I used a cheap Chinese tablet "Ainol Aurora" with an external USB-Bluetooth module (because its not have own), connected via USB Host.

Step 2: DIY Car Chassis

Picture of DIY Car Chassis

2. DIY Car Chassis

We also need any chassis with 2 or 4 DC motors. You can use an old RC toy car. As a platform I used a small RC DIY platform, bought on AliExpress for 25$. It's most suitable track chassis for this project.

Step 3: Controller (MCU)

Picture of Controller (MCU)

3. Controller (MCU)

You need any Arduino-compatible controller (Nano, Uno, Leonardo, Mini and other)

The controller should contain 2 PWM and UART.

Step 4: Bluetooth Module

Picture of Bluetooth Module

4. Bluetooth module

As a Bluetooth module uses cheap Chinese module Bluetooth Serial HC-06 (3-4$ on AliExpress). Instructions guide on connecting bluetooth module to Arduino is here.
You can use HC-05, HC-07 and other serial Bluetooth modules

Step 5: Motor Driver

Picture of Motor Driver

5. Motor Driver

I used L298N Dual Bridge DC stepper Motor Driver module. It cost 3-5$ on AliExpress.

Step 6: Other Parts

Picture of Other Parts

6. Other parts

Step 7: Theory

Picture of Theory


All calculations are performed in the Android-application, and immediately calculate the values 2‹2‹of the PWM for the left and right motor. Application has flexible settings, such as the range of the PWM, the sensitivity of tilt, the minimum threshold for the PWM and other. Example commands transmitted by Bluetooth:
L - the command to the left engine, R - for the right
A dash means the motor rotation to move back
255 - PWM value (for Arduino is the maximum speed of rotation)
\r - end of command.
On this command RC car will move forward and slightly rotated to the right, as right engine rotates slowly left.

On this command the left engine will rotate back and forward right, forcing a car to rotate around its axis counterclockwise.

Command is an additional channel to which you can connect for example lights, sound, etc.

Symbols command L, R and H can be defined in the settings of Android-applications.

In the MCU control program provides a timer that shuts off the engine if the last command was received more than n-seconds ago. The data are stored in the EEPROM memory of the controller and can be changed from Android device. The range of this setting is from 0.1 seconds to 99.9 seconds. This setting can be disabled. To work with EEPROM provides commands: Fr - reading values 2‹2‹and Fw - record values.


Block diagram see on picture above

Step 8: Android Application

Picture of Android Application

As we can see, the Arduino connects to Bluetooth module and a motor driver with two or four connected motors.

Android Application

The application for Android was written in Eclipse IDE. All sources of the project and the project for Eclipse, you can download below. Android version on your device must be > 3.0.

The application contains several activity. Main activity is a home screen with buttons running different operating modes and settings

There are 3 control modes Bluetooth-car: from accelerometer, screen buttons and touch-control.

Android application settings

Screenshot of settings CxemCar Android application version 1.0

MAC address

To establish a connection with the RC Car's Bluetooth module, you must set MAC-address in the application settings. But first, you must configure the pair the devices on Android-device: open Settings -> Bluetooth and click "Search for devices". When the phone finds our Bluetooth-module, click them and enter password for pairing (usually "1234")

To know Bluetooth module MAC-address possible from any application, such as Bluetooth Terminal. To do this, click "Connect a device - Secure" and in the resulting window, click the button "Scan for devices". Software will be scans the Bluetooth devices and displays them MAC-address.

Step 9: Arduino RC Car Wiring

Picture of Arduino RC Car Wiring

Wiring diagram for Arduino controller

In the circuit I used a jumper (in the scheme Jmp1), because with a connected Bluetooth module is impossible be load sketch to the Arduino.

I soldered a Bluetooth-module to the Arduino and led status light. For communication between Arduino and Bluetooth, read this article: Arduino and Bluetooth. Module HC-06 placed in heat-shrink tube 10mm. Bluetooth-state LED with current limiting resistor (calculator) were also placed in heat-shrink tube.

In the breadboard platform, I drilled a hole and secure motor driver L298N. Arduino board attached with double-sided tape

Between the car platform and breadboard I placed 3 Li-Po battery 3.7V 1100 mAh. Power to the controller and motors separately: Arduino powered by a 3.7 V battery, and the motors and driver L298N from two 3.7V batteries connected in series. There are two 2-position power switch - one position is the power from the batteries to consumers, in the other position to charging terminals.

Beetween BT pin RX (2) and Arduino pin TX may require level shifter. For this, you can use voltage divider: calculator 5V to 3.3V

Step 10: Software

Picture of Software

The program was written in Arduino IDE 1.01.

#include "EEPROM.h"

#define D1 2 // direction of motor rotation 1
#define M1 3 // PWM left motor
#define D2 4 // direction of motor rotation 2
#define M2 5 // PWM right motor
#define HORN 13 // additional channel 1
//#define autoOFF 2500 // milliseconds after which the robot stops when the connection

#define cmdL 'L' // UART-command for left motor
#define cmdR 'R' // UART-command for right motor
#define cmdH 'H' // UART-command for additional channel (for example Horn)
#define cmdF 'F' // UART-command for EEPROM operation
#define cmdr 'r' // UART-command for EEPROM operation (read)
#define cmdw 'w' // UART-command for EEPROM operation (write)

char incomingByte; // incoming data

char L_Data[4]; // array data for left motor
byte L_index = 0; // index of array L
char R_Data[4]; // array data for right motor
byte R_index = 0; // index of array R
char H_Data[1]; // array data for additional channel
byte H_index = 0; // index of array H
char F_Data[8]; // array data for EEPROM
byte F_index = 0; // index of array F
char command; // command

unsigned long currentTime, lastTimeCommand, autoOFF;

void setup() {
Serial.begin(9600); // initialization UART
pinMode(HORN, OUTPUT); // additional channel
pinMode(D1, OUTPUT); // output for motor rotation
pinMode(D2, OUTPUT); // output for motor rotation
timer_init(); // initialization software timer

void timer_init() {
uint8_t sw_autoOFF =; // read EEPROM "is activated or not stopping the car when losing connection"
if(sw_autoOFF == '1'){ // if activated
char var_Data[3];
var_Data[0] =;
var_Data[1] =;
var_Data[2] =;
autoOFF = atoi(var_Data)*100; // variable autoOFF ms
else if(sw_autoOFF == '0'){
autoOFF = 999999;
else if(sw_autoOFF == 255){
autoOFF = 2500; // if the EEPROM is blank, dafault value is 2.5 sec
currentTime = millis(); // read the time elapsed since application start

void loop() {
if (Serial.available() > 0) { // if received UART data
incomingByte =; // raed byte
if(incomingByte == cmdL) { // if received data for left motor L
command = cmdL; // current command
memset(L_Data,0,sizeof(L_Data)); // clear array
L_index = 0; // resetting array index
else if(incomingByte == cmdR) { // if received data for left motor R
command = cmdR;
R_index = 0;
else if(incomingByte == cmdH) { // if received data for additional channel
command = cmdH;
H_index = 0;
else if(incomingByte == cmdF) { // if received data for EEPROM op
command = cmdF;
F_index = 0;
else if(incomingByte == '\r') command = 'e'; // end of line
else if(incomingByte == '\t') command = 't'; // end of line for EEPROM op

if(command == cmdL && incomingByte != cmdL){
L_Data[L_index] = incomingByte; // store each byte in the array
L_index++; // increment array index
else if(command == cmdR && incomingByte != cmdR){
R_Data[R_index] = incomingByte;
else if(command == cmdH && incomingByte != cmdH){
H_Data[H_index] = incomingByte;
else if(command == cmdF && incomingByte != cmdF){
F_Data[F_index] = incomingByte;
else if(command == 'e'){ // if we take the line end
else if(command == 't'){ // if we take the EEPROM line end
lastTimeCommand = millis(); // read the time elapsed since application start
if(millis() >= (lastTimeCommand + autoOFF)){ // compare the current timer with variable lastTimeCommand + autoOFF
Control4WD(0,0,0); // stop the car

void Control4WD(int mLeft, int mRight, uint8_t Horn){

bool directionL, directionR; // direction of motor rotation L298N
byte valueL, valueR; // PWM M1, M2 (0-255)

if(mLeft > 0){
valueL = mLeft;
directionL = 0;
else if(mLeft < 0){
valueL = 255 - abs(mLeft);
directionL = 1;
else {
directionL = 0;
valueL = 0;

if(mRight > 0){
valueR = mRight;
directionR = 0;
else if(mRight < 0){
valueR = 255 - abs(mRight);
directionR = 1;
else {
directionR = 0;
valueR = 0;

analogWrite(M1, valueL); // set speed for left motor
analogWrite(M2, valueR); // set speed for right motor
digitalWrite(D1, directionL); // set direction of left motor rotation
digitalWrite(D2, directionR); // set direction of right motor rotation

digitalWrite(HORN, Horn); // additional channel

void Flash_Op(char FCMD, uint8_t z1, uint8_t z2, uint8_t z3, uint8_t z4){

if(FCMD == cmdr){ // if EEPROM data read command
Serial.print("FData:"); // send EEPROM data
Serial.write(; // read value from the memory with 0 address and print it to UART
Serial.print("\r\n"); // mark the end of the transmission of data EEPROM
else if(FCMD == cmdw){ // if EEPROM data write command
EEPROM.write(0,z1); // z1 record to a memory with 0 address
timer_init(); // reinitialize the timer
Serial.print("FWOK\r\n"); // send a message that the data is successfully written to EEPROM

The code uses a library to work with EEPROM AVR-memory. Arduino board by USART from the Bluetooth module receives data ready for the left and right engine. All basic calculations are performed in the Android application.

The project structure in Eclipse you can see on the screenshot above.

You can download the source code for the Arduino, and the project for Eclipse
DownloadAPK application for Android-device

The latest software version can be found on this page
Video of demonstration the virtual steering wheel mode (1.2 version and above):

P.S. Sorry for my bad english


DavidB552 (author)2017-08-11

OK guys built it and it works using 7.6 volts of power for the motors which I think may be two litte I might try and up that later

I found I had a socket failed for awhile this ended up being becouse I did not have my gnd set up right.

AnkitR42 (author)2016-06-26

From where did i get diy car chassis?

DavidB552 (author)AnkitR422017-08-02

just cheak ebay

getphotos1 (author)2016-08-19

what is the range and battery time

DavidB552 (author)getphotos12017-08-02

would depend on the quality of your batteries you need to buy ones with a high mAh

AbuG4 (author)2017-01-09

Hello sir, thanks for the tutorial, all done fine and what i want to ask is : what is the real command for this project if i want to send the command from "serial monitor" (such as H = horn ON, h = horn OFF).

please reply and thanks in advance.

DavidB552 (author)AbuG42017-08-02

did you work that out in the end going to do the same

DavidB552 (author)2017-07-30

two questions im using the arduno uno r3 which pins on the ardunio am I contenting to the motor ? or rather which pins conect to Int 1,2,3,4

and could I use a switch rather then a jumper for the blue tooth ?

ShubhamG18 made it! (author)2016-01-04

i made it. at the end all you got to do is to make a parallel switching from D3 to PWM for right motor and D5 to PWM for left motor. it enables the working of both the motors.

DishantS6 (author)ShubhamG182016-06-05

what do you mean by that, you said d3 to pwm(already is on a pwm) and d5 which also is already on a pwm slot, but it still does not allow it to move the motors. plz help me bruh.

ShubhamG18 (author)DishantS62016-06-05

No boy,
Motor driver has 6 inputs. 3 for each motor. D2 and D3 goes in for left motor and D4 and D5 goes for right motor. But to enable the motors we need to give pwm connections too. So, D3 and D5 parallely moves to pwm enabler of motor driver.
Hope i helped.

MihirJ1 (author)ShubhamG182017-07-20

pls brother just send me image of wiring from l298n to arduino coz everything works but the motor doesnt move when i do in the app

DishantS6 (author)ShubhamG182016-06-06

I still don't get it,so basically the ena and enb things on the l298n connect to digital pins 3 and 5 am I correct? and if you say yes, it still doesn't work, srry for being a noob but i really want to understand this.

ShubhamG18 (author)DishantS62016-06-06

haha yeah! its alright.

yep i meant the same, the thing you said. in what other way can i explain it to you? :P

DishantS6 (author)ShubhamG182016-06-17

yo dude, so i read some things about l298n, basically there are 6 inputs, 2 are pwm and 4 are direction control, but in the diagram shown above there are only 4 pins being used, i did what you said, i took out what d3 was connected to and put d3 on ena and put d5 on enb, still using 4 wires, but still not working, i need help, i really need this build to work.

DishantS6 (author)ShubhamG182016-06-15

alright man, listen, i put ena to digital pin 5 and enb on digital pin 3, it does not work, because earlier, i had used the 4 inputs in the diagram, so i disconnect the ones which were to in2 and in4, could u send me a detailed version of where the wires go from arduino to l298n please, or could u use an app called fritzing to make a diagram and send it to me via gmail, my gmail is

MatiasS21 (author)ShubhamG182016-03-20

did you mean the program or wires

tmihai1 (author)2017-06-27

Can somebody send here the links for those components on aliexpress? I can't find some products and I hope i'll not buy other things.

AnkitS228 (author)2017-03-06

I qm unable to comple the code can u please provide me compiled code at

abdul hai (author)2016-06-04

Okay so I tried what you said to do, but still keep getting socket fail, whenever I try it on my phone

DishantS6 (author)abdul hai2016-06-05

you can use an app called ardudroid on the playstore to get the mac address so it can remove that socket fail, go open ardudroid and click connect me to a blutooth device and if your blutooth module is on then you should see the mac address of it, copy it down and go back to cxem car and enter the mac address, and it should work.

mayur43 (author)DishantS62017-02-28

Sir im using l298n plz send me codes at

AdityaT32 (author)DishantS62016-08-06

its not working for me. device turn on by showing orange led in aurdino getting in, and it moves a bit too, but after that it always says socket failed. please help

DishantS6 (author)AdityaT322016-08-07

Yea um this is me DishantS6 and I found a very easy way of making this car work, go to a youtube video from a guy called ICT tools for teachers and search up the rc car blutooth thing, and if you are using L298n motor driver you should use his video because if you see in comments of his video I was asking for his help and he gave me a different app and code and diagram, so use his video:

GioP1 (author)DishantS62016-08-27

I have the same problem as yours. I solved it now.

If you are using separate batteries for the arduino and motor driver, then you can try what I did to solve why the motors are not running.

My solution is: I missed one thing, There is a connection from the Arduino ground and motor driver ground. Check out this video at time 2:59

tronceeper (author)2016-12-29

Do I need an android phone? Or can I use my iPhone 5 which also has bluetooth?

Kaithsuku (author)2016-07-14

for nexus 5 do we have to buy the bluetooth module?

can you please reply fast

AmaanK8 (author)Kaithsuku2016-10-22

no no you don't need to buy bluetooth module???????
JUST Kidding yes you need to buy

JerinS3 (author)2016-08-10

can we use l2930 motor driver?

AnilC18 (author)2016-08-06

I mean socket failed

AnilC18 (author)2016-08-06

What does socket faild mean

BahramZ (author)2016-07-26

please give information about enable pin in l2989n,what is the job of it?do it need for workong or not?

Kaithsuku (author)2016-07-14

where to do this coding

Daddala mahesh (author)2016-07-13

is there any preffered android version in the mobile to use this apps

Daddala mahesh (author)2016-07-13

plz help i was getting socket failed in the cxem car app .....i did all the corrections and changed the mac adress alo again i was getting lke dat onl so plz help me

ibrahima126 (author)2016-06-30

Friends can you find (plc) chip programming logical controller in U.A.E

vipulk26 (author)2016-06-28

Can I use any controlling app

benjiA2 made it! (author)2016-06-08

here is the finished car

thanks again tolik777

vipulk26 (author)benjiA22016-06-28

Hey brother can I use any controlling app

benjiA2 made it! (author)2016-06-08

here is the finished car

thanks again tolik777

benjiA2 (author)2016-06-08

loved the project :)

thanks tolik777

YossiA3 (author)2016-06-07

Tolik777, thank you for a great instructable.

I not sure who had more fun doing this project me or my son.

Good Job!

I'll add an Made It image later

thejaravindan (author)2016-05-04

Thanks, Work great.

A little tweaks and it works on on already buillt car :D

DishantS6 (author)thejaravindan2016-06-05

tell me about those tweaks because right now both of my motors are not workin yet I followed it all I still can't get my motors to spin, plz help me dude.

gantzim (author)2016-04-27

add a } to the end so

else if(FCMD == cmdw){ // if EEPROM data write command

EEPROM.write(0,z1); // z1 record to a memory with 0 address




timer_init(); // reinitialize the timer

Serial.print("FWOK\r\n"); // send a message that the data is successfully written to EEPROM


then compile

SalwynD (author)2016-04-15

reply guys

SalwynD (author)2016-04-15

expected '}' at end of input



exit status 1

expected '}' at end of input

please help me out

PrinceS50 (author)2016-04-11

thodi bhain di

learner0803 (author)2016-04-08

Bluetooth is not getting detected I am using HC-05. What could be wrong?

richie.ryu (author)2016-03-27

id adding more motor driver possible, where do i hook it up?

About This Instructable




Bio: I like Electronics, Robots and Arduino!
More by tolik777:Android controlled RC Vehicle with real-time Video via Bluetooth & Wi-FiCxemCAR 1 - Android Control RC Car over BluetoothArduino Ampermeter (ZXCT IC's)
Add instructable to: