Bluetooth Controlled Robot
Bluetooth Controlled Robot
Objective: Use wheeled robot kit and blue tooth module to control robot using smart phone.
Use Arduino board and motor shield and mount on chassis. Connect RX pin of BT module to A5 pin of
Arduino, and TX pin of BT to pin 4 of Arduino, instead of 1,and 0. Serial communication pins are
modified accordingly in the program.
Program is for doing forward, backward, left and right movement only. App support many other controls.
The app "Bluetooth RC Controller" send to the Bluetooth module the following commands:
Forward -> F
Back -> B
Left -> L
Right -> R
Forward Left -> G
Forward Right -> I
Back Left -> H
Back Right -> J
Stop -> S
Front Lights On -> W
Front Lights Off -> w
Back Lights On -> U
Back Lighst Off -> u
Horn On -> V
Horn Off -> v
Extra On -> X
Extra Off -> x
Speed 0 -> 0
Speed 10 -> 1
Speed 20 -> 2
Speed 30 -> 3
.
.
.
Speed 90 -> 9
Speed 100 -> q
Stop All -> D
In this project was used just the basic commands: Forward, Back, Left and Right.
Code
//This program is used to control a robot car using a app that communicates with Arduino trough a
bluetooth module
#include <AFMotor.h>
#include <SoftwareSerial.h>
AF_DCMotor motor1(3);
AF_DCMotor motor2(4);
char command;
void setup()
MyBlue.begin(9600);
void loop()
{
if(MyBlue.available() > 0)
command = MyBlue.read();
switch(command)
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
void forward()
{
void back()
motor1.setSpeed(255);
motor2.setSpeed(255);
void left()
motor2.setSpeed(0);
void right()
motor1.setSpeed(0);
void Stop()
motor1.setSpeed(0);
motor2.setSpeed(0);