Rover Controlled from Cell Phone

rover control bluetooth

“Rover Control from Cell Phone” is our project for Embedded System to understand the basics of the embedded system and how the data is transferred from one system to another via different layers of networks.

Our system consists of a rover which is controlled by the Mobile application. The rover has the Arduino Uno as the main microcontroller chip, along with a Bluetooth connector which connects the rover to the cell phone and upon receiving the data from the remote controller app, the microcontroller converts the data form remote to rover control data and sends to the motor driver which control the rover.

The primary objective of this project is to learn about how components in embedded systems work and how communication occurs between them and develop a system for controlling the rover with a cell phone applications.

We initiated this project with the following objectives:

1. To control the rover with mobile application.

2. To promote use of autonomous or remote-controlled bodies.

3. To learn about data communication in embedded system.

rover control
Rover Controlled by Bluetooth

Initially we have created a 3D design for the rover and later we tried to make it on as we have designed. The 3d design was made with the blender software which is great tool to create and render 3D images.

Inital 3d design for rover

System Architecture:

The wiring diagram

The Arduino UNO is used as the central component which consists of its core, AT MEGA 328 IC. The system is powered with 9.5-volt lithium-ion battery which gets connected to motor driver to get regulated 5.0V DC output to power an Arduino.

Microcontroller is embedded with motor driver, motors, Bluetooth card, buzzer, and light. The different components get activated only when the microcontroller receives appropriate signal from Bluetooth device(mobile).

The rover has 4-wheel drive system where 2 adjacent motors are connected on parallel which helps to gain high torque and maximum performance. We have used PWM (Power width modulation) technique to control the speed of motor to gain required control on it.

System Flow:

The pointed arrow showing the data flow of system.

Ramp Test:

The rover is connected with 4 wheel drive which allows rover to move on inclined ramp about 20 degree on smooth way.

The mobile application:

The mobile application has been developed using the MIT app inventor. Using the block editor of this IDE we built the remote-control app for our project.

It is a simple application which connects to a Bluetooth device and transfer different data on different button presses. The application uses Bluetooth Client to connect to the Bluetooth adapter of the rover and on different button presses, it sends different signals in text format to the adapter. To download the mobile application click here. (Download Link coming soon)

MIT App Inventor Block Editor

Source Code for Rover:

This is the source code for the rover. You can use it on any Arduino variant microcontroller. The integers value is passed from a mobile application to the Bluetooth card embedded on the microcontroller.

char Incoming_value = 0;

const int ENA = 3;
const int ENB = 11;

void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);

  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(9, OUTPUT);
}

void loop()
{
  if (Serial.available() > 0)
  {
    Incoming_value = Serial.read();
    Serial.print(Incoming_value);
    Serial.print("\n");

    if (Incoming_value == '1')
    {
      Serial.println("forward");
      forward();
    }
    else if (Incoming_value == '2')
    {
      Serial.println("backward");
      backward();
    }
    else if (Incoming_value == '3')
    {
      Serial.println("left");
      left();
    }
    else if (Incoming_value == '4')
    {
      Serial.println("right");
      right();
    }
    else if (Incoming_value == '9')
    {
      Serial.println("rotote");
      rotate();
    }
    else if (Incoming_value == '5')
    {
      Serial.println("Light on");
      light();
    }

    else if (Incoming_value == '7')
    {
      Serial.println("Light off");
      dark();
    }
    else
      stopit();
  }
}

void forward()
{
  Serial.println("forward");
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
  digitalWrite(4, LOW);
  digitalWrite(5, HIGH);
  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
}

void backward()
{
  Serial.println("backward");
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
  digitalWrite(4, HIGH);
  digitalWrite(5, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(7, LOW);
}

void left()
{
  Serial.println("left");
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
  digitalWrite(5, LOW);
  digitalWrite(4, HIGH);
  digitalWrite(5, LOW);
  digitalWrite(7, HIGH);
}

void right()
{
  Serial.println("right");
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
  digitalWrite(5, HIGH);
  digitalWrite(4, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(7, LOW);
}

void rotate()
{
  Serial.println("rotating");
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
  digitalWrite(9, HIGH);
  delay(300);
  digitalWrite(9, LOW);

  Serial.print("on pin 12 HIGH");
  //                    digitalWrite(5, LOW);
  //                    digitalWrite(4, HIGH);
  //                    digitalWrite(6, LOW);
  //                    digitalWrite(7, HIGH);
}

void light()
{
  Serial.println("light on");
  digitalWrite(8, HIGH);
  //  delay(100);
  //  digitalWrite(10,LOW);
}

void dark()
{
  Serial.println("light off");
  digitalWrite(8, LOW);
}

void stopit()
{
  Serial.println("stop");
  digitalWrite(4, LOW);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
}

Initially the pins are configured to which the output voltages are to be sent for controlling the operations of the rover in the setup function. Then inside the loop function, the system listens for the signal from the Bluetooth adapter, and when the adapter receives the signal, then on the basis of the incoming data it calls out various functions to control the rover.

Some of the functions used are:

a. forward(): to move the rover in forward direction.  

b. backward(): to move the rover in backward direction. 

c. left(): to rotate the rover in left direction. 

d. right(): to move the rover in right direction. 

e. light(): to turn the headlight on.  f. dark(): to turn the headlight off.

The system consists of a remote-control application in cell phone which is connected to the rover’s microprocessor via Bluetooth HC 06 module, and it instructs the motor controller to control the tires to move the rover.

The motor has four BO motors for movement. Having four different BO motors makes the rover powerful enough to be capable of climbing steep gradients. The BO motors is placed in each tire of rover. This gives rover to change its direction easily.

For example, when two motors of left move, the rover turns to left and when two motors of right move, the rover turns to right. The rover is capable enough to climb steep gradients of 30 degrees and is very fast, and has fast turning rates. The response time of rover is good for any competition.

The battery is Lithium-ion battery which gives power to microcontroller. The rover can also be modified in future. For example, adding solar panels to make more sustainable, adding sensors to make the rover a line following rover.

Leave a Comment

Your email address will not be published. Required fields are marked *