You are on page 1of 14

Chapter 6

Project Implementation and Coding


6.1 Overview of Project Modules
In this project bomb disposal missions provide arm or designers, disposal technicians and
mission controllers with several challenges including high risks in it. A typical bomb disposal
mission will initially involve investigating the site using a remote-controlled robot and if
possible, disarming the bomb remotely. Sometimes it is necessary for a human which is bomb
disposal expert to disarm the device. For this purpose, the expert who exposes the bomb will put
on a protective suit and helmet, pick up a toolbox of equipment, and walk the 100 or so meters to
the site. To reach the bomb’s location, it may be necessary to climb stairs, crawl through
passageway or even lie down to fulfill the mission. The system also includes night vision camera
which will not only allow viewing whatever will be recorded in daytime but also during night.
The whole system is controlled via android application.

 Robotic Mechanism: We are using ESP8266 as main controller and L298N as a motor
driver to control geared motor.

Microcontroller L298N Geared Motor

 Sensor Network: We are using various sensors like motion sensor, temperature sensor,
humidity sensor, gas sensor, metal detector and these values are sent to receiver using RF
technology.

Sensor Controller Transmitter

Display Controller Receiver


 Communication: We are using HC-12 transceiver for communication. The range of HC-
12 module is more than 200 meters.

HC-12 HC-12

6.2 Tools and Technologies Used


 Arduino IDE - The Arduino Integrated Development Environment (IDE) is a cross-
platform application (for Windows, macOS, Linux) that is written in functions from C
and C++. It is used to write and upload programs to Arduino compatible boards, but also,
with the help of 3rd party cores, other vendor development boards. The source code for
the IDE is released under the GNU General Public License, version 2. The Arduino IDE
supports the languages C and C++ using special rules of code structuring. The Arduino
IDE supplies a software library from the Wiring project, which provides many common
input and output procedures.
6.3 Project Code
#include <SoftwareSerial.h>
#include <Wire.h>

#define MOTOR_A1_PIN 13
#define MOTOR_B1_PIN 12
#define PWM_MOTOR_1 3

#define MOTOR_A2_PIN 8
#define MOTOR_B2_PIN 7
#define PWM_MOTOR_2 5

SoftwareSerial HC12(10, 11);

int lr,x,y;
int bf, motor1_speed, motor2_speed;
int mode;
String input;
int boundLow;
int boundHigh;
const char delimiter = ',';

void setup() {

pinMode(MOTOR_A1_PIN, OUTPUT);
pinMode(MOTOR_B1_PIN, OUTPUT);
pinMode(PWM_MOTOR_1, OUTPUT);
pinMode(MOTOR_A2_PIN, OUTPUT);
pinMode(MOTOR_B2_PIN, OUTPUT);
pinMode(PWM_MOTOR_1, OUTPUT);

Serial.begin(9600);
HC12.begin(9600);

pinMode (2, OUTPUT);


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

void loop() {

if(HC12.available())
{
input = HC12.readStringUntil('\n');
if (input.length() > 0)
{
Serial.println(input);

boundLow = input.indexOf(delimiter);
x = input.substring(0, boundLow).toInt();

boundHigh = input.indexOf(delimiter, boundLow+1);


y = input.substring(boundLow+1, boundHigh).toInt();

boundLow = input.indexOf(delimiter, boundHigh+1);


bf = input.substring(boundHigh+1, boundLow).toInt();

boundHigh = input.indexOf(delimiter, boundLow+1);


lr = input.substring(boundLow+1, boundHigh).toInt();

mode = input.substring(boundHigh+1).toInt();

delay(10);
} } }

void forward()
{
motor1_speed=100;
motor2_speed=100;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, LOW);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, LOW);
Serial.println("Moving Forward");
}

void backward()
{
motor1_speed=100;
motor2_speed=100;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, LOW);
digitalWrite(MOTOR_B1_PIN, HIGH);
digitalWrite(MOTOR_A2_PIN, LOW);
digitalWrite(MOTOR_B2_PIN, HIGH);
Serial.println("Moving Forward");
}

void fforward()
{
motor1_speed=255;
motor2_speed=255;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, LOW);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, LOW);
Serial.println("Moving Forward");
}

void fbackward()
{
motor1_speed=255;
motor2_speed=255;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, LOW);
digitalWrite(MOTOR_B1_PIN, HIGH);
digitalWrite(MOTOR_A2_PIN, LOW);
digitalWrite(MOTOR_B2_PIN, HIGH);
Serial.println("Moving Backward");
}

void stop()
{
motor1_speed=0;
motor2_speed=0;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, LOW);
digitalWrite(MOTOR_B1_PIN, LOW);
digitalWrite(MOTOR_A2_PIN, LOW);
digitalWrite(MOTOR_B2_PIN, LOW);
Serial.println("Stop");
}

void ffrontright()
{
motor1_speed=255;
motor2_speed=50;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, LOW);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, HIGH);
Serial.println("Front Right");
}

void ffrontleft()
{
motor1_speed=50;
motor2_speed=255;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, HIGH);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, LOW);
Serial.println("Front Left");
}

void frontright()
{
motor1_speed=150;
motor2_speed=50;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, LOW);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, HIGH);
Serial.println("Front Right");
}

void frontleft()
{
motor1_speed=50;
motor2_speed=150;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, HIGH);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, LOW);
Serial.println("Front Left");
}

void left()
{
motor1_speed=100;
motor2_speed=100;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, HIGH);
digitalWrite(MOTOR_B1_PIN, LOW);
digitalWrite(MOTOR_A2_PIN, LOW);
digitalWrite(MOTOR_B2_PIN, HIGH);
Serial.println("Moving Left");
}
void right()
{
motor1_speed=100;
motor2_speed=100;
analogWrite(PWM_MOTOR_1, motor1_speed);
analogWrite(PWM_MOTOR_2, motor2_speed);
digitalWrite(MOTOR_A1_PIN, LOW);
digitalWrite(MOTOR_B1_PIN, HIGH);
digitalWrite(MOTOR_A2_PIN, HIGH);
digitalWrite(MOTOR_B2_PIN, LOW);
Serial.println("Moving Right");
}

void low_speed()
{

if ((bf <= 100) && (lr > 100) && (lr < 700))
{
backward();
}

else if ((bf >= 700) && (lr > 100) && (lr < 700))
{
forward();
}
else if ((lr <= 100) && (bf > 100) && (bf < 700))
{
right();
}

else if ((lr >= 700) && (bf > 100) && (bf < 700))
{
left();
}

else if ((lr <= 100) && (bf >= 700))


{
frontleft();
}

else if ((lr >= 700) && (bf >= 700))


{
frontright();
}
}
void high_speed()
{

if ((bf <= 100) && (lr > 100) && (lr < 700))
{
fbackward();
}

else if ((bf >= 700) && (lr > 100) && (lr < 700))
{
fforward();
}

else if ((lr <= 100) && (bf > 100) && (bf < 700))
{
right();
}

else if ((lr >= 700) && (bf > 100) && (bf < 700))
{
left();
}

else if ((lr <= 100) && (bf >= 700))


{
ffrontleft();
}

else if ((lr >= 700) && (bf >= 700))


{
ffrontright();
}
else
{
stop();
}
}
Chapter 7
Testing
6.1 Types of Testing
Testing is the process of evaluating a system or its component(s) with the intent to find whether
it satisfies the specified requirements or not. Testing is executing a system in order to identify
any gaps, errors, or missing requirements in contrary to the actual requirements.

6.1.1 Manual Testing


Manual testing includes testing a software manually, i.e., without using any automated tool or
any script. In this type, the tester takes over the role of an end-user and tests the software to
identify any unexpected behavior or bug. There are different stages for manual testing such as
unit testing, integration testing, system testing, and user acceptance testing. Testers use test
plans, test cases, or test scenarios to test a software to ensure the completeness of testing. Manual
testing also includes exploratory testing, as testers explore the software to identify errors in it.

6.1.2 Automation Testing


Automation testing, which is also known as Test Automation, is when the tester writes scripts
and uses another software to test the product. This process involves automation of a manual
process. Automation Testing is used to re-run the test scenarios that were performed manually,
quickly, and repeatedly.
6.2 Methods of Software Testing
There are different methods that can be used for software testing. This chapter briefly describes
the methods available.
6.2.1 Black-Box Testing
The technique of testing without having any knowledge of the interior workings of the
application is called black-box testing. The tester is oblivious to the system architecture and does
not have access to the source code. Typically, while performing a black-box test, a tester will
interact with the system's user interface by providing inputs and examining outputs without
knowing how and where the inputs are worked upon.

6.2.2 White-Box Testing


White-box testing is the detailed investigation of internal logic and structure of the code. White-
box testing is also called glass testing or open-box testing. In order to perform white box testing
on an application, a tester needs to know the internal workings of the code. The tester needs to
have a look inside the source code and find out which unit/chunk of the code is behaving
inappropriately.

6.2.3 Grey-Box Testing


Grey-box testing is a technique to test the application with having a limited knowledge of the
internal workings of an application. In software testing, the phrase the more you know, the better
carries a lot of weight while testing an application.

Mastering the domain of a system always gives the tester an edge over someone with limited
domain knowledge. Unlike black-box testing, where the tester only tests the application's user
interface; in grey-box testing, the tester has access to design documents and the database. Having
this knowledge, a tester can prepare better test data and test scenarios while making a test plan.
6.3 Test Cases
6.3.1 Test Cases for Hardware
No. Module Expected Result Actual Result Status
1. Forward control Robot Should move in Robot is moving in Success
Forward Direction. forward direction.

2. Reverse Control Robot Should move in Robot is moving in Success


Reverse Direction. Reverse direction.

3. Left Control Robot Should move in Robot is moving in Left Success


Left Direction. direction.

4. Right Control Robot Should move in Robot is moving in Success


Right Direction. right direction.

5. Stop Controller should send Spraying mechanism is Success


on/off Signal to Relay. working as per
requirements.

6. Metal Detector The metal detector Sensor is working as Success


sensor should detect per requirements.
metal accurately.

7. Motion Sensor Motion sensor should Motion sensor is Success


detect any motion in detecting motion very
its range. accurately.

8. Gas Sensor Gas sensor should Gas sensor working as Success


detect any hazardous expected
gas like Methane, H2S
9. Temperature & Humidity The DHT11 sensor DHT11 sensor is Success
should detect current working as per
temperature and requirements.
humidity.

Chapter 8
Result
8.1 Outcomes and Results
Chapter 9
Conclusion
9.1 Conclusion
This type of robot can perform difficult and repetitive works for humans. It can have a very risky
job and such dangerous job could be done by using small spy robot. But it is useful to check and
look out the places where dangerous to the humans. Spy robot can also be used in searching
people who are in building destroyed by the earthquake. Because of the wireless camera is
installed in spy robots, it can be used remotely to enter and exit dangerous place that human
cannot. When the user controls by remote controller, the spy robot will move to desired
destination and spy images around the robot. The user can check and recommend from computer
with the wireless remote controller.

9.2 Future enhancement


 We will use 360-degree camera to monitor the field.
 We will use Raspberry Pi and image processing techniques to detect enemies.
 We will use various Machine learning and AI techniques to make robot autonomous.

9.3 Applications and advantages


 Bomb detection and bomb diffuse
 Target and shoot enemies
 Saves lives on war field
 Perform risky operations.

You might also like