0% found this document useful (0 votes)
16 views

ffff

Uploaded by

rickyabhi030405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

ffff

Uploaded by

rickyabhi030405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

TABLE OF FIGURES

S.No. Figure Title Page No.

1 Command prompt of Raspberry Pi OS 15

2 Basic block diagram of the Proposed system 28


GPIO Pin Diagram for Landmine Detection Robot
3 29
controlled web-based user
4 Components used 30

5 Various views of the Robot 30

6 Use case diagram for landmine detection robot 31

7 Activity diagram for landmine detection robot 33

8 Sequence diagram for landmine detection robot 37

9 Class diagram for landmine detection robot 39

10 Collaboration diagram for landmine detection robot 41

11 Output Screen of Web application controlling Robot 43

12 Method versus Time elapsed for various algorithms 44


Output Screen showing snippets of the main code
13 45
execution
14 Shows mail sent from [email protected] to [email protected] 46

15 Shows the mail with the decrypted image 47


TABLE OF CONTENTS

S.No. Chapter Title Page No.


Acknowledgment iv
Table of Figures V
Abstract 7
2. Introduction 8
3. Problem Statement 10
4. Literature Survey 11
5. Software and Hardware Requirement specification 12
6. Conceptual Model/Proposed architecture 28
7. Interaction Scenario 31
8. Methodology and Approach 42
9. Output/Results 43
10. Conclusion 48
11. References 49

ii
ABSTRACT

This project aims at the development of a web-based user interface to control


and monitor the movement of Mobile Robot that is used for the purpose of Landmine
Detection. The Robot is deployed in regions for military purposes and its movement
is monitored through a remote web-based user interface. The major purpose is to
detect the landmine and send an image of its location to the user. The robot is built
with suitable materials to survive devastating situations like high temperatures and
pressure. The built-in Wi-Fi in Raspberry Pi 3 helps to set up communication
between the remote user interface and controller in the robot.

The process begins by providing inputs from web-based user interface as the
predefined functions which have dedicated functionalities ( Start & Stop).The Robot
identifies these inputs in Raspberry Pi 3 and appropriate function is carried out.
Actuators will receive signals from raspberry pi 3 and the tasks are performed. The
web-based interface is used to monitor the robot which is interfaced with the
landmine detecting sensors. The GPS module aids in guiding the Robot by providing
proper localization. A metal detector is employed which helps in accurate detection
of landmines buried under the soil. The IR sensors play a vital role in determining
obstacles along the path of the Robot. On detection of landmine, the camera module
captures the image of the present surroundings and an e-mail is generated through
which the encrypted image of the location is sent to the registered e-mail id. For
encryption, IWT plus Play-Fair cipher technique is employed using DLILL method
that sends the final encrypted image to the remote controller. Such an encryption
scheme can keep the landmine location away from anti-social groups.

1
2. INTRODUCTION
Land mines are laid explosives found buried into the ground designed to
injure or kill people. They can lie dormant or inactive for years until a person or an
animal triggers their detonating mechanism. They are activated by pressure, by
pulling a switch, by radio signal or any other remote firing method from a
predetermined distance. The most alarming factor is that they indiscriminately injure
civilians, soldiers or the mine clearance staff and hence are called “victim-
activated”. While there are many activists working towards the ban in the
manufacture and selling of these landmines, the real challenge lies in the accurate
detection of around 100 million landmines buried in over 65 countries. These
landmines are left behind after wars and have been an unsolved problem of the world
and are a central issue in Europe, Africa, Asia and central South America. Not only
do they affect the military domain but pose a serious threat to the agricultural sectors
by making agricultural lands uncultivable. An effective solution for the problem must
involve accurate detection of landmines with a minimal rate of false alarms without
involving actual human interaction thus reducing the death rate caused in manual
landmine detection. Secondly the information regarding the buried landmines must be
transferred in a secure form to the concerned demining team so as to avoid the
intervention of any other anti-social groups. One major objective should be the secure
transfer of information mainly with regards to the image containing landmine
location.

EXISTING SYSTEM:

In the systems that previously existed, dead reckoning or differential steer


drive were used for navigation. It did not contribute much to render the Robot
autonomous. It required explicit control to direct the movement of the Robot.

PROPOSED SYSTEM:

In the proposed system, we use Bug algorithm which is a path planning


algorithm based on the concept of uninformed search for navigation of the robot. We
also use IWT with Play Fair Cipher method for encryption. We use an integrated GPS
module for motion of the Robot. The process of retrieving the position of the Robot
and monitoring its motion has been made simpler by the usage of web-based
interface.

Raspberry Pi 3 is used for the motor driven robot. The Pi processes all the
inputs based on the information obtained from the GPS module. Planning of the path
to be followed is done with the help of an uninformed search technique. The
implementation of Bug algorithm detects obstacles efficiently and ensures that
repetition of path is avoided which in turn saves time. All information from various

2
sensors is processed at the remote terminal. The Robot moves and detects land mines
using magnetometer. A proximity sensor is employed, which helps identifying
obstacles in the path.

The main purpose is to detect the landmine and send its location to end-user. As soon
as a landmine is detected, the camera module attached to the Robot captures an image
of the surroundings. An email is generated through which the captured image is
securely transferred to the registered email address. The security of image
transmission is guaranteed by the implementation of an encryption mechanism based
on DLILL algorithm. The image encryption is made lossless by introducing Integer
Wavelet Transform (IWT). The robot is constructed using robust materials to
withstand devastating situations like high temperature and pressure. The detection
sensor is added to the Raspberry pi 3 and the GPIO pins are assigned to the raspberry
pi 3 processor. Whenever the landmine is detected then the pin will turn high and the
interrupt will be raised by the raspberry pi 3. Our system uses low cost materials to
make the Robot cost effective. Metal detector is used in place of magnetometer which
reduces the cost to a great extent.

3
3. PROBLEM STATEMENT

Most particularly it is very difficult to detect land mines without any risk and
casualties. Even though the Government has invented lot of machines and
technologies to detect landmines, none of them are completely autonomous. The
design of GPS GUIDED ROBOT DRIVEN BY WEB-BASED INTERFACE
provides a means to solve this problem.

In order to eliminate the error in the method involving dead reckoning which
results in error accumulation, we use the GPS module positioning feature along with
an uninformed search technique for the calculation of the position of the robot to
proceed further. If we add the dedicated hardware for the GPS then it needs to
process the positioning and it should send the coordinates back to the processor. The
notable advantage in our proposed system is that it is made to traverse its path
autonomously and does not require any explicit control. The identification of location
of landmine is made even simpler by the camera module determining the image of
the surroundings. The web-based interface clearly depicts the detection of landmines
and obstacles along with the exact location. The path planning algorithm determines
the direction of the robot to be followed dynamically and sends it to the raspberry pi
3 processor.

By using Bug-0 algorithm memory management is taken care of as state


repetition is wisely avoided. Through the built-in Wi-Fi, both the Raspberry Pi 3 and
the web-based interface are connected, thus the data transfer is not delayed due to the
dedicated connection.

4
4. LITERATURE SURVEY

The basis of this project and the source of inspiration is the work done by
Govindaram, B. and Umamakeswari, A. in ‘An autonomous approach for efficient
landmine detection and marking using high sensitive robot’, 2015.

The mine detecting robot can detect a landmine that is buried up to 5 to 10


meters in depth. It’s top speed is 20 cm/sec compared with 15cm/sec in the previous
prototype that allows for scanning the area effectively. The path planning algorithm
used enables in obstacle deflection of the robot that is an enhancement to the existing
prototype helping the robot stay away from detection by the enemy. The robot is
faster and uses no external communication module that can be tampered with. The
robot can be controlled by remote operator through the wireless medium that is
inbuilt. The robot is designed to use the Raspberry Pi-3 which has its processing unit
as ARM 1176JZF-S (armv6k) 700MHz and RISC Architecture with low power draw.
The performance of R-Pi 3 as compared to ATmega128 is thus vastly improved.

The other important aspect is the secured transfer of information regarding the
landmines to the appropriate demining personnel to avoid the intervention of
antisocial groups. The image encryption using Affine Transform operates on
transformation on original image and an XOR operation being performed on this
transformed image to get the encrypted image. This system lacks complexity and
does not provide complete security. The digital encryption which is based on 1D
random scrambling transforms 2D image into 1D vector and then applies random
shuffling to perform anti transformation on the shuffled vector to encrypt the image.
Unfortunately, this image’s histogram reveals excess information so not suitable for
highly secretive information. An Alternate technique uses enhanced play-fair cipher
along with Integer Wavelet Transform (IWT) to work with the image in spatial and
frequency domain and the metrics PSNR, MSE, SSIM and correlation coefficient
values makes it a highly secure and efficient method.

5
5. SOFTWARE/HARWARE REQUIREMENT SPECIFICATION

5.1 GENERAL HARDWARE SPECIFICATION OF RASPBERRY PI 3:

a. SYSTEM-ON-CHIP :
The Broadcom BCM2837 chip provides all the features embedded directly
on the board instead of building them as individual modules. The cost is
greatly reduced owing to this approach.
b. CPU :
It has four high-performance ARM Cortex-A53 processing cores with the speed of
1.2GHz, utilizing 32kB Level 1 and 512kB Level 2 cache memory.

c. GPU :
Broadcom VideoCore IV is an integrated Graphic processor that provides
Tile Based Rendering(TBR).
d. MEMORY :
1GB LPDDR2 (900 MHz) RAM has been provided which helps in improving
the speed of the processor.

e. NETWORKING :

10/100 Ethernet, 2.4GHz 802.11n wireless is the most import feature. The
Raspberry Pi 3 controller has in-built wireless connection that can be
configured to connect with the Wi-Fi in the location.

f. BLUETOOTH :
Bluetooth 4.1 Classic, Bluetooth Low Energy feature makes it stand unique.
g. GPIO :
40-pin header is used to provide inputs to the Raspbian OS.
h. PORTS :
HDMI, 3.5mm analogue audio-video jack, 4 USB 2.0, Ethernet Serial
Interface (CSI), Display Serial Interface (DSI) have been integrated.

5.2. CONFIGURATION OF RASPBERRY PI 3:

Various commands have been used in the process of configuring Raspberry Pi 3.

a. raspi – config :

Raspberry Pi-3 configuration tool of Raspbian is useful as it helps us to easily use


6
features such as the camera, and alter particular settings such as keyboard layout.
Sudo is needed since we will be altering files.

To open the configuration tool , type

sudo raspi-config

b. config.txt :

A file that is used on the boot partition optionally. The Raspberry Pi file of
configuration. It stores the System Configuration Parameters of Raspbian OS. The
GPU reads this file before he ARM Core is initialized. It can be accessed using the
path,

/boot/config.txt

c. Device Trees :

They describe the representation of hardware in the system. Allocation of


resources, loading and management of modules is done by Device Trees(DT). By
this, the problem of managing multiple drivers is eliminated. The hardware
configuration is picturized as a hierarchy of nodes. Each node is divided into
subnodes and carry different properties.

The Device Tree contains :

A required header : /dts-vl/


A single root node : /
A couple of child nodes : node1 and node2

d. Overlay :

A mechanism used to overcome the limitations of Device Trees. Using overlay,


certain fragments can be conditionally included or excluded.

5.3 REQUIRED HARDWARE COMPONENTS:

a. RASPBERRY PI 3 :

A Single Board Computer with 64 bit processor that is ARM based and supports
on-board Wi-Fi is the base for processing data in this project.

b. IR SENSORS :

Based on the concept of reflection of IR signals when they hit a surface. The IR
Receiver receives the signals that bounce from the obstacle.

7
c. L293D:

A 16-pin Integrated Circuit that is capable of controlling the two motors used for
movement of the Robot. It directs the motors simultaneously.

d. PROXIMITY SENSOR:

It emits electromagnetic signals and detects the presence of obstacles by observing


changes in the signal that is returned.

e. MOTORS:

These are the actuators that act in response to the commands from the web-based
interface and the Pi 3 processor. The motors maintain constant torque in order to
enable movement in different directions.

f. MAGNETOMETER:

The magnetometer HMC1022 is proposed to be used here as well. It’s field ranges
reach up to ±6 Gauss. It also enables tri-axis representation for sensitivity depiction.
Additionally, its internal components eliminate effects due to signal loss and
variation in temperature.

g. CHASIS & TYRES:

The chasis provides the base for accommodating all the constituting components
of the Robot and the tyres provides means of movement.

h. JUMPER WIRES:

There are the wires that connect the pins of the Pi 3 processor to the motors and
the motor driver.

5.4 SOFTWARE REQUIREMENTS SPECIFICATION:

5.4.1. Debian’s Apache2 Server Installation and Backend Connection to web


application

The software requirements mainly involve connecting the web application to the
robot so that input can be given to the device. Thus the Raspberry Pi module can get
inputs from the server from the web application and give appropriate commands to its
components. Debian’s Apache2 server is mainly installed on Raspbian OS in the
Raspberry Pi 3. It is a light-weight server which can respond to client requests very
quickly. For this project the client is the remote operator operating the web
application and the server is Raspberry Pi 3.

For the Raspbian OS, apache2 server is installed using the following command on
command prompt. The command is:
8
sudo apt-get install apache2 -y

Through this command, first apache2 package gets installed. Once this installation is
done then web server must be tested. To do this, http://localhost/ can be visited on
PI. This default webpage is located at a directory “/var/www/html” on Raspbian file
system. After web server is tested, then PHP module is installed for Apache. This is
achieved through following command

sudo apt-get install php5 libapache2-mod-php5 –y

Now, PHP files can be processed by Apache server. An index php file is created and
run on Apache server. This index php file is created through following command

sudo nano index.php

This index.php file is accessed through IP address of the raspberry pi.

The following code module is placed in index.php

index.php :

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Robot Control</title>
</head>
<body>
WEB PAGE ON PHP BASED Robot Control:
<form method="get" action="emb.php">
<input type="submit" value="START" name="Start">
<input type="submit" value="STOP" name="Stop">
</form>
<?php
$setmode26 = shell_exec("/usr/local/bin/gpio -g mode 26 out");
if(isset($_GET['start'])){
$anbuemb_on = shell_exec("/usr/local/bin/gpio -g write 26 1");
echo "ROBOT is start";
}
else if(isset($_GET['stop'])){
$anbuemb_off = shell_exec("/usr/local/bin/gpio -g write 26 0");
echo "ROBOT is stop";
}
?>
</body>
</html>

9
<?php
$myfile = fopen("/home/pi/chennai/log.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("/home/pi/chennai/log.txt"));
fclose($myfile);
?>
s

Fig 1: Command prompt of Raspberry Pi OS

Fig 1 shows a screenshot of the command prompt screen for Raspbian OS.

5.4.2 Interfacing with Web application

The PHP code that is shown in our web interface controls the robot. After
interfacing the PHP code to our processor we execute the back-end python code on
the click of the start button on the interface. The controller can stop the robot anytime
he wants by the stop button. On each button click the following python code is
performed.

Python Module 1:

import RPi.GPIO as GPIO


import time
import subprocess

GPIO.setmode(GPIO.BCM)
GPIO.setup(20,GPIO.OUT)
10
GPIO.setup(22,GPIO.OUT)
GPIO.setup(17,GPIO.OUT)
GPIO.setup(16,GPIO.OUT)
GPIO.setup(27,GPIO.OUT)

GPIO.setup(6, GPIO.IN, pull_up_down = GPIO.PUD_UP)


GPIO.setup(12, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(26, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(19, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(13, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)

while True:

if(GPIO.input(13) == 1):
print('metal Detected')
variab='metal Detected'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)
print('CAPTURING IMAGE')
GPIO.output(27, True)
subprocess.Popen( "fswebcam -r 1280x720
/home/pi/chennai/download.png", shell=True )
time.sleep(1)
subprocess.Popen("python /home/pi/chennai/mail.py", shell=True)
time.sleep(1)
else:
print ('Near by nothing about metals')
time.sleep(1)
variab='Near by nothing about metal'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)

if(GPIO.input(6) == 1):
print('Human Detected')
variab='human detected'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)
print('CAPTURING IMAGE')
GPIO.output(27, True)
subprocess.Popen( "fswebcam -r 1280x720
/home/pi/chennai/download.png", shell=True )
11
time.sleep(1)
subprocess.Popen("python /home/pi/chennai/mail.py", shell=True)
time.sleep(1)
else:
print('Near By Nobadys Available')
time.sleep(1)
variab='Near By Nobadys Available'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)

if(GPIO.input(26)==1):

print'forward'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , True)
GPIO.output(17 , True)

elif(GPIO.input(19)==1):

print'backward'
GPIO.output(22 , True)
GPIO.output(20 , True)
GPIO.output(16 , False)
GPIO.output(17 , False)

elif(GPIO.input(12)==1):

print'left'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , True)
GPIO.output(17 , False)

elif(GPIO.input(5)==1):

print'right'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , False)
GPIO.output(17 , True)

12
else:
GPIO.output(22 , False)
GPIO.output(16 , False)
GPIO.output(20 , False)
GPIO.output(17 , False)
time.sleep(2)

GPIO.cleanup()

In the above python code module, the pins are interfaced as input or output
pins. These pins are physically connected to sensor components of the bot. The
uninformed search technique namely Bug algorithm helps the robot traverse a
particular path and send and relay messages regarding landmine location (through the
GPS module) to remote locations either via statuses or mails sent. Meanwhile, on the
event of output from a sensor the corresponding check is being done and the status
displayed.

Python mail module:


import RPi.GPIO as GPIO
from subprocess import call
import time
import os
import glob
import smtplib
import base64
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
import subprocess
import sys

gmail_user = "[email protected]"
gmail_pwd = "*********"
FROM = '[email protected]'
TO = ['[email protected]'] #must be a list

GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.OUT)
GPIO.output(25, False)

time.sleep(1)
msg = MIMEMultipart()
time.sleep(1)
msg['Subject'] ="testing msg send from python"
time.sleep(1)
fp = open("/home/pi/chennai/endownload.png", 'rb')
time.sleep(1)
img = MIMEImage(fp.read())
time.sleep(1)
fp.close()
13
time.sleep(1)
msg.attach(img)
time.sleep(1)
try:
server = smtplib.SMTP("smtp.gmail.com", 587) #or port 465 doesn't seem to
work!
print "smtp.gmail"
server.ehlo()
print "ehlo"
server.starttls()
print "starttls"
server.login(gmail_user, gmail_pwd)
print "reading mail & password"
server.sendmail(FROM, TO, msg.as_string())
print "from"
server.close()
print 'successfully sent the mail'
GPIO.output(25, True)
time.sleep(2)
GPIO.output(25, False)
except:
print "failed to send mail"
GPIO.output(25, False)
GPIO.cleanup()
sys.exit(1)

This module is called on detection of the landmines. Required packages are


downloaded using sudo commands. The sender and receiver mail ids are predefined
and server is being initialised to the mail address. On improper signal from the router
the mail program waits for a maximum of 10 seconds when it displays an error in
mail transfer and continues execution of the main program. On successful wireless
connection however, this mail module then calls the image encryption module that
uses a PlayFair-Cipher technique to encrypt image containing landmine location and
sends the encrypted image.

5.4.3 Path planning module using Bug Algorithm with GPS module
implementation
A web based application is made for path retrieval between source and
destination developed based on path planning using Bug algorithm.
Using Bug algorithm, the Robot can locally sense obstacles and move along
the obstacles until it finds a path. Along with an uninformed search technique that has
been incorporated, the path planning can be made spontaneous and accurate to a great
extent.

import RPi.GPIO as GPIO


import time
import serial
import subprocess

14
port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=3.0)
GPIO.setmode(GPIO.BCM)
GPIO.setup(20,GPIO.OUT)
GPIO.setup(22,GPIO.OUT)
GPIO.setup(17,GPIO.OUT)
GPIO.setup(16,GPIO.OUT)
GPIO.setup(27,GPIO.OUT)

GPIO.setup(6, GPIO.IN, pull_up_down = GPIO.PUD_UP)


GPIO.setup(12, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(26, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(19, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(13, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(5, GPIO.IN, pull_up_down = GPIO.PUD_UP)
data=''

while True:
rcv = port.read(1)
while(rcv is not 'L'):
rcv = port.read(1)
if(rcv=='L'):
for i in range(0,25):
rcv = port.read(1)
data = data+rcv
variab='L13.539,,192132.086,V,N*7E'+data
f=open('log.txt','w')
f.write(variab)
f.close()

print data
if(GPIO.input(13) == 1):
GPIO.output(27, True)
print("metal detected at gps value:"+data)
variab='metal Detected'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)
print('CAPTURING IMAGE')

subprocess.Popen( "fswebcam -r 1280x720


/home/pi/chennai/download.png", shell=True )
time.sleep(1)
subprocess.Popen("python /home/pi/chennai/mail.py", shell=True)
time.sleep(1)

else:
print ('Near by nothing about metals')
time.sleep(1)
15
variab='Near by nothing about metal'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)

if(GPIO.input(6) == 1):
print('Obstacle Detected')
variab='obstacle detected'
f=open('log.txt','w')
f.write(variab)
f.close()
time.sleep(1)
print('CAPTURING IMAGE')
GPIO.output(27, True)
subprocess.Popen( "fswebcam -r 1280x720
/home/pi/chennai/download.png", shell=True )
time.sleep(1)
subprocess.Popen("python /home/pi/chennai/mail.py", shell=True)
time.sleep(1)
#right
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , False)
GPIO.output(17 , True)
time.sleep(5) #right delay time

# 'left'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , True)
GPIO.output(17 , False)
time.sleep(5) #left delay time

print'forward'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , True)
GPIO.output(17 , True)

# 'right'

else:
print('Near By No object Available')
time.sleep(1)
variab='Near By No object Available'
f=open('log.txt','w')
16
f.write(variab)
f.close()
time.sleep(1)

if(GPIO.input(26)==1):

print'forward'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , True)
GPIO.output(17 , True)

elif(GPIO.input(19)==1):

print'backward'
GPIO.output(22 , True)
GPIO.output(20 , True)
GPIO.output(16 , False)
GPIO.output(17 , False)
time.sleep(2)
GPIO.output(22 , False)
GPIO.output(16 , False)
GPIO.output(20 , False)
GPIO.output(17 , False)

elif(GPIO.input(12)==1):

print'left'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , True)
GPIO.output(17 , False)
time.sleep(2)
GPIO.output(22 , False)
GPIO.output(16 , False)
GPIO.output(20 , False)
GPIO.output(17 , False)

elif(GPIO.input(5)==1):

print'right'
GPIO.output(22 , False)
GPIO.output(20 , False)
GPIO.output(16 , False)
GPIO.output(17 , True)
time.sleep(2)
17
GPIO.output(22 , False)
GPIO.output(16 , False)
GPIO.output(20 , False)
GPIO.output(17 , False)
else:
GPIO.output(22 , False)
GPIO.output(16 , False)
GPIO.output(20 , False)
GPIO.output(17 , False)
time.sleep(2)

GPIO.cleanup()

The additional snippet added to the basic code shows that Bug algorithm is
implemented along with a GPS module locating the robot every 10 seconds or so.

5.4.4 Secure Information transfer through Image encryption using DLILL


algorithm

A separate file is prepared that contains the DLILL algorithm implementation.


This code then has to be called every time on the detection of landmine-like objects
through sensor information.

Python code for Secure Image Encryption and Decryption :


DLILL Encryption :
from PIL import Image
import math
import numpy as np
def playfair(image,playkey):
factor = 0.5
dim = image.size
in_image = []
original = image.load()
for j in range(dim[1]):
for i in range(dim[0]):
in_image.append(original[i,j])
c=0
m=0
ix = 0
iy = 0
jx = 0
jy = 0
cipher_image = []
while(m<len(in_image)):
x = in_image[m]
y= in_image[m+1]
for i in range(16):
18
for j in range(16):
if playkey[i][j] == x:
ix = i
jx = j
if playkey[i][j] == y:
iy = i
jy = j
if x == y:
if ix == 15:
ix = -1
if jx == 15:
jx = -1
cipher_image.append(playkey[ix+1][jx+1])
cipher_image.append(playkey[ix+1][jx+1])
elif ix == iy and jx != jy:
if jx == 15:
jx = -1
if jy == 15:
jy = -1
cipher_image.append(playkey[ix][jx+1])
cipher_image.append(playkey[iy][jy+1])
elif ix != iy and jx == jy:
if ix == 15:
ix = -1
if iy == 15:
iy =-1
cipher_image.append(playkey[ix+1][jx])
cipher_image.append(playkey[iy+1][jy])
elif ix != iy and jx != jy:
cipher_image.append(playkey[ix][jy])
cipher_image.append(playkey[iy][jx])
m += 2
final_image = []
c=0
for j in range(dim[1]):
final_image.append([])
for i in range(dim[0]):
final_image[j].append(cipher_image[c])
c += 1
im = Image.new("L",(dim[0],dim[1]))
im_load = im.load()
for i in range(dim[0]):
for j in range(dim[1]):
im_load[i,j] = final_image[j][i]
im.save("("/home/pi/chennai/download.png"")

key = 7
image = Image.open("("/home/pi/chennai/download.png"").convert("L")
np.random.seed(key)
19
playkey = [i for i in range(256)]
playkey = np.random.permutation(playkey)
playkey = np.array(playkey).reshape(16,16)
print playkey
playfair(image,playkey)

DLILL Decryption :
from PIL import Image
import numpy as np
import math

def playfairdec(image,playkey):
factor = 0.5
dim = image.size
in_image = []
original = image.load()
for j in range(dim[1]):
for i in range(dim[0]):
in_image.append(original[i,j])
c=0
m=0
ix = 0
iy = 0
jx = 0
jy = 0
cipher_image = []
while(m<len(in_image)):
x = in_image[m]
y= in_image[m+1]
for i in range(16):
for j in range(16):
if playkey[i][j] == x:
ix = i
jx = j
if playkey[i][j] == y:
iy = i
jy = j
if x == y:
if ix == 0:
ix = 16
if jx == 0:
jx = 16
cipher_image.append(playkey[ix-1][jx-1])
cipher_image.append(playkey[ix-1][jx-1])
elif ix == iy and jx != jy:
if jx == 0:
jx = 16
if jy == 0:

20
jy = 16
cipher_image.append(playkey[ix][jx-1])
cipher_image.append(playkey[iy][jy-1])
elif ix != iy and jx == jy:
if ix == 0:
ix = 16
if iy == 0:
iy =16
cipher_image.append(playkey[ix-1][jx])
cipher_image.append(playkey[iy-1][jy])
elif ix != iy and jx != jy:
cipher_image.append(playkey[ix][jy])
cipher_image.append(playkey[iy][jx])
m += 2
final_image = []
c=0
for j in range(dim[1]):
final_image.append([])
for i in range(dim[0]):
final_image[j].append(cipher_image[c])
c += 1

im = Image.new("L",(dim[0],dim[1]))
im_load = im.load()
for i in range(dim[0]):
for j in range(dim[1]):
im_load[i,j] = final_image[j][i]
im.save("lenaFinal1.png")
key = 7
np.random.seed(key)
playkey = [i for i in range(256)]
playkey = np.random.permutation(playkey)
playkey = np.array(playkey).reshape(16,16)
image = Image.open("("/home/pi/chennai/download.png"")
playfairdec(image,playkey)

Using DLILL algorithm, in the image captured by the camera module, the
IWT (Inverse Wavelet Transform) is applied to get 4 different matrices with
transformed values. Leaving the LL matrix undisturbed while encrypting all the 4
matrices obtained by IWT, followed by combining all the matrices and applying
Inverse IWT gives the resultant encrypted image. This method gives a maximum
encryption with minimal loss in the image data. The advantages of this technique is
that unlike all other image encryptions which works either in spatial or frequency
domains, this method combines both the frequency domain (by conversion from
spatial to frequency domain) and spatial domain (after encryption of frequency
domain intermediate) aspects on decryption of the image there is zero mean square
error and the original image is obtained back lossless.

21
6. Conceptual Model / Proposed Architecture

Fig 2: Basic block diagram of the Proposed system

The prototype design is depicted in Fig 2. The magnetometer connected to the


Raspberry Pi3 is used for sensing the landmines. The update from AT Mega 128
microcontroller to Raspberry Pi3 has enabled better and easier way of interfacing
with mine detection sensors. The localization data from the GPS module is
dynamically conveyed to the remote terminal that greatly reduces memory
requirement from Raspberry Pi3‘s point of view. The UI developed for the control of
the robot reports status of detection of metals or obstacles based on sensor
information.

Differential steering along with the GPS is used in marking the correct
location of the bot. A high precision proximity sensor and two other IR sensors
position at the right and left side of the robot helps in obstacle detection and
corresponding deflection based on bug algorithms.

The in-built Wi-Fi in Pi 3 helps establish communication between the Pi in


the robot and remote control stations. An uninformed search technique helps the
robot to traverse it from a given location to another without the actual knowledge of
the entire environment. The robot called Mine Hunter Beta version has many physical
and economic highpoints such as area dimensions of 18.5 cm × 9.5 cm and weighs
only 0.77 kg. The usage of two 9V batteries to power the wheels, power source for
motion can be replaced in quite an economic way. Mine Hunter Beta Version has an
on board rechargeable power bank that can power it for 4 hours, that is significantly
more than the previous prototype’s power time.
22
GPIO PINS FOR RASPBERRY PI 3:

Fig 3: GPIO Pin Diagram for Landmine Detection Robot controlled web-based user
interface
This diagram Fig 3 shows the GPIO pins and the different pins which are present in
the Raspberry Pi 3, mainly there are common and special keys, common keys are
GPIO pins, ground and VCC of 5v and 3.3v. Special pins contains the power, UART,
GND, SPI, PC and also some kinds of GPIO.

23
COMPONENTS OF THE ROBOT:

(a) PIR Sensor BIS0001 (b)Magenetometer

FIG - 4 : Components used

VARIOUS VIEWS OF THE ROBOT :

(a)Front view (b) Top view (c) Side view

FIG – 5 : Various views of the Robot

Figures 4 and 5 show the various components of the MineHunter Beta version and
the views of the bot respectively.

24
7. INTERACTION SCENARIO:
USECASE DIAGRAM:

Fig 6: Use case diagram for landmine detection robot

In this Use case diagram shown in Fig 6, end-user is the remote controller who is
interacting with the robot for its operation. The controller interacts with the robot
through web application which acts as an interface to Debian’s Apache2 server php
program. The input given in terms of the button pressed (be it start or stop button) is
processed through php program in Apache Server. In Apache Server, as shown in Fig
several steps take place and according to sensor information the output is delivered to
end-user.
On processing this data in server, these values and inputs will be passed to
Raspberry Pi 3 processor, which connects to L293D that drives the motor, moves
along a path with the help of uniformed search technique, and detect landmines.
Along the way if obstacles are encountered then path is changed and obstacle is
deflected or if landmines are detected then an image of the surroundings is captured
and sent along in an encrypted format using IWT and Play-Fair Cipher method to the
demining team.
25
Use case Diagram (Fig: 6) Process flow:

1. Robot operator to web application interface


2. End User gives input to device through server
3. Server processes these inputs from GUI.
4. Data is then sent to Raspberry Pi-3.
5. The robot moves along the path obtaining sensor information continuously.
6. Robot deflects obstacles or detects landmines and sends mail to demining
team.

26
ACTIVITY DIAGRAM:

ACTIVITY DIAGRAM FOR WEB APPLICATION TO APACHE2 SERVER

Fig 7(a). Activity diagram for landmine detection robot

27
In this Activity diagram shown in Fig 7, processes involved in this robot are
explained. Through the connection between interface web application and Debian’s
Apache2 server inputs received at the GUI are sent to the Raspberry Pi 3 processor.
The web application provides an interface to the php program run on the server. Input
to the web application is processed via the php program in Apache Server. The figure
shown in Fig, explains the various flows in activity as delivered to the remote
controller and demining team.

Data in the PHP Server will be passed as inputs to the Raspberry Pi 3


processor. This in turn connects to the L293D module which drives Mine Hunter
Beta version’s motor and moves on the area deflecting obstacles along the path and at
the same time locating landmines through GPS and sending valuable information to
the demining team regarding the landmines location in an encrypted format.

Activity Diagram (Fig 7(a).) Process flow:

1. Robot operator to web application.

2. Selecting start or stop Button.

3. If start is pressed, robot moves in a path.

4. It deflects obstacles and detects landmines.

5. On landmine detection mail is sent with encrypted information.

6. If stop is pressed, robot stops its movement.

28
ACTIVITY FLOW DIAGRAM FOR MOTOR MOVEMENT

Fig 7 (b): Activity diagram for motor movement in landmine detection robot

In this second Activity diagram shown in Fig. 7(b), basic flow of processes is
explained along with the connection between Debian’s Apache2 Server and
Raspberry Pi 3 robot. Based on button pressed in PHP server, the input is passed to
processor which in turn connects to L293D that drives the motor and moves along the
path deflecting obstacles on the way and detecting landmines whenever
magnetometer sends information to the processor. On stop button the robot stops its
movement until the next time the start button is chosen.

29
Activity Diagram (Fig 7 (b)) process flow:

1. Remote controller to web application.

2. Web application to Apache2 Server.

3. PHP server input data to Raspberry Pi-3 processor.

4. Raspberry Pi-3 processor to GPIO pins in it.

5. GPIO pins to motor using L293D.

30
CLASS DIAGRAM:

Fig 8: Class Diagram for landmine detection robot

The class diagram shown above in Fig 8 has four classes namely, Application,
Apache Server, Raspberry Pi and Motor Driver. These 4 classes consists of the main
components involved in this project thus in turn helps in achieving project objective.
Each of these classes contains many attributes that decides the properties of class.
They interact with each other for successful functioning of bot.

31
Class Diagram Process Flow:

1. Web application to Debian’s Apache2 Server.

2. The classes contain attributes and functions.

AN EXAMPLE:

 The application consists of attributes and functions shown as follows:


 Attributes:

1. Application Name
2. Application Interface
3. Application Backend

 Functions:

1. PHP File Execution


2. Python File Execution

 In the following way all the class Diagrams are linked :


1. Web application to Debian’s Apache2 server.
2. Apache2 Server to Raspberry pi-3.
3. Raspberry pi-3 to Actuators and Motor Driver.

32
SEQUENCE DIAGRAM:

Fig 9: Sequence Diagram for landmine detection robot

This sequence diagram (in Fig 9) shows the various processes according to the
sequence in which they take place. At each stage the input received from the web
application is sent to the Raspberry Pi 3 processor through the Apache 2 server. As
the input start button is pressed the Raspberry pi 3 actuators give input to motors to
start moving. According to the path planning technique used the robot moves along a
path at the same time looking for obstacles or landmines. If an obstacle is
encountered the robot deflects from the obstacle and follows the boundary of the
obstacle until it can move along the same path again. Once a landmine is detected the
camera module in the robot captures an image and sends it to the demining team mail
id. To ensure more secure transfer of the landmine location it encrypts the image and
sends it. All this while the GPS module keeps track of robot location

Sequence Diagram process flow:


1. Remote operator to web application
interface
2. Remote operator uses command prompt
and web application Tools

3. Apache2 server processes this inputs from web application.

4. This processed data is sent to Raspberry pi.

33
5. The robot moves by uninformed search technique
continuously.
6. Robot detects landmines and deflects obstacles.
7. Robot sends mail on landmine detection.

34
COLLABORATION DIAGRAM

Fig 10: Collaboration diagram for landmine detection robot

The diagram shown in Fig 10 explains how the various objects in this project
are organized. It shows the communication between the objects which transfer
information through send and receive messages. It depicts the dynamic nature of this
system. Various objects like Robot Operator, Apache sever communicate with each
other and transfer system related messages that helps in its success.

Process Flow:
1. Robot operator uses the web-application interface.
2. Web application interface gives status.
3. Debian’s Apache2 Server gives input information to Raspberry Pi3.
4. Raspberry Pi-3 traverses path with uninformed search.
5. Landmines are detected by giving status info and command line.
6. Image is captured and sent through mail.

35
8. Methodology and Approach:
Module No. 1: Assembling Robot and Integrating with Remote Desktop

The Robot is assembled with all its components controlled by Raspberry Pi 3 micro-
controller, operated through the remote desktop connection with a client server
connection through the static IP of the raspberry pi. Raspberry pi consists of a
memory interface where Raspbian operating system is loaded and used for accessing
the files that are loaded into the Micro-controller. Input is given from the connected
desktop to controller board, which sends the necessary signal to the actuators
(motors) depending on the input received. Establishing remote desktop connection is
done by the built-in WiFi, a powerful feature incorporated in Raspberry Pi 3. The
Raspbian operating system is loaded into the desktop for accessing, executing the
tasks of the robot.

Module No. 2: Integrating web-based interface with the Robot to obtain the
GPS location and drive the Robot depending on the path planning algorithm.

At this stage of project, we interface the robot with a web-based application deployed
in a desktop. The web application use the path planning algorithm, based on bug
algorithm and an uninformed search technique for navigation. The application is
guided by a GPS module to denote the location of the robot and the obstacles
frequently. Based on the decisions obtained from the algorithm, the subsequent
direction of motion of the robot is identified and the robot is made to trace through
the path for detecting the landmines.

Module No. 3: Integrating Metal Detector with the Robot and Sending Mail to
the End-User upon detection of Landmines.

In this phase of project, we attach a landmine detection module (metal detector IC) to
the robot. In the location where landmine gets detected an interrupt is generated and
sent to Raspberry Pi 3 controller which in-turn sends a signal to the web interface.
The web-based interface receives this signal from raspberry pi and sends
corresponding GPS location and an encrypted image of the landmine’s surroundings
to the registered user through mail.

Apache2 Server:

Apache Server is a light-weight server which can respond to client requests very
quickly. In this project, Debian's Apache2 default configuration is used which is
different from the upstream default configuration, and split into several files
optimized for interaction with Debian tools. The configuration system is fully
documented in /usr/share/doc/apache2/README.Debian.gz.

36
9. Output/Results:

Fig 11: Output Screen of Web application controlling Robot

In the above Fig 11, the web application is shown that can help remote users control
the robot. Since we have designed it for an autonomous operation it contains only
start and stop buttons.

37
The various cryptographic algorithms run on Raspberry pi 3 shows the following
results as in FIG 12.

TIME ELAPSED
2.5

1.5

TIME ELAPSED

0.5

0
EPC SLILL SLIA DLILL

FIG 12- Method versus Time elapsed for various algorithms

Hence DLILL method for encryption implemented in the prototype shows lesser
response time and is most optimal.

38
Fig 13: Output Screen showing snippets of the main code execution

In the above output screen (Fig 13), a sample execution of the program is shown.
Note GPS locations shown in the program that would inform the remote operator of
the mine location. On successful detection a mail is also sent.

39
Figures 14 and 15 below show the mail generated from one mail id to another with
the image sent.

Fig 14: Shows mail sent from [email protected] to [email protected]

40
Fig 15: Shows the mail with the decrypted image

41
10. Conclusion:

Thus, the main goal of building a Robot monitored by a web-based interface is to


provide a completely autonomous robot for the detection of the land mines without
any casualties is achieved. This robot can be used in the military applications where
risk for human life is the maximum. The given local environment is scanned
thoroughly with minimal false alarms and a better accuracy. The prototype is has
light-weight, commercially available components which are cost effective which
makes it a better solution for mine hunting without involving much manual
interaction. The free movement of the robot is also enhanced as well as owing to its
weightlessness, the ability to detect mines without detonating them makes this model
a suitable choice. The user-interface is minimal and is aimed at satisfying personnel
with a non-technical background. The transfer of image using Wi-Fi through
electronic mail system achieved by the enhanced play-fair cipher encryption adds the
security factor of the robot. The camera module ensures that the images of the
environment are captured accurately in case if a landmine is detected. The future
scope of the project lies in introducing better methods for path planning and more
efficient encryption strategies while testing the robot in different environments and
scenarios, taking into consideration the weather factors. The overall optimization of
the robot in terms of cost effectiveness, accuracy and the algorithmic complexity can
also be improved in the future versions of the project.

42
11) References:

[1] Govindaram, B. and Umamakeswari, A. ‘An autonomous approach for


efficient landmine detection and marking using high sensitive robot’, Int.
J. Advanced IntelligenceParadigms, Vol. 7, Nos. 3/4, pp.280–291, 2015.
[2] James M. Sabatier , Advances in Acoustic Landmine Detection,National
Center for Physical Acoustics University of Mississippi1 Coliseum Drive
University, MS 38677 USA
[3] Mark Fisher, Marcus laGrone, Colin Cumming, Utilization of Chemical
Vapor Detection of Explosives as a Means of Rapid Minefield Area
Reduction Eric Towers Nomadics, Inc.
[4] Michael O’Connor, Thomas Bell, Gabriel Elkaimand Dr. Bradford
Parkinson ,Automatic Steering of Farm Vehicles Using GPS, Stanford
University Stanford, California
[5] Dr. Riad I. Hammoud (Ed.) Augmented Vision Perception in Infrared
Algorithms and Applied Systems
[6] Mohit Kumar, Akshat Aggarwal and Ankit Garg,A Review on Various
Digital Image Encryption Techniques and Security Criteria International
Journal of Computer Applications (0975 – 8887) Volume 96– No.13 , June
2014,
[7] Sudharshan Chakravarthy1*, S. Prasanna Venkatesan1, J. Madhav
Anand1 and J. Jennifer Ranjani,Enhanced Playfair Cipher for Image
Encryption using Integer Wavelet Transform
[8] A Simple Local Path Planning Algorithm for Autonomous Mobile Robots
Buniyamin N., Wan Ngah W.A.J., Sariff N., Mohamad,.
[9] James Trevelyan*, SabbiaTilli, Bradley Parks and Teng Han Chiat
,Farming minefields: economics of remediating land with moderate
landmine and UXO,.
[10] Atikah JANIS & Abdullah BADE ,Path Planning Algorithm in Complex
Environment: A Survey * Mathematics,
[11] Pankaj C. Bhope1, Anjali S. Bhalchandra2 ,Various Landmine Detection
Techniques: A Review.
[12] PaddyBlagden, Brigadier (retd),Mine Detection and the need for new
technology, Geneva International Centre for Humanitarian Demining.
[13] Muhammad Zubair, Mohammad Ahmad Choudhry ,Land Mine Detecting
Robot Capable of Path Planning
[14] Nguyen TrungThành, HichemSahli, And DinhNhoHào,IEEE Transactions
On Geoscience And Remote Sensing, Vol. 46, No. 12, 3987 Infrared
Thermography For Buried Landmine Detection: Inverse Problem Setting,
December 2008.

43

You might also like