In this Project, we have designed spy rover controlled through Bluetooth. It is a surveillance robot which will be used to monitor and keep watch of areas not easily accessible by humans. Surveillance is the process of monitoring a situation, an area or a person. It is generally practiced in a military scenario where surveillance of borderlines and enemy territory is essential to for the country’s safety.
Human surveillance is achieved by deploying personnel near sensitive areas in order to constantly monitor changes. But humans do have their limitations, and deployment in inaccessible places is not always possible. There are also added risks of losing personnel in the event of getting caught by the enemy. With advances in technology over the years, it is now possible to remotely monitor areas of importance by using robots in place of humans.
The control mechanism is provided along with video transmission facility. This spy rover has a mobile phone mounted on it and the camera of the mobile phone is utilized to record surroundings. The IP camera app is used on the mobile phone to use the mobile camera as IP camera. The mobile camera which will capture the scenario in front of it and transfer to the server on which the user will be watching the live feed.
The robot is controlled and maneuvered using another mobile phone which has a custom app installed on it for controlling the robot. The mobile phone controlling the robot connects with the robot using Bluetooth interface. The robot has HC-05 Bluetooth module interfaced on the control circuitry to connect the mobile phone.
The four-wheel robot has two wheel drive so a pair of geared DC motors is mounted on the rear wheels. The control circuitry of the robot is built around Arduino Pro Mini. Arduino is the most popular prototyping board and easiest to program due to large community support. The Pro Mini is chosen for this robotic project due to its compact size and packed features that are sufficient for making the robot. The reception and interpretation of commands over Bluetooth and controlling of DC motors through L293D motor driver IC are managed by the Arduino Sketch. The Arduino Code is written and burnt to the board using Arduino IDE. The custom app for controlling the motion of robot is built using MIT App Inventor.
Components Required –
Fig. 1: List of Components required for Arduino based Bluetooth Controlled Spy Rover
Block Diagram –
Fig. 2: Block Diagram of Arduino based Bluetooth Controlled Spy Rover
Circuit Connections –
The electronic circuit controlling the robot is built around Arduino Pro Mini. The L293D motor driver IC and HC-05 Bluetooth module are interfaced to the controller board. A pair of geared DC motors are attached at the rear wheels which are interfaced with the motor driver IC. A mobile phone whose camera is used as IP camera is mounted on the robot body.
Fig. 3: Image showing Bluetooth Controlled Spy Rover
The control circuitry of the robot can be breakdown into following circuit sections –
Power Supply – In the circuit, Arduino Pro Mini and the Bluetooth module need a 5V regulated DC for their operation while the motor driver IC needs 12V DC. A 12V NIMH battery is used as the primary source of power. The supply from the battery is regulated to 5V and 12V using 7805 and 7812 ICs. The pin 1 of both the voltage regulator ICs is connected to the anode of the battery and pin 2 of both ICs is connected to ground. The respective voltage outputs are drawn from pin 3 of the respective voltage regulator ICs. An LED along with a 10K Ω pull-up resistor is also connected between common ground and output pin to get a visual hint of supply continuity. Despite using 12V battery, 7812 is used to provide a regulated and stable supply to the motor driver IC.
Arduino Pro Mini – Arduino Pro Mini is a Atmega 168 based microcontroller board. It has 14 GPIO pins, 6 analog inputs, 6 PWM pins, 2 external interrupts and onboard UART, SPI and I2C. The board is just 1.3 inch by 0.7 inch in size that is six times smaller than Arduino UNO. With such features packed in small size, this board is most ideal for any robotic project. In this project, 4 input output pins of Pro Mini are utilized for interfacing with motor driver IC and Bluetooth module is interfaced with RX and TX pins available for serial communication over UART.
HC-05 Bluetooth Module – HC-05 Bluetooth module is serial port protocol module. It operates on ISM band 2.4GHz with V2.0+EDR (enhanced data date). It can work in both Master and slave modes. The Bluetooth module has six pins – Enable, VCC, Ground, Transmit Data (TxD), Receive Data (RxD) and State. The Enable and State pin are unused and so not connected in the circuit. The VCC and Ground pins are connected to the common VCC and Ground. The TxD and RxD pins of the module are connected to the pins RX and TX of the Arduino Pro Mini respectively. These connections are summarized in the table below –
Fig. 4: Table listing circuit connections between HC-05 Bluetooth Module and Arduino Pro Mini
L293D DC Motor Driver IC – The L293D is a dual H-bridge motor driver integrated circuit (IC). The Motor drivers act as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors. It has 16 pins with following pin configuration:
Fig. 5: Table listing pin configuration of L293D Motor Driver IC
There are two DC motors used for making the robotic car. The DC motors are interfaced between pins 3 and 6 and pins 14 and 11 of the motor driver IC.
The L293D IC controls the DC Motors according to the following truth tables:
Fig. 6: Truth Table of L293D Motor Driver IC
Fig. 7: Truth Table of L293D Motor Driver IC
The pin 4, 5, 13 and 12 of the L293D are grounded while pin 1, 16 and 9 are connected to 5V DC and pin 8 is connected to 12V DC. The pins 15, 2, 7 and 10 of the motor driver IC are connected to pins 8, 2, 3 and 7 of the Arduino board. The DC motor attached to right wheel is connected to pins 11 and 14 while motor attached to left wheel is connected to pins 3 and 6 of the motor driver IC.
Geared DC Motors – In this robot, 12V geared DC motors are attached to the wheels. Geared DC motors are available with wide range of RPM and Torque, which allow a robot to move based on the control signal it receives from the motor driver IC.
Mobile Phones – A mobile phone is mounted on the robot for live transmission of the video recording. The phone has IP camera app installed on it which records and transmits the live recording to a remote server. The app automatically uses the mobile camera as IP camera. Another mobile phone will be used to control the robot over Bluetooth. It has a custom app installed on it which can move the robot in forward, backward, left or right direction. The development of the custom app using MIT App Inventor is discussed in the programming guide section.
Fig. 8: Image of Control Circuitry mounted on Spy Rover Body
How the circuit works –
Once the control circuitry of the robot is powered on, it initializes the controller and starts reading data from the Bluetooth module. The control commands can be passed to the robot using a custom app running on an android phone. The app has a user interface which allows moving the robot forward, backward, turn left, turn right and stop. The user has just tap the direction buttons to transfer the commands. The commands are passed by the app to the Bluetooth module interfaced in the control circuitry in the form of single character strings. The following strings are passed to transfer the control commands –
Fig. 9: Table listing string commands used for movement of Arduino Robot
These command strings are interpreted in the Arduino sketch to control the DC motors. The robot can be moved forward, backward, left or right by implementing the following input logic at the motor driver pins –
Fig. 10: Logic Table of L293D Motor Driver IC for Arduino Robot
On receiving the string commands, the Arduino sketch just changes the digital output at the input pins of the motor driver IC to control the motion of the robot.
An Android smart phone is mounted on the robot to broadcast the video and audio from the robot to the control interface (computer). There are many IP webcam applications are available in the Google play store, but two applications are quite good – one is Alfred and second is IP webcam. An internet protocol (IP) camera is a type of digital video camera, generally employed for surveillance which can send and receive data via a computer network and internet. Any of these apps mentioned above can be used for using phone as IP camera.
In this project Alfred is used for the broadcast. The IP webcam also becomes easy when the mobile phone is connected to a laptop by the same server like through a common Wi-Fi connection. As the Alfred app is used, one has to login with an mail id and once done the camera will be switched ON in the mobile mounted on the robot. Then the user has to go to alfred.computer in the pc or laptop and login with the mail id and the video will be broad casted live. After initiating the live broadcast, user can run and control the robot with another mobile connected to the circuit through Bluetooth module.
Programming Guide –
The custom app used to control the motion of the robot is built using MIT App Inventor. There are also many android Bluetooth applications available on the Play Store which can be used. If any application available on Play Store is used, the Arduino sketch will need to be modified or changed accordingly. The MIT App Inventor 2 is used to built the app.
Fig. 11: Screenshot of custom app designed using MIT App Inventor
MIT app Inventor is an easy platform to create an android application. The platform uses logical blocks to create an app. A guide to use MIT app inventor 2 is provided at the official website of the platform. There are also many YouTube tutorials available for reference. The Robot control app created in this project has the following logics that are formed with help of blocks –
Fig. 12: Screenshot of Logical blocks of the custom app designed using MIT App Inventor
Fig. 13: Screenshot of Logical blocks of the custom app designed using MIT App Inventor
More features can be added in the app by including additional logical blocks.
In the control circuitry of the robot, Arduino sketch running on Pro Mini controls the robot’s mechanism. The Arduino sketch starts with the declaration of constants. The following #define directives are used to determine the Arduino pins that should be connected to the motor driver IC.
#define LM1 2
#define LM2 3
#define RM1 7
#define RM2 8
The following code block list the function prototypes that are used to determine the task of the motor.
char data = 0;
void moveforward();
void movebackward();
void turnleft();
void turnright();
void robostop();
The following block of code is the setup() function where it is used to determine whether the connected pins are used as input or output and the serial communication with the Bluetooth module is enabled. Here Serial.begin is used to establish a serial communication between the Bluetooth and the Arduino and pins connected to the input pins of motor driver IC are declared as output.
void setup()
{
Serial.begin(9600);
pinMode(LM1, OUTPUT);
pinMode(LM2, OUTPUT);
pinMode(RM1, OUTPUT);
pinMode(RM2, OUTPUT);
}
The main operation in the code is implemented by a decision-making loop which is called in the main() function. It checks whether the serial data is available and if any data is available, it reads the serial data using UART interface. The Read() method of the Serial object is used to read data and the data is then stored in a variable.
if(Serial.available()>0)
{
data = Serial.read();
Serial.print(data);
Serial.print(“n”);
The received serial data is compared with pre-determined string commands in if statements and accordingly the logic at the input pins of the motor driver IC are changed. Like if the serial data received is ‘F’, the function moveforward() is called to run the robot forward.
The complete Arduino Sketch for the Bluetooth Controlled Spy Rover can be found under the source code tab.
Note: Find the rar file for the Bluetooth controlled app below.
You may also like:
Project Source Code
###
//Program to #define LM1 2 //define the pins number for motor connection #define LM2 3 #define RM1 7 #define RM2 8 char data = 0; void moveforward(); //function prototype void movebackward(); void turnleft(); void turnright(); void robostop(); void setup() //setup function to define pinmode is input or output { Serial.begin(9600); pinMode(LM1, OUTPUT); pinMode(LM2, OUTPUT); pinMode(RM1, OUTPUT); pinMode(RM2, OUTPUT); } void loop() //Infinite loop function { if(Serial.available()>0) //condition check for serial data is available or not { data = Serial.read(); //if available read the data Serial.print(data); Serial.print("n"); if(data == 'F') { Serial.println("Forward"); moveforward(); } else if(data == 'B') { Serial.println("Backward"); movebackward(); } else if(data == 'L') { Serial.println("Left"); turnleft(); } else if(data == 'R') { Serial.println("Right"); turnright(); } else if(data == 'S') { Serial.println("Stop"); robostop(); } } } void moveforward() // function definition to move robot forward { digitalWrite(LM1, HIGH); digitalWrite(LM2, LOW); digitalWrite(RM1, HIGH); digitalWrite(RM2, LOW); } void movebackward() // function definition to move robot backward { digitalWrite(LM1, LOW); digitalWrite(LM2, HIGH); digitalWrite(RM1, LOW); digitalWrite(RM2, HIGH); } void turnleft() // function definition to turn robot left { digitalWrite(LM1, HIGH); digitalWrite(LM2, LOW); digitalWrite(RM1, LOW); digitalWrite(RM2, LOW); } void turnright() // function definition to turn robot right { digitalWrite(LM1, LOW); digitalWrite(LM2, LOW); digitalWrite(RM1, HIGH); digitalWrite(RM2, LOW); } void robostop() // function definition to stop the robot { digitalWrite(LM1, LOW); digitalWrite(LM2, LOW); digitalWrite(RM1, LOW); digitalWrite(RM2, LOW); }###
Circuit Diagrams
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.