- Bluetooth Controlled Car
- This is my first Arduino-based, Bluetooth-controlled RC car. It is controlled by a smart phone application.
- Bluetooth Controlled Car using Arduino
- Main components needed for making a Bluetooth controlled car.
- Schematic for Bluetooth Controlled Car using Arduino.
- Code for controlling the Bluetooth Controlled car with Arduino.
- Android App for controlling the car.
- Arduino Bluetooth RC Car (Android Controlled)
- Introduction: Arduino Bluetooth RC Car (Android Controlled)
- Step 1: Remove the Existing Rc Circuit
- Step 2: Breadboard Schematic
- Step 3: Code
- Attachments
- Step 4: Android Bluetooth Controller
- Step 5: Video of My BT ArduiCar
- 13 People Made This Project!
- Recommendations
- Project-Based Learning Contest
- Metal Contest
- Make It Bridge
- 192 Comments
- Silverlit RC 1:16 Enzo Ferrari
Bluetooth Controlled Car
This is my first Arduino-based, Bluetooth-controlled RC car. It is controlled by a smart phone application.
Dual H-Bridge motor drivers L298
Maker Essentials — Micro-motors & Grippy Wheels
\t Arduino Bluetooth RC Car
Code for Arduino blootooth controlled RC Car
This is the code you will have to upload to your Arduino board.
1char t; 2 3void setup() 4pinMode(13,OUTPUT); //left motors forward 5pinMode(12,OUTPUT); //left motors reverse 6pinMode(11,OUTPUT); //right motors forward 7pinMode(10,OUTPUT); //right motors reverse 8pinMode(9,OUTPUT); //Led 9Serial.begin(9600); 10 11> 12 13void loop() 14if(Serial.available()) 15 t = Serial.read(); 16 Serial.println(t); 17> 18 19if(t == 'F') //move forward(all motors rotate in forward direction) 20 digitalWrite(13,HIGH); 21 digitalWrite(11,HIGH); 22> 23 24else if(t == 'B') //move reverse (all motors rotate in reverse direction) 25 digitalWrite(12,HIGH); 26 digitalWrite(10,HIGH); 27> 28 29else if(t == 'L') //turn right (left side motors rotate in forward direction, right side motors doesn't rotate) 30 digitalWrite(11,HIGH); 31> 32 33else if(t == 'R') //turn left (right side motors rotate in forward direction, left side motors doesn't rotate) 34 digitalWrite(13,HIGH); 35> 36 37else if(t == 'W') //turn led on or off) 38 digitalWrite(9,HIGH); 39> 40else if(t == 'w') 41 digitalWrite(9,LOW); 42> 43 44else if(t == 'S') //STOP (all motors stop) 45 digitalWrite(13,LOW); 46 digitalWrite(12,LOW); 47 digitalWrite(11,LOW); 48 digitalWrite(10,LOW); 49> 50delay(100); 51>
Bluetooth Controlled Car using Arduino
In this project, we will learn how to make a bluetooth controlled car using Arduino. we will be using HC-05 Bluetooth Module and L293D Motor Driver Module. To enable bluetooth communication, we will use a smart phone and a simple Android app to control the car.
Before proceeding with this tutorial, it’s good to go through my other tutorials on HC-05 Bluetooth module and L293D Motor Driver module.
Main components needed for making a Bluetooth controlled car.
The HC-05 Bluetooth Module is responsible for enabling Bluetooth communication between Arduino and the Android Phone.
The L293D Motor Driver module is responsible for providing the necessary current to drive the motors of the car.
Schematic for Bluetooth Controlled Car using Arduino.
The RX and TX pins of the Bluetooth module are connected after uploading the code to the Arduino.
This setup requires sufficient power supply to be able to run the four motors and the Bluetooth Module. If the power is not sufficient, even though the Bluetooth Module powers on, it cannot transmit data or cannot be paired with other Bluetooth devices. I recommend using rechargeable batteries that can supply a steady current for a longer period of time.
Code for controlling the Bluetooth Controlled car with Arduino.
Since we are using the L293D motor driver shield, we have to use the AFMotor.h library which contains the commands for driving the four dc motors attached to the shield.
#include //initial motors pin AF_DCMotor motor1(1); AF_DCMotor motor2(2); AF_DCMotor motor3(3); AF_DCMotor motor4(4); char command; void setup() < Serial.begin(9600); //Set the baud rate to your Bluetooth module. >void loop() < if(Serial.available() >0) < command = Serial.read(); Stop(); //initialize with motors stoped //Change pin mode only if new command is different from previous. //Serial.println(command); switch(command)< case 'F': forward(); break; case 'B': back(); break; case 'L': left(); break; case 'R': right(); break; >> > void forward() < motor1.setSpeed(255); //Define maximum velocity motor1.run(FORWARD); //rotate the motor clockwise motor2.setSpeed(255); //Define maximum velocity motor2.run(FORWARD); //rotate the motor clockwise motor3.setSpeed(255);//Define maximum velocity motor3.run(FORWARD); //rotate the motor clockwise motor4.setSpeed(255);//Define maximum velocity motor4.run(FORWARD); //rotate the motor clockwise >void back() < motor1.setSpeed(255); //Define maximum velocity motor1.run(BACKWARD); //rotate the motor anti-clockwise motor2.setSpeed(255); //Define maximum velocity motor2.run(BACKWARD); //rotate the motor anti-clockwise motor3.setSpeed(255); //Define maximum velocity motor3.run(BACKWARD); //rotate the motor anti-clockwise motor4.setSpeed(255); //Define maximum velocity motor4.run(BACKWARD); //rotate the motor anti-clockwise >void left() < motor1.setSpeed(255); //Define maximum velocity motor1.run(BACKWARD); //rotate the motor anti-clockwise motor2.setSpeed(255); //Define maximum velocity motor2.run(BACKWARD); //rotate the motor anti-clockwise motor3.setSpeed(255); //Define maximum velocity motor3.run(FORWARD); //rotate the motor clockwise motor4.setSpeed(255); //Define maximum velocity motor4.run(FORWARD); //rotate the motor clockwise >void right() < motor1.setSpeed(255); //Define maximum velocity motor1.run(FORWARD); //rotate the motor clockwise motor2.setSpeed(255); //Define maximum velocity motor2.run(FORWARD); //rotate the motor clockwise motor3.setSpeed(255); //Define maximum velocity motor3.run(BACKWARD); //rotate the motor anti-clockwise motor4.setSpeed(255); //Define maximum velocity motor4.run(BACKWARD); //rotate the motor anti-clockwise >void Stop() < motor1.setSpeed(0); //Define minimum velocity motor1.run(RELEASE); //stop the motor when release the button motor2.setSpeed(0); //Define minimum velocity motor2.run(RELEASE); //rotate the motor clockwise motor3.setSpeed(0); //Define minimum velocity motor3.run(RELEASE); //stop the motor when release the button motor4.setSpeed(0); //Define minimum velocity motor4.run(RELEASE); //stop the motor when release the button >
Android App for controlling the car.
In order to control the car using a mobile phone, we need to install an application to enable Bluetooth communication between the Arduino board and the car. This App can be downloaded from here.
The Android application controls are as shown above. The car will move in the direction depending on the arrow pressed.
This application also supports accelerometer control which means the movement of the car is determined by the direction in which the phone is tilted.
Arduino Bluetooth RC Car (Android Controlled)
Introduction: Arduino Bluetooth RC Car (Android Controlled)
Hello, in this project I will show you how to transform an RC toy car to Bluetooth controlled through your Android smartphone!
Before starting, make sure that you have:
- Arduino uno board
- L293D motor driver
- HC-06 Bluetooth module
- RC Car that can fit all the above !
- 1M & 100K resistor for battery level
- 4x leds for lights
- 1x speaker/buzzer for horn sound
For power, you can use the existing batteries (4x 1.5V AA), or replace them with a LiOn rechargeable battery pack.
(I used 12V LiOn rechargeable battery pack)
Step 1: Remove the Existing Rc Circuit
Before starting, remove the existing rc circuit. You will not need it any more. you will make a better one from the beginning with Arduino uno 😉
Now, with one battery AA 1.5V you must find the polarity of 2 c motors.
- For movement motor (back side) the positive polarity cable will be that moves the car forward.
- For direction motor (front side) the positive polarity cable will be that moves the wheels left.
Step 2: Breadboard Schematic
Ι suggest you to build your circuit on (small) breadboard first.
You can use on/off switch of car like this:
If you have a «big» rc car it will need more power so you can use L298 module board. L293D motor driver will give max 0.5A per channel and it will be come very hot after while. L298 module board has a heat sink and can give 1A per channel, but is bigger than L293D.
Step 3: Code
Download and open file with Arduino ide. Read every line of code (+comments) to understand how it’s working and then upload it to your Arduino uno board!
(for programming arduino uno board you must disconnect first the RX & TX pins of Bluetooth module)
Attachments
Step 4: Android Bluetooth Controller
To control your new Bluetooth car, download and install this android application:
First enable Bluetooth and establish connection with BT module.
(ex. HC-06, password 1234)
Use «Help & info» button if you can not understand how it is working.
Accelelometer function is under developing, use with attention!
If you have problem with this app on your android device you can also use this one.
Step 5: Video of My BT ArduiCar
Video is in Greek language but I believe that you can understand it.
Remember that Bluetooth technology will give you max 15-20 meters of control.
13 People Made This Project!
Did you make this project? Share it with us!
Recommendations
Project-Based Learning Contest
Metal Contest
Make It Bridge
192 Comments
bro i want to add a ultrea sonic [distance sensoer] to the same code that is the car will stop automatically when objects come naear 2meters,plz pm me harinadh.38@gmail.com
could you kindly send this also to me? i am also planning to add the ultrasonic sensor 🙂 thank you, my email is jmangubat528@gmail.com
IM SOORY I DID NOT SEE YOUR MESSAGE
PING ME AT harinadh.38@gmail.com
if isuccess i will send u
Hey I have an HC-05 can I use it.
I made it, but changed it, but used lighter weight materials. I created another branch of instructables at https://www.instructables.com/id/Bluetooth-RC-Car-With-STM32F103C-and-L293D-Inexpen/.
Thank you, Vasilakis Michalis!
Hello, I have made this project and run well. But when I press forward or other button continuously, the system became hang and not respond to any command from android. After I press reset button on Arduino, it back to normal again. At first I think arduino deficient power because I use 1 battery source. So I try to separate battery for arduino and for motor DC and configure the jumper on L293D motor driver shield. But it still hang when I run the car with continuous pressing. What should I do? anybody have the same problem like me? thanks in advance.
The Bluetooth module must be configured otherwise it will NOT work! https://www.youtube.com/watch?v=ZdvKh3c_yoQ . . That’s why my module doesn’t give life signs.
How much mah battery we have to use ?
I was using this app for a while and now it sends only S on any button can you help me?
I made rc car that is a bit bigger than it’s shown. My problem is that there is too low voltage to turn front wheels. I don’t know what to add or change to put more voltage. I think that arduino puts out too low voltage. 10V battery sould be enough. Could you help me out?
You can use L298N motor driver and add additional battery to use the motor.
Can i use l298n in this programing
Hello, can I change my iOS Bluetooth controlled car to Remote Control? I have
Silverlit RC 1:16 Enzo Ferrari
Can I use HC-05 bluetooth module instead of 06 and is there any AT mode settings in this project
Can i have the android apps code.
Can I use here 10000mah 5V powerbank instead of 12v LiOn battery; and instead of bluetooth module can I use wifi module instead? thanks!