WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT...

113
i WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in Fulfillment of the Requirements For the Bachelor of Computer Engineering (Hons) in the Malaysian Institute of Information Technology, University Kuala Lumpur 2013

Transcript of WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT...

Page 1: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

i

WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY

(RF)

MOHAMAD EDWAN BIN SAINEE

Dissertation Submitted in Fulfillment of the Requirements

For the Bachelor of Computer Engineering (Hons)

in the Malaysian Institute of Information Technology,

University Kuala Lumpur

2013

Page 2: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

iv

COPYRIGHT PAGE

Declaration of Copyright and Affirmation of Fair Use of Unpublished

Research Work as stated below:

Copyright @ 29/04/13 by Mohamad Edwan Bin Sainee (52252210346), All rights reserved for Subbot

No part of this unpublished research may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic,

mechanical, photocopying, recording or otherwise without the prior written permission of the copyright holder except as provided below:

i. Any material contained in or derived from this unpublished research

may only be used by others in their writing with due acknowledgement.

ii. MIIT UniKL or its library will have the right to make and transmit

copies (print or electronic) for institutional and academic purposes iii. The MIIT UniKL’s library will have the right to make, store in a

retrieval system and supply copies of this unpublished research if requested by other universities and research libraries.

Page 3: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

v

DEDICATION

I would like to dedicate this Final Year Project report to my beloved

parents for the undivided supports.

Last but not least, to my supervisor, Miss Hannah Sofian, lecturers and friends

for the support and encouragement in completing this project.

Page 4: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

vi

ACKNOWLEDGEMENT

Alhamdulillah. All praises to Allah SWT, whom with His willing giving me the

opportunity and strength to complete this Final Year Project with the title Subbot.

This final year project report was prepared for University Kuala Lumpur (UniKL)

to complete the undergraduate Bachelor of Computer Engineering programme.

Firstly, I would like to express my deepest and sincere gratitude to my

supervisor, Miss Hannah Sofian, who had guided me during two semester’s

session 2012/2013 and thanks for her detailed review, constructive criticism and

excellent advice during the preparation of this project and this report. The

guidance given is deeply appreciated.

I also would like to express sincere thanks to my dear Nur Azzwa Bte Mohd

Asrim for her cooperation, valuable information, suggestions and guidance in the

completion of this final year project.

Deepest thanks and appreciation to my parents, family, and others for their

cooperation, encouragement, constructive suggestion and full of support for the

report completion, from the beginning till the end. Also thanks to all of my

friends, those have been contributed by supporting my work during the final year

project progress till it is fully completed.

Page 5: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

vii

TABLE OF CONTENT

Page No

Title Page i

Declaration Page ii

Approval Page iii

Copyright Page iv

Dedication v

Acknowledgement vi

Table of Contents vii

List of Figures xi

List of Table xiv

List of Abbreviation xv

Abstract xvi

Abstrak xviii

CHAPTER 1: INTRODUCTION

1.1 Project Background 1

1.2 Problem Statement 2

1.3 Purpose and Objectives 2

1.4 Project Scope 3

Page 6: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

viii

1.5 Project Limitation 3

1.6 Project Beneficial/Contribution 4

CHAPTER 2: LITERATURE REVIEW

2.1 Ballast System

2.1.1 Introduction 5

2.1.2 Ballast tank 6

2.2 Proposed Design

2.2.1 Direct current (DC) Motor 7

2.2.2 Radio Control 8

2.2.3 Wireless 9

2.2.4 Camera 10

2.2.5 USB DVR 12

2.2.6 Receiver 13

CHAPTER 3: METHODOLOGY

3.1 Introduction

3.2 Project Development Flowchart 16

3.3 Function Subbot Flowchart 17

3.4 Diagram

3.4.1 Block Diagram 18

3.4.2 General Block Diagram 18

3.4.3 Overview (Controller and Display Interface) 19

3.4.4 Logical Block Diagram 20

Page 7: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

ix

3.5 Hardware Requirement 20

3.6 Software Requirement 21

3.7 Image processing program 26

3.8 About color, shape and object detection 27

3.9 Costing and budget 29

CHAPTER 4: PROTOTYPE / PRODUCT DEVELOPMENT

4.1 Introduction

4.2 Project development tools required 31

4.3 Stages of Development 33

4.3.1 Hardware installation 35

4.3.2 Software installation 35

4.3.3 Development of prototype & coding 41

4.3.4 Stages of hardware installation 58

4.3.5 Stages of software installation for Subbot 63

4.3.6 Project prototype for Subbot 69

4.3.7 Project prototype for Subbot controller 69

CHAPTER 5: RESULT AND TESTING

5.1 Introduction

5.2 Purpose and Objective of testing 70

5.3 Flowchart for Subbot testing 71

5.4 Hardware testing 74

5.4.1 Remote Controller 74

Page 8: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

x

5.4.2 Charging Battery 75

5.4.3 Display 76

5.5 Operation testing 77

5.6 Result analysis 78

CHAPTER 6: CONCLUSION 79

RECOMMENDATION 81

Page 9: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xi

LIST OF FIGURE

Figure 2.1: Overall View of a Submarine 6

Figure 2.2: DC motor 8

Figure 2.3: Submarine Remote Controller 9

Figure 2.4: Waterproof Wireless Camera 11

Figure 2.5: Internal Rechargeable Battery 11

Figure 2.6: USB EasyCap DVR 13

Figure 2.7: Morse Types Receiver 14

Figure 3.1: Flow Chart Development 16

Figure 3.2: Function Flow Chart 17

Figure 3.3: Block Diagram 18

Figure 3.4 General Block Diagram 18

Figure 3.5: Controller Interface 19

Figure 3.6: Camera Display 19

Figure 3.7: Logical Block Diagram 20

Figure 3.8: Microsoft Visual Basic 6.0 Interface 21

Figure 3.9: PCB Wizard 3.50 Interface 22

Figure 3.10: PCWH 23

Figure 3.11: PIC Kit Burner 23

Figure 3.12: PIC Kit 2 24

Figure 3.13: MATLAB Software 26

Figure 3.14: Processing Mobile Robot Flowchart 28

Figure 4.1: PCB Development Tools 31

Page 10: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xii

Figure 4.2: PCB Assembly Tools 32

Figure 4.3: Project Development Flowchart 34

Figure 4.4: Welcome wizard to start up a new project 37

Figure 4.5: PCWH Window 38

Figure 4.6: Step by step to program the PIC16F877a microcontroller 38

Figure 4.7: PICkit2 Window 39

Figure 4.8: PIC 16F877 Programming Successful 40

Figure 4.9: Remote Controller Circuit 41

Figure 4.10: Modified Remote Controller 41

Figure 4.11: Circuit Diagram Voltage Regulator Module 42

Figure 4.12: Pin outs for the MAX-232, RS-232 Driver/Receiver 43

Figure 4.13: Typical MAX-232 Circuit 44

Figure 4.14: PIC 16F877/874 Diagram 45

Figure 4.15: Relay 48

Figure 4.16: Circuit for controlling an AC 49

Figure 4.17: Interfacing Devices to RS-232 Ports 50

Figure 4.18: TTL/CMOS Serial Logic Waveform 51

Figure 4.19: RS-232 Logic Waveform 52

Figure 4.20: Plug RS-232 USB Converters into USB Port. 53

Figure 4.21: Design the Circuit 58

Figure 4.22: PCB Circuit Design 59

Figure 4.23 (a): Click “Next” 60

Figure 4.23 (b): Install RS-232 USB Converter is finish 61

Figure 4.23 (c): Plug RS-232 USB Converter into USB Port 61

Figure 4.23 (d): Check port at Device Manager 62

Figure 4.24 (a): Install Visual Studio 2008 63

Figure 4.24 (b): Copy Setup Files 64

Figure 4.24 (c): Click “Next” 64

Page 11: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xiii

Figure 4.24 (d): Key in “Product Key” and click Next 65

Figure 4.24 (e): Install is running and waiting until finish 65

Figure 4.25 (a): Insert PIC into PIC Programmer socket. 66

Figure 4.25(b): Winpic800.exe installer 67

Figure 4.25 (c): Select proper PIC name in the top right combo box. 67

Figure 4.25 (d): Start download program into PIC 68

Figure 4.26: Already made Submarine (Toy Submarine). 69

Figure 4.27: Submarine Remote Controller 69

Figure 5.1: Testing Flow Chart 73

Figure 5.2: Controller Circuit 74

Figure 5.3: Controller Interface 74

Figure 5.4: Battery Charging 75

Figure 5.5: Displaying Image 76

Figure 5.6: Image Captured 76

Figure 5.7: Controller Interface (2) 77

Figure 5.8: Subbot with Camera 78

Figure 5.9: Subbot Submerged in water 78

Page 12: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xiv

LIST OF TABLE

Table 3.1: Costing and Budget

Table 4.1: Key Feature PIC Micro 46

Table 4.2: Component List 56

Table 4.3: Project Wiring 57

Page 13: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xv

LIST OF ABBREVIATION

Radio Controller RC

Direct Current DC

Complementary metal–oxide–semiconductor CMOS

Universal Serial Bus USB

Digital video recorder DVR

Video Cassette Recording VCR

Printed circuit board PCB

Hexadecimal HEX

Analog-to-digital A/D

Analog Current AC

Central Processing Unit CPU

Graphical User Interface GUI

Lighting Emitter Diode LED

Programmable Integrated Circuit PIC

Radio Frequency RF

University Kuala Lumpur UniKL

Remotely Operated Vehicle ROV

Polyvinyl chloride PVC

Page 14: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xvi

ABSTRACT

Submarine has becomes one of the important tools in many fields such

as in research studies, education, and also for an exploration hobby underwater.

A submarine is a watercraft which is capable of independent operation

underwater. For general purposes, the submarine is operated via RC (radio

control) which is often used in underwater monitoring. By using the RC

submarine, it can reduce the risk of being underwater by human physically when

conducting a research activity. Currently, the available RC submarines in

Malaysian’s market are expensive and it is hard to find due to limited supplier as

well as there is no local product of the RC submarine yet. So, this project is

conducted to come out with an underwater robotic that has a new design which

is a RC submarine with onboard wireless camera using prototyping

methodology. The main components used to build this RC submarine are readily

made submarine toy, controller system and wireless water resistant camera.

Furthermore, a computer will be used as a remote to control the submarine. As a

result of this project, a RC submarine with onboard wireless water resistant

camera prototype will be invented with an optimum cost and using a good quality

parts. Based on the specification given by the toy submarine, this prototype

RC submarine can dive in as far as 30 meter underwater by taking on water

ballast and expelling to surface again, or dynamically by forces acting on the

dive planes. The best place to use it is in clear, see-through water such as a

clean aquarium, not-too-heavily chlorinated pool, or a freshwater lake that is free

Page 15: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xvii

from garbage. The specialty of this RC submarine is it uses a wireless water

resistant camera which makes it able to capture photos and videos underwater

clearly. For research, education and hobby purposes, this RC submarine can be

used in a fish tank to capture photos and videos without interfering the nature life

of the fishes inside the tank while for monitoring purpose, this RC submarine can

be used to monitor inside an aquarium to find out if there is any crack on the

aquarium’s glass. [20]

Page 16: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xviii

ABSTRAK

Kapal selam telah menjadi salah satu alat penting dalam pelbagai bidang

seperti dalamaktiviti penyelidikan, pendidikan, dan juga untuk penerokaan hobi

bawah air. Kapal selamadalah sebuahkapal air yangmampu beroperasi di dalam

air. Bagi tujuan umum, kapal lautdikendalikan melalui RC (radio kawalan) yang

sering digunakan dalam pemantauan dalam air. Dengan menggunakan kapal

selam RC, ia boleh mengurangkan risiko manusia berada dalam air dari segi

fizikal apabila menjalankan aktiviti penyelidikan. Pada masa kini, kapal selam

RC yang tersedia dalam pasaran di malaysia adalah mahal dan sukar untuk

didapatidisebabkan oleh bilangan pembekal yang terhad serta tiada produk

tempatan kapal selam RC lagi di malaysia. Jadi, projek ini dijalankan untuk

menghasilkansatu robot bawah air yang mempunyai reka bentuk baru iaitu kapal

selam RC dengan kamera tanpa wayar dengan menggunakan metodologi

prototaip. Komponen-komponen utama yang akan digunakan untuk membina

kapal selam RC ini adalahkapal selam mainan, sistem pengawal dan

kamerakalis air tanpa wayar. Selain itu, komputer riba juga akan digunakan

sebagai alat kawalan jauh untuk mengawal kapal selam itu. Hasil daripada

projek ini,sebuah prototaip kapal selam RC dengan kamera kalis air tanpa wayar

atas pesawat akan dicipta dengan kos yang optimum dan menggunakan bahan-

bahan yang berkualiti. Kapal selamRC prototaip ini boleh menyelam sejauh 30

meter di dalam air dengan menggunakan balast air dan timbul ke permukaan

air, atau dengan paksaan dinamik ke atas kapal menyelam. Tempat terbaik

Page 17: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

xix

untuk menggunakan kapal selam ini adalah di tempatyang jelas, lutsinar seperti

di dalam akuarium yang bersih, kolam yang tidak terlalu banyak

kandunganklorin dalam air, atau dalam tasik air tawar yang bebas daripada

sampah. Keistimewaan kapal selam RC ini adalah ia menggunakan kamera

tanpa wayar kalis air yang menjadikan ia mampu untuk menangkap gambar-

gambar dan rakaman video di dalam air dengan jelas. Untuk tujuan

penyelidikan, pendidikan dan hobi, kapal selam RC ini boleh digunakan dalam

tangki ikan untuk menangkap gambar dan merakan video tanpa mengganggu

kehidupan alam semula jadi ikan-ikan di dalam tangki manakala bagi tujuan

pemantauan, kapal selam ini RC boleh digunakan untuk memantau keadaan di

dalam akuarium untuk mengetahui jika terdapat mana-mana retak pada

permukaan kaca akuarium.

Page 18: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

1

CHAPTER 1

INTRODUCTION

This chapter will give an introduction about the project background,

objectives and the scopes of this project. This chapter also will state the problem

statements and project limitations.

1.1 Project Background

Nowadays, the development of submarine manufacturing are still

developing in many countries such as Russia, China, America and others big

nations that had the technology. The purpose of submarine manufacturing is not

only for military but also covers other areas such as research, learning, hobby,

industries and etc.

As known, underwater tasks requires diving job and some tools to work

with such as oxygen tank to prolong the diver ability to stay underwater plus

recording tool such camera to record the underwater image. However, diving

with camera and heavy oxygen tank isn‟t practical enough. This is because there

are several places that will limit the diver capability such as in dangerous and

narrow places. Therefore a machine that can replace human for that task is

designed.[20]

Page 19: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

2

This project will come out with an underwater robot design that can work

underwater which is called as “Subbot”. Conventionally, we can see there are

many robots which work on ground.

This Subbot can replace human involvement underwater in surveillance

works activity. In order to make this Subbot to work underwater, a circuit will be

design so that it can be isolated from the water. Some of the function which will

be implemented on the robot are it can travel up, down, forward, backward, left

and right beneath water.

.

1.2 Problem Statement

This project starts with two main issues that are firstly divers such as

researchers face specific physical and health risks when they go underwater

with scuba or other diving equipment, or use high pressure breathing gas to do

their research and secondly the available RC submarines in Malaysia‟s market

are expensive and it is hard to find due to limited supplier as well as there is no

local product of the RC submarine yet.

1.3 Purpose and Objectives

To control submarine robot using computer/laptop via radio frequency

To capture videos underwater using wireless camera

To process captured image using MATLAB

Page 20: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

3

Based on the objectives above, there are 3 purposes on this project.

Firstly, it is to enable the user to move or control the Subbot. Secondly, to

enable the Subbot to capture desired videos while being underwater and lastly

to enable image captured being processed in order to improve its pictorial

information for human interpretation.

1.4 Project Scope

The mechanical design of submarine that allow the submarine to

float.

The wireless control device that give user the interface using visual

basic 6.0 to control the movement of the submarine

Other device such as camera to view the underwater image and

storage device will also be place in computer or laptop.

There will have several works on making this project works by

programming it to work with instructions from user accordingly.

1.5 Project Limitation

The mechanical design of submarine cannot go too deep level due

to water pressure.

Can‟t go too far from the user control.

Camera that available for use does not provide quality image in

dark surrounding.

Cannot be expose of sea or salt water.

Page 21: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

4

1.6 Project Beneficial/Contribution

Underwater monitoring activity can be done via camera attached.

Subbot can move in narrow region because of its small designs,.

Subbot not prone to danger because we only have to control it over

the land by using wireless.

Movement of robot is remotely controlled by computer.

Subbot could remain beneath water for a long time which is difficult

for human being to do so.

Page 22: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

5

CHAPTER 2

LITERATURE REVIEW

In this chapter, it shows the literature and reference for this project and

sources of ideas and guideline for the whole project. The references came from

books, journals and internet sources.

2.1 Background Study of RC Submarine

There are radio controlled models representing just about any kind

of full-size vehicle. That includes vessels for underwater exploration. RC

Submarines range in size from little bathtub or aquarium toys for in-home

exploration to submarines that are as big as your bathtub designed for

deep sea (or at least deep lake) exploration.

The submarine model hobby includes both static models meant

only for display and radio controlled models that are intended for fun on

and under the water. As with other RC vehicles, RC submarines have a

hand-held controller that communicates with an on-board

receiver enclosed in a water-tight compartment. Although the on-board

electronics are built to be water-tight and submersible, the controller may

not be. So don't jump in the pool and go underwater with your

controller.[3]

Page 23: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

6

2.1.1 Case Study 1: Remote Control PVC Submarine with Onboard

Camera.

The PVC sub is a functional ROV with an on-board video camera.

It has also been built as a platform for future add-ons such as leak

detection, temperature and pressure sensors, torpedoes, grabbing arms

etc. The underwater vehicle is made up of PVC pipes and propulsion is

with the help of 6 pumps.

The entire submarine is controlled by an Atmel Mega32

microcontroller. The video feeds and system info are fed to the surface

using a cable (wireless video is a future feature). [21]

2.1.2 Case Study 2: Neptune SB-1 radio-controlled submarine

provides real-time underwater video.

The SB-1, by contrast, has a 15-meter video cable that hooks up to

a portable LCD monitor, so you can see what the camera sees in real

time. A wireless video system would certainly be less cumbersome, but

video signals travel very poorly underwater. Some hobbyists have

suggested using just enough video cable to reach the surface, then

attaching it to a wireless transmitter on a buoy.

The optional video system is not the SB-1‟s only snazzy feature.

Many RC submarines utilize a dynamic diving system, meaning that they

use the hydrodynamic force of the water flowing over their wing-like diving

planes to submerge. That means they must be moving forward to move

down, and that they cannot move forward without moving down.

Additionally, they start to float back up as soon as they stop moving. The

SB-1, however, is a static diving submarine. Because it submerges by

Page 24: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

7

pumping water into its ballast tank, it can move straight up or down, hover

at that depth, then move forward without changing depth.

The SB-1 has a maximum operating depth of five meters, although

it can make it down to ten still intact. In the event that it does leak, lose

radio contact, or deplete its battery, it will automatically purge its ballast

tank and float back to the surface. Unfortunately, a submarine of this

calibre does not come cheap. The suggested retail price of the SB-1 is

RM2000, although most online retailers offer it for about RM1500. While

the camera and monitor are extras, it could presumably use less

expensive ones, as long as the camera was small enough. [22]

2.2 Ballast System

2.1.1 Introduction

The idea of travelling underneath the ocean waters inside a

contained vessel has been around for centuries. To function underwater,

submarines are built a bit differently than surface ships that float on the

water's surface. In order to travel underwater, submarines must function

in agreement with some key laws of nature, including Archimedes'

Principle and Boyles' Law [1].

Submarines as shown in Figure 2.1 are completely enclosed

vessels with cylindrical shapes, narrowed ends and two hulls: the inner

hull and the outer hull. The others physical parts for a submarine are sail,

periscope, rudder propeller, sterns and radio antenna [5]. The ballast

Page 25: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

8

tanks, which control the sub's buoyancy, are located between the inner

and outer hulls.

Figure 2.1: Overall View of a submarine

2.1.2 Ballast Tank

A ballast tank is a compartment that holds water. A vessel may

have a single ballast tank near its centre or multiple ballast tanks typically

on either side. Adding ballast to a vessel lowers its centre of gravity, and

increases the draft of the vessel. In submarines ballast tanks are used to

allow the vessel to submerge, water being taken in to alter the vessels

buoyancy and allow the submarine to dive [10].

Conventional submarines have two hulls. The circular inner hull is

the pressure hull, where the crew lives and works. Ballast tanks outside

the pressure hull form the outer hull.

Page 26: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

9

2.2 Proposed Design

Based on current RC submarine that available in the market, this proposal

came out. The basic concepts and components for the submarine still the same

such as DC motor, servos, valves, water pump and radio control.

For this project, the submarine will be upgraded by attaching a wireless

camera. This device will be added to the submarine so that it will enable the user

to monitor underwater.

2.2.1 Direct Current (DC) Motor

DC motor as shown in Figure 2.2 is proportional to the voltage

applied to it, and the torque is proportional to the current. Speed control

can be done by variable battery tappings, variable supply voltage,

resistors or electronic controls. The direction of a wound field DC motor

can be changed by reversing either the field or armature connections but

not both.

Page 27: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

10

Figure 2.2: DC motor

2.2.2 Radio Control

Radio control (R/C) is the use of radio signals to remotely control

another device. The term is used frequently to refer to the control of

model cars, boats, airplanes, and helicopters from a user-held control box

(radio) [9].

For this project, a 35MHz radio control is used. It from a remote

control and some modification on the circuit are done to suit the projects.

Page 28: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

11

Figure 2.3: Submarine Remote Controller

2.2.3 Wireless

The term wireless is normally used to refer to any type of electrical

or electronic operation which is accomplished without the use of a hard

wired connection. Some of these operations may also be accomplished

with the use of wires if desired, while others, such as long range

communications, are impossible or impractical to implement with the use

of wires. The term is commonly used in the telecommunications industry

to refer to telecommunications systems (e.g., radio transmitters and

receivers, remote controls, computer networks, network terminals, etc.)

which use some form of energy (e.g., radio frequency (RF), infrared light,

laser light, visible light, acoustic energy, etc.) to transfer information

without the use of wires[8].

Page 29: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

12

2.2.4 Camera

Camera is a device used to capture images, as still photographs or

as sequences of moving images (movies or videos). Cameras may work

with the light of the visible spectrum or with other portions of the

electromagnetic spectrum. A camera consists of some kind of enclosed

hollow, with an opening or aperture at one end for light to enter, and a

recording or viewing surface for capturing the light at the other end [8].

Most cameras have a lens positioned in front of the camera's opening to

gather the incoming light and to focus the image, or part of the image, on

the recording surface. The diameter of the aperture is often controlled by

a diaphragm mechanism, but some cameras have a fixed-size aperture.

Waterproof mini wireless camera

Size: 18 x 35 x 18mm (0.7 x 1.4 x 0.6”)

Weight: 14.7g (0.5 oz) (with waterproof case)

Color: Blue

Power: Internal rechargeable battery

Video: .27 megapixels

¼ inch CMOS color image

φ0.8 mm lens pin

Wireless range: 30 meters (33 yards)

Manual: English

Not for use in sea or salt water

Page 30: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

13

Figure 2.4: Wireless Camera

Figure 2.5: Internal rechargeable battery

Page 31: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

14

2.2.5 USB DVR

USB EasyCap 4 Channel DVR is the safety system of ideal design

for home/office/shop guard or baby care purpose. It is the cost effective

solution to replace commercial VCR tape recorder, which also supports

stable digitize video record and easy manages the recorded data via

index of date and time.

1Channel, 4 Channel, 8 Channel and 16 Channel cards adopt

MPEG4 compression format, and enable maximum 16 channels real-time

or none real-time surveillance. This cards are mature and cost-effective

products that should be the ideal choices. It enables synchronous audio

and video compression and transmission, with its powerful compression

rate and network transmission function. It is are widely used in banks,

intelligent communities, traffic management units, medical systems,

educational systems, armed forces and so on.

Specification

Windows 7/XP/Vista, Intel P4 CPU, 1700MHZ

HDD: 80G, RAM: 256M memory

Microsoft Direct X 9.0C

Free USB 2.0 port and Audio Card

Page 32: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

15

Figure 2.6: USB EasyCap DVR

2.2.6 Receiver

Morse types receiver is just connection to Television. When you

want to view the images on the TV monitor, just plug Morse typeS to your

video. Morse typeS receives the signal from RF‟s intraoral cameras and

displays the images onto your TV. It is single cable connection, no

complication. It is also compatible with video capture card for PC

connection.

Page 33: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

16

Specifications

Reception band: 1.2GHz

Receiver sensitivity: -70dBm

Power: DC 6V 270mA, AC-adapter 100-240V

Weight: 40g (1.4 oz)

Connection: Video RCA cable

Figure 2.7: Morse Types Receiver

Page 34: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

17

CHAPTER 3

METHODOLOGY

In this chapter, all of the flow of the whole project will briefly explain from

start to the end.

3.1 Introduction

To come out with this project, Information is gathered from first as well as

secondary data such as from the internet, books and journals. This is intended

to find out the most suitable topic for this Final Year Project. From doing

literature review on journals, it shows research topic that have been done and

the researcher‟s recommendation for future research.

To make sure this project run smoothly, a survey on supporting

components have been done. Supporting components in this case means

components such as resistors, capacitors, inductors and amplifiers. Information

on these components can be obtained easily from normal component stores and

have been recommended by the Supervisor for the most perfect type to be used.

One thing to be remembered is the fact that each component picked must match

in the system as so to balance it and not disrupt the inner workings of the

project.

Page 35: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

18

3.2 Project Development Flowchart

Figure 3.1 shows that the overall flow of the project. This includes all the

process required from the start, literature review to final report submission.

These are steps for the project to finish successfully.

Figure 3.1: Flow chart development

NO

YES

YES

NO

HARDWARE

START

SOFTWARE

MODIFY SUBMARINE

CONTROLLER

CREATE INTERFACE

PARALLELPORT

CONNECT WIRELESS

TEST

CONTROLLER TEST

CONNECTION

PE

RISIAN

END

PROJEK

Page 36: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

19

3.3 Diagram

3.3.1 Block Diagram

Figure 3.2 shows that camera and Subbot controlled by computer

or laptop using wireless. Subbot show that it can be moved by computer

in six functions, which is forward, reverse, left, right, up and down.

Figure 3.2: Block Diagram

Forward

Right

Left

Reverse

Up

Down

Wireless

Laptop Camera

Subbot

Page 37: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

20

3.3.2 Overview (Controller and Display Interface)

Figure 3.3 shows there are 9 buttons should be pressed to move

Subbot. The buttons name as an Up to going up, Down to going down,

Stop to stop, Forward to forward, Reverse to reverse, Stop, Left to go left,

Right to go right, and Stop.

Figure 3.3: Controller Interface

Page 38: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

21

3.3.3 Display of Camera

Figure 3.4 show pictures or video being captured by the camera

Figure 3.4: Camera Display

3.4.4 Logical Block Diagram

Figure 3.5 show the logical block diagram of the circuit controller. 6

relay has been used which is each one have their own function, and 6

LED as an indicator of each function. In this project PIC 16F877 has been

used and the specified battery power is 12V. RS232 converter acts as

received and transmitted data connected to USB to serial converter so it

can connect to the computer or laptop via USB.

Page 39: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

22

Figure 3.5: Block Diagram

3.5 Hardware Requirement

Hardware to be used

Hardware is the physical devices in the form of a computer. Here is

a list of the hardware used in the development of this system:

Computer

Submarine

Remote control

Wireless

Camera

Receiver

PIC

microcontroller

Voltage

regulator

12V

Battery

Relay, 6

units

RS232

Converter

Computer USB to Serial

Converter

LED, 6 units

Page 40: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

23

3.6 Software Requirement

Microsoft visual Basic 6.0

Visual Basic was one of the first systems that made it practical to

write programs for the Windows operating system. This was possible

because VB included software tools to automatically create the detailed

programming required by Windows. These software tools not only create

Windows programs, it is also take full advantage of the graphical way that

Windows works by letting programmers "draw" its systems with a mouse

on the computer. This is why it's called "Visual" Basic. [23]

Visual Basic also provides a unique and complete software

architecture. "Architecture" is the way computer programs, such as

Windows and VB programs, work together. One of the major reasons why

Visual Basic has been so successful is that it includes everything that is

necessary to write programs for Windows. [24]

Figure 3.6: Microsoft Visual Basic 6.0 Interface

Page 41: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

24

PCB Wizard 3.50

Figure 3.7: PCB Wizard 3.50 Interface

PCBWizard3:50, used to design the circuit according to the needs

of users to use. It is software that includes the entire symbols electronic

component that enables users to produce PCB circuits.

Page 42: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

25

PCWH software

This is the software developed by Microchip company. The

software is used to program many types of microcontroller. The software

operates in C language. PCWH used to programme PIC16F877A

programmed controller that used in SUBBOT circuit.

Figure 3.8: PCWH

Page 43: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

26

PICKit

Figure 3.9: PIC Kit Burner

PICkit is a family of programmers for PIC microcontrollers made by

Microchip Technology. It is used to program and debug microcontrollers,

as well as program EEPROM. Some models also feature logic analyzer

and serial communications (UART) tool. The people who develop open-

source software for the PICkit use a mailing list for collaboration.

PICkit 2

The PICkit 2 — introduced in May 2005— replaced the PICkit 1.

The most notable difference between the two is that the PICkit 2 has a

separate programmer/debugger unit which plugs into the board carrying

the chip to be programmed, whereas the PICkit 1 was a single unit. This

makes it possible to use the programmer with a custom circuit board via

an In Circuit Serial Programming (ICSP) header. This feature is not

intended for so-called "production" programming, however.

Page 44: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

27

Figure 3.10: PIC Kit 2

The PICkit 2 uses an internal PIC18F2550 with FullSpeed USB.

The latest PICkit 2 firmware allows the user to program and debug most

of the 8 and 16 bit PICmicro and dsPIC members of the Microchip

product line.

The PICkit 2 is open to the public, including its hardware

schematic, firmware source code (in C language) and application

programs (in C# language). End users and third parties can easily modify

both the hardware and software for enhanced features. e.g. GNU/Linux

version of PICKit 2 application software, DOS style CMD support, etc.

The PICkit 2 has a programmer-to-go (PTG) feature, which can

download the hex file and programming instructions into on-board

memory (128K byte I2C EEPROM or 256K byte I2C EEPROM), so that

no PC is required at the end application.

The Microchip version of PICkit 2 has a standard 128K byte

memory. 256K byte memory can be achieved by modifying the hardware

or from third party. Additionally, a 500 kHz three-channel logic analyzer

Page 45: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

28

and a UART tool are built into the PICKit 2. These features are missing

from the PICkit 3.

3.7 Image Processing Program

MATLAB with Image Processing Toolbox

Figure 3.11: MATLAB software

Image Processing Toolbox™ provides a comprehensive set of

reference-standard algorithms and graphical tools for image processing,

analysis, visualization, and algorithm development. It can perform image

enhancement, image deblurring, feature detection, noise reduction, image

segmentation, spatial transformations, and image registration. Many

functions in the toolbox are multithreaded to take advantage of multicore

and multiprocessor computers.

Page 46: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

29

3.7.1 MATLAB Study

In this project, MATLAB use because the video captured by Subbot

has to be processed to obtain better results. MATLAB used because

MATLAB can support many image formats. In this project, image captured

stored as a JPEG-image. [25]

3.8 About Color, Shape and Object Detection

After reading several articles about image processing to identify object, I

have learnt that before we can identify certain object in an image we need to

identify the colour and shape of the object.[12]

Colour Identification

First step in object detection is to identify the colour of the object.

This is because it is easy for human eyes to detect an object while

searching for it. This step will crop image and system will allow

proceeding to next step shape identification. A few algorithm will be apply

in this process from MATLAB Image Processing Toolbox

Shape Identification

Second step in object detection is to identify the shape of the

object. This is because after knowing the right colour of the object, we will

try to verify the true shape of that object. By using MATLAB Image

Processing Toolbox tool we can filter the shape of the object inside an

Page 47: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

30

image. After system is identifying the right colour and the right shape of

the object, it will proceed to the next step of object detection.

Object Identification

Last step is the combination of colour and shape detection

information that enable us to identify the object.

3.8.1 Project Flowchart

This flow chart shows the concept of Image Processing operation.

In this flowchart it will step by step start from reading the image. Then the

system will identify the color of the object captured. If color of object

capture is the right color of object to identify, system will proceed to the

next step. But, if it is not the color of object to identify system will return to

the first step of process Reading Image. Next step is system will apply the

filter to identify the object shape. If the right shape detected, system will

proceed to next step. If not, system will back to first step of process Image

Reading. Lastly, system will try to identify the object. If the right object

identify, system will end. If not, system will return to the first step Image

Reading. System will continue looping until it identify the right object

Page 48: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

31

Figure 3.12: Processing image Flowchart

Color Identification

Colour

Start

End

Read Image

Image Filtering to

Identify Shape

Shape

Yes

Yes

No

No

Object

Verification

Image Filtering to

Identify Object

Yes

No

Page 49: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

32

3.9 Costing and Budget

Table 3.1: Costing and Budget

Item Price Quantity

Submarine RM180 1

Wireless Camera

(With Receiver)

RM600 1

Receiver (With

Wireless Camera)

RM600 1

Battery RM15 1

USB DVR RM120 1

Total RM915

Page 50: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

33

CHAPTER 4

PROTOTYPE / PRODUCT DEVELOPMENT

4.1 Introduction

From the methodology explained in the prior chapter, it can be

simplified that there were many aspects or parameters need to be defined

and considered before moving to the development stage. This chapter will

explain the prototype development for “Subbot”. It comprises a detailed

explanation the prototype modules used in this development.

According to Margaret Rouse.[11] “In hardware design, a prototype is

a "hand-built" model that represents a manufactured (easily replicable)

product sufficiently for designers to visualize and test the design”.

The statement above gave clearly explanation that for every stage of

the prototype or product development is designed to give a deliverable item

to the client. Flexible designs make it possible to add and create this

“Subbot” project according to changing needs. The understanding of

protocols used in planning and designing are the crucial part of the project

where lack of knowledge and understanding the development will result in

failure of the project.

Page 51: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

34

4.2 Project Development Tools Required

4.2.1 Computer

Computer or laptop is used to draw schematic and PCB for the

system. Computer can be used to compile and download program into

PIC through C-compiler and downloader software.

4.2.2 Laser printer

The laser printer is used to print the PCB drawing for PCB

fabrication

4.2.3 PCB development tools:

Figure 4.1: PCB Development Tools

Blade: to cut suitable size for PCB.

Fluorescence light: to do photo etching for PCB.

PCB developer, etching powder and thinner: to develop

track from PCB.

Page 52: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

35

4.2.4 PCB assembly tools:

Figure 4.2: PCB Assembly Tools

Cutter: To cut wire and components legs.

Pliers: To bend component legs and place components on

PCB.

Soldering iron: To solder components on PCB.

Mini drill: To drill holes on PCB to place components.

4.2.5 Programming development tools:

PCW C-Compiler: Edit and compile C-language program. It

will generate .hex file for downloading application. The trial

version of C-compiler can download from www.ccsinfo.com.

Page 53: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

36

PICKIT2 Downloader Software: This software is used to

download program to PIC.

Universal PIC Programmer: It is an electronics device used

to download PIC program into PIC. Through PICKIT2 USB

downloader software, this programmer can download PIC

program (machine code, .hex file) into PIC. The programmer

can buy from www.bizchip-components.com.

4.3 Stages of Development

This chapter will show how the project is implemented. A simple circuit

has been designed and tested before a full PCB and hardware is build. To have

a complete hardware, a proper plan on project works must be drafted. The

diagram below shows a flow chart on the project plan.

4.3.1 Project Development Flowchart

Figure 4.3 shows the process to develop this project. First is study

the literature review on the related project. After that design the circuit and

programming to control the system, and then test the circuit. If the circuit

not gives the desire output, change the circuit or edit the program, but if

the circuit and program gives desire output then proceed to build the

prototype. The last step is test and troubleshooting the prototype.

Page 54: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

37

Figure 4.3: Project Development Flowchart

Start

Literature review on the related

project.

Design the circuit and

programming to control system.

Is the circuit and program

gives desire output?

Change the circuit or edit

the program

Build the

prototype

Test and

troubleshooting

End

Page 55: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

38

4.3.1 Hardware Installation

The development of this project started with the installation of

some hardware such as SK40 (interfacing board with 40 pins), PIC

16F877A (microcontroller), RS-232 Converter (USB) driver, and USB

EasyCap DVR driver. After hardware installation is done, student loading

the program of PIC 16F877A by using USB PIC-Kit Programmer. USB

PIC-Kit Programmer is designed to be plug and play with USB

Connection. Serial communication is most popular interface between

device and this applies to microcontroller and computer. RS-232 USB

Converter is one of those serial interfaces. Classically, most serial

interface from microcontroller to computer is done through serial port

(DB9). However, since computer serial port used RS-232 protocol and

microcontroller used TTL / UART, a level shifter is needed between these

interfaces. Recently, serial port of computer have been phase out, it have

been replaced with USB. Of course most developer chooses USB to

serial converter to obtain virtual serial port. The level shifter is still

necessary for UART interface.

4.3.2 Software Installation

The development of this project started with the installation some

software into the laptop. The students had installed Microsoft Visual

Studio v6.0 as the main software to develop the “Subbot” system

interface. As mention in the previous chapter, student chose this software

because it makes use of Graphical User Interface (GUI) for creating the

Page 56: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

39

applications. The Graphical User Interface as the name suggests, uses

illustrations for text, which enable users to interact with the application.

This feature makes it easier to comprehend things in a quicker and easier

way. The other software that also be used was PCWH software. This

software is used to program many types of microcontroller including

PIC16F877A microcontroller. The software operates in C language.

PCWH can be downloaded free from internet. Once it is

downloaded, user can install it by just follow the instruction. Installation

will take about 15 minutes. The program code for energy management

mentioned before is written using this software.

After the installation finished, there should an icon appear in the

computer's desktop. To use the software, user has to double click on the

icon and the welcome wizard window will pop. Another software you have

to install is PICkit2. This software is used to read and write the HEX from

MicroC software into PIC16F887 microcontroller. Figure 4.4 shows the

window of PICKit2 software.

Figure 4.4: Step by step to program the PIC16F877a microcontroller

Page 57: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

40

4.3.3 Development of Prototype & Coding

Figure 4.5: Remote Controller Circuit

Figure 4.6: Modified Remote Controller

The description of figure 4.6 is described below:

A B C D E

Page 58: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

41

Voltage regulator module (A)

Figure 4.7: Circuit Diagram Voltage Regulator Module

The voltage regulator module is

used to protect PIC and other connected

sensors / actuators from over voltage.

This is because PIC and all other

connected sensors, actuators all support

5V DC only. Over voltage will cause any

of the module burn.

LM7805 is used to regulate voltage

in the system and output 5V DC (max output current: 1000mA). It supports

input voltage from 7V DC to 18V DC. If the input

voltage is over, the LM7805 will burn or auto

shutdown due to overheat.

The generated 5V from LM7805 will be

noise filtered by 0.1uF ceramic capacitor and a

1000uF electrolytic capacitor. This is to avoid high

frequency oscillation on the outputs which may

cause system hang or unstable.

Page 59: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

42

A diode is connected at the input of the LM7805. This is to avoid

voltage connected reversely. An on/off switch is used to turn on/off the

system and a LED (5V, 5mA) is used to indicate the system is power

on/off. The LED is connected through 1KR resistor to limit current pass

through LED is 5mA.

RS-232 Level Converters (B)

Almost all digital devices which we use require

either TTL or CMOS logic levels. Therefore the first

step to connecting a device to the RS-232 port is to

transform the RS-232 levels back into 0 and 5 Volts.

As we have already covered, this is done by RS-232

Level Converters.

Two common RS-232 Level Converters are the 1488 RS-232

Driver and the 1489 RS-232 Receiver. Each package contains 4 inverters

of the one type, either Drivers or Receivers. The driver requires two

supply rails, +7.5 to +15v and -7.5 to -15v. As you could imagine this may

pose a problem in many instances where only a single supply of +5V is

present. However the advantages of this I.C are are they are cheap.

Figure 4.8: Pin outs for the MAX-232, RS-232 Driver/Receiver.

Page 60: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

43

Figure 4.9: Typical MAX-232 Circuit.

Another device is the MAX-232. It includes a Charge Pump, which

generates +10V and -10V from a single 5v supply. This I.C. also includes

two receivers and two transmitters in the same package. This is handy in

many cases when you only want to use the Transmit and Receive data

Lines. You don't need to use two chips, one for the receive line and one

for the transmit. However all this convenience comes at a price, but

compared with the price of designing a new power supply it is very cheap.

There are also many variations of these devices. The large values

of capacitors are not only bulky, but also expensive. Therefore other

devices are available which use smaller capacitors and even some with

inbuilt capacitors. (Note: Some MAX-232 can use 1 micro farad

Capacitors).

Page 61: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

44

PIC 16F877A microcontroller (C)

PIC16F877A-I/P microcontroller is used to control the whole

system. It is designed using flash technology. So the PIC can read/write

program for more than 100,000 times. The PIC 16F877A has 8 K words

or program memory. Since each word in the midrange family is 14 bits

long the program memory can also be expressed as 14 Kbytes. The unit

has 368 bytes of data ram and 256 bytes of EEPROM. It has 8 channels

of A/D with 10 bit resolution. The unit has 2 8 bit Timer/Counters and a

single 16 bit Timer/Counter. In addition to this it has several different

types of serial communication functions such as SPI, I2C, and normal pc

type serial communications functions.

Figure 4.10: PIC 16F877/874 Diagram

Page 62: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

45

OSC1 and OSC2 pins are connected to 20MHz crystal to execute

every single program line in the system. 20MHz crystal is used because

this is the maximum frequency that the PIC can support. If over frequency

the PIC will burn. Else if crystal speed less than 20MHz then PIC

response speed will slower. The MCLR pin of the PIC is pull up to 5V

through a 10KR resistor.

The PIC can operate using 4.5V to 6.0V DC voltage. In the project

is operating at 5.0V (by using 7805). It is DIP layout (dual in line package)

and suitable for student project. It has 40 pins but only 33 I/O pins can be

set as digital input or digital output. The digital output of the PIC is 5V (for

signal 1) and 0V (for signal 0) these signals will be directly connected to

actuators for control purpose. When the PIC pin is set as digital input. It

will detect input voltage 5V as signal 1 and 0V as signal 0. Any voltage

less than 0V or more than 5V will damage PIC.

Table 4.1: Key Feature PIC Micro

Page 63: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

46

Transistor (D)

Like relays, transistors can be used as an electrically operated

switch. For switching small DC currents (< 1A) at low voltage, transistor

are usually a better choice than a relay. However transistors cannot

switch AC or high voltages (such as mains electricity) and they are not

usually a good choice for switching large currents (> 5A). In these cases a

relay will be needed, but note that a low power transistor may still be

needed to switch the current for the relay's coil.

Advantages of relays:

Relays can switch AC and DC, transistors can only switch DC.

Relays can switch high voltages, transistors cannot.

Relays are a better choice for switching large currents (> 5A).

Relays can switch many contacts at once.

Disadvantages of relays:

Relays are bulkier than transistors for switching small currents.

Relays cannot switch rapidly (except reed relays), transistors can

switch many times per second.

Relays use more power due to the current flowing through their coil.

Relays require more current than many ICs can provide, so a low

power transistor may be needed to switch the current for the relay's

coil.

Page 64: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

47

Relay (E)

A relay is an electrically operated switch. Many relays use an

electromagnet to operate a switching mechanism, but other operating

principles are also used. Relays find applications where it is necessary to

control a circuit by a low-power signal, or where several circuits must be

controlled by one signal. Figure 14 shows the basic design of relay.

Figure 4.11: Relay

The output of each PIC pin is 5V with max output current of 20mA

or 0V with 0mA output. The voltage is not enough to run high power

device e.g. motor, solenoid. Thus we need a relay to control these high

power items. A simple switching circuit (using NPN transistor, C9013) will

be used to energize / de-energize the input coil of the relay.

The relay output is single pole double throw (SPDT). And its coil

can be energized using 5V and de-energized using 0V. Normally the relay

output NC and COM will be connected. When the input coil of relay is

energized, output NO and COM will connect. The switching can be used

to control item which is less than 250Vac and 10A.

A reverse diode (1N4007) is connected with input of relay to avoid

reverse spike or over current flow back from the load. It can handle 1A of

Page 65: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

48

current with 0.58V barrier potential. And a LED indicator is used to show

relay is now on/off. When relay is on, LED is on. When relay is off, LED is

off.

Figure 4.12: Circuit for controlling an AC or other high-current

device from a microcontroller by using a relay

Page 66: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

49

RS-232

The original Serial connectors used DB-25 connectors, it seems

people, not knowing the significance of the letter "B" (the shell size),

began to call all D-sub connectors "DB" connectors. Instead of correctly

saying DB-25, and DE-9 we have called all serial connectors DB-. Today

"DB-9" really means DE-9. [26]

Figure 4.13: Interfacing Devices to RS-232 Ports

Page 67: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

50

RS-232 Waveforms

RS-232 communication is asynchronous. That is a clock signal is

not sent with the data. Each word is synchronized using its start bit, and

an internal clock on each side, keeps tabs on the timing.

Figure 4.14: TTL/CMOS Serial Logic Waveform

The diagram above shows the expected waveform from the UART

when using the common 8N1 format. 8N1 signifies 8 Data bits, No Parity

and 1 Stop Bit. The RS-232 line, when idle is in the Mark State (Logic 1).

A transmission starts with a start bit which is (Logic 0). Then each bit is

sent down the line, one at a time. The LSB (Least Significant Bit) is sent

first. A Stop Bit (Logic 1) is then appended to the signal to make up the

transmission.

The diagram shows the next bit after the Stop Bit to be Logic 0.

This must mean another word is following, and this is its Start Bit. If there

is no more data coming then the receive line will stay in its idle state (logic

1). We have encountered something called a "Break" Signal. This is when

the data line is held in a Logic 0 state for a time long enough to send an

entire word. Therefore if you do not put the line back into an idle state,

then the receiving end will interpret this as a break signal.

Page 68: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

51

The data sent using this method, is said to be framed. That is the

data is framed between a Start and Stop Bit. Should the Stop Bit be

received as Logic 0, then a framing error will occur. This is common,

when both sides are communicating at different speeds.

The above diagram is only relevant for the signal immediately at

the UART. RS-232 logic levels uses +3 to +25 volts to signify a "Space"

(Logic 0) and -3 to -25 volts for a "Mark" (logic 1). Any voltage in between

these regions (i.e. between +3 and -3 Volts) is undefined. Therefore this

signal is put through a "RS-232 Level Converter". This is the signal

present on the RS-232 Port of your computer, shown below.

Figure 4.15: RS-232 Logic Waveform

Page 69: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

52

The above waveform applies to the Transmit and Receive lines on

the RS-232 port. These lines carry serial data, hence the name Serial

Port. There are other lines on the RS-232 port which, in essence are

Parallel lines. These lines (RTS, CTS, DCD, DSR, DTR, RTS and RI) are

also at RS-232 Logic Levels.

Figure 4.16: Plug RS-232 USB Converters into USB Port.

PCB Fabrication

PCB Drawing: PCB drawing is designed using Protel DXP 2005.

Once the PCB layout has been correctly design, it is now prints out the

layout on the A4 size transparent OHP paper. Note that, two types of

printers are allowed to print the PCB layout, one is laser printer and the

other is carbon type of printer such as Photostat machine. Inkjet and dot

matrix type of printer will not work.

Page 70: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

53

Tools required:

Fluorescent light

UV PCB

Marker Pen

Blade

OHP transparent paper

Iron (III) chloride, FeCl3 acid

Clean water

Thinner

Plastic Container

Laser printer

PCB cutter and trimmer

Soldering gun

Soldering lead

Track Checking and Soldering

It is important for the designer troubleshoots the PCB traces before

assembly and solders the components. Two possible things might happen

in the PCB traces: one is short circuit and the other one is open circuit.

Short circuit means two PCB traces are touching to each other. This

causes high current flows in the entire circuit and burn out some of the

Page 71: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

54

low rating components. Open circuit means there is no connection. When

power is on, the PCB does not response. This might be the problem of

open circuit. Short circuit can be troubleshoot by using PCB cutter to

separate the two touching traces. Open circuit can be troubleshoot by

using jumper wire to make the connection between two traces.

After all tracks are repaired, you can place components on PCB

and start solders one by on using soldering iron and lead.

Project Component List

The whole system consists of the following parts and

components:

Table 4.2: Component List

Description Value Quantity Unit Price

(RM)

Microcontroller PIC16F877A 1 27.00

IC Socket 40 pin 2 1.00

Crystal 20MHz 1 1.20

Capacitor 18pF 2 0.30

Voltage Regulator LM7805 1 1.20

Capacitor 0.1uF, 50V 1 0.30

Page 72: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

55

Capacitor 1000uF, 16V 1 1.00

LED 5mm 1 0.20

Resistor 1KR 1 0.05

Diode 1N4007 1 0.20

Switch On/Off 1 2.00

Photo PCB 300mm*150mm 1 28.00

Etching Powder 1Kg 1 20.00

PCB Developer 50g 1 8.00

Adapter 12VDC 1 20.00

LED 5mm 6 0.20

Resistor array 1K, 6 pin 1 0.60

Mini Relay 5V 1 5.00

Transistor NPN, C9013 1 0.50

Resistor 470R 1 0.05

MAX232 IC 5V 1 3.50

Capacitor 1uF 4 0.20

Serial Cable 1.2 meter 1 10.00

Page 73: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

56

Project Wiring

Table 4.3: Project Wiring

PIC I/O Pin Connected To

Sensor / Actuator Function

RA0 LED 1 On when relay 1 on

RA1 LED 2 On when relay 2 on

RA2 LED 3 On when relay 3 on

RA3 LED 4 On when relay 4 on

RA5 LED 5 On when relay 5 on

RB2 Relay 6 On / Off switch 6

RB3 Relay 5 On / Off switch 5

RB4 Relay 4 On / Off switch 4

RB5 Relay 3 On / Off switch 3

RB6 Relay 2 On / Off switch 2

RB7 Relay 1 On / Off switch 1

RC6 MAX232 Send data to computer

RC7 MAX232 Receive data from computer

RE0 LED 6 On when relay 6 on

Page 74: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

57

4.3.4 Stages of Hardware Installation

Design PCB Board

First install PCB Design Software. After finish the

installation, sketch schematic diagram onto the software, and then

run system (Output Signal) and save it. After run the system, the

last step is print the PCB layout using transparency paper.

Figure 4.17: Design the circuit to be placed onto the board using PCB design

software

PCB Design Software is a system that can used to design a

schematic / circuit diagram for a particular project mostly in electric and

electronic project. This software is easy to use and it can be downloaded

from internet.

Page 75: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

58

PCB Circuit Design

Figure 4.18: PCB Circuit Design

Step to install RS-232 USB Converter

Do not plug in the USB type A receptacle of the cable to the

USB connector of your computer.

Page 76: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

59

Place the enclosed CD Driver into the CD ROM. to search for

“PL-2303 Driver Installer”. Then click “PL-2303 Driver Installer”.

Select „Search for the best driver for your device‟ and click

“next”. See Figure 4.20 below

Figure 4.19 (a): Click “Next”

Windows has finished installing the software, click “Finish”

to close the Wizard. See Figure 4.19 (b) below:

Page 77: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

60

Plug USB/Serial cable into your computer‟s USB port.

Figure 4.19 (b): Install RS-232 USB Converter is finish.

Plug USB/Serial cable into your computer‟s USB port.

Figure 4.19 (c): Plug RS-232 USB Converter into USB Port.

Page 78: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

61

Open “Device Manager” under System Properties and check if

there is the device you install under “USB to Serial (COM3)”.

See below:

Figure 4.19 (d): Check port at Device Manager

Page 79: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

62

Step install Microsoft Visual Basic v6.0

This software can be downloaded at www.freesoftware.com. Below

are the steps on how to install Visual Basic v6.0 into your computer.

Click the Install Visual Basic v6.0 to start the installation.

Figure 4.21(a): Click “Next”

Figure 4.20(a): Install Visual Studio 2008

The setup wizard will start copying needed files into a temporary

folder. Just wait.

Figure 4.20(b): Copy Files

Click the Next button to go to the next step

Page 80: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

63

Figure 4.20(c): Click “Next”

The setup wizard will list down all the required components need to

be installed. Any already installed components will also be

mentioned. Notice that VS 2008 (version 8.x) needs .NET

Framework version 3.5. Key in the Product key and accept the

license terms. Then click the Next button.

Figure 4.20(d): Key in “Product Key” and click Next.

Page 81: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

64

The installation starts. Just wait and see the step-by-step, Visual

Studio 2008 components being installed.

Figure 4.20(e): Install is running and waiting until finish.

Page 82: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

65

1.3.5 Stages of Software Installation for “Subbot”

1. Connect PIC programmer to computer via serial port / USB

port.

2. Insert PIC 16F877A into the programmer socket.

Figure 4.21(a): Insert PIC into PIC Programmer socket.

3. Copy „Winpic800‟ folder to Desktop.

4. Look for Winpic800.exe in the folder.

Page 83: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

66

Figure 4.21(b): Winpic800.exe installer.

2. Double click Winpic800.exe to start the program.

Figure 4.21(c): Select proper PIC name in the top right combo box.

Page 84: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

67

3. Open the .hex file which you want to download into PIC e.g. if your

.c filename is „abc.c‟, suppose you need to download „abc.hex‟ into

PIC.

4. Go to „Device‟ -> „Program All‟ to start download program into your

PIC.

Figure 4.21(d): Start download program into PIC.

Page 85: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

68

4.3.6 Project Prototype For “Subbot”

Figure 4.23: Already made Submarine (Toy Submarine).

4.3.7 Project Prototype For “Subbot” Controller

Figure 4.24: Submarine Remote Controller

Page 86: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

69

CHAPTER 5

RESULT AND TESTING

5.1 Introduction

The testing and results phase initiated properly to test the project

functionality. This chapter will represent various testing result where all

compulsory and applicable testing mechanism is applied on.

5.2 Purpose and objective of testing

The purpose of the testing is to be familiar with developing and trouble

shooting a basic circuit and to work independently on a project starting from

planning, designing and complete a project.

Page 87: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

70

5.3 Flowchart for Subbot Testing

Figure 5.1 show that 6 relay and 6 LED has been used in this

project. If one of the relay on, all relay will be automatically off. Here LED is just

as an indicator to show which relay is on or function. In this circuit, Subbot only

can do two move which is two function at the same time.

Page 88: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

71

Flowchart for Subbot Testing.

Start

Detect data from PC

A1? On relay 1 On red LED 1

A0?

B1?

Off relay 1 Off red LED 1

On relay 2 On green LED

1

B0?

C1?

C0?

Off relay 2 Off green LED

1

On relay 3 On red LED 2

Off relay 3 Off red LED 2

2

1

NO

NO

NO

NO

NO

YES

YES

YES

YES

YES

NO

YES

Page 89: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

72

Figure 5.1: Flowchart for Subbot Testing

D0? On relay 4 On green

LED 2

Off relay 4 Off green

LED 2

On relay 5 On red LED 3

E0? Off relay 5 Off red LED 3

F1? On relay 6 On green

LED 3

F1? Off relay 6 Off green

LED 3

2 1

Y

ES

YES

YES

YES

YES

N

O

NO

NO

NO

NO

NO

D0?

D1?

YES

YES

Page 90: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

73

5.3.1 Testing Flow chart

Figure 5.1 shows that two testing has been conducted. On the left

side is hardware and the right side is software. In hardware, if the

controller not works properly, modify again or troubleshoot the submarine

controller. In software, if the connection not works properly, reconnect or

troubleshoot the connection.

Figure 5.2: Testing Flow chart

HARDWARE

START

SOFTWARE

MODIFY SUBMARINE CONTROLLER CREATE INTERFACE PARALLELPORT

CONNECT WIRELESS

TEST

CONTROLLER TEST

CONNECTION

PER

ISIAN

END

PROJEK

Page 91: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

74

5.4 Hardware Testing

5.4.1 Remote Controller Circuit

Figure 5.3 show that Subbot can only run two motors in one time,

for example upward and backward. When user click on the button their

want, automatic LED light on the circuit will light up, which tells that the

motor is working, as shown in the figure 5.2 above.

Figure 5.2: Controller Circuit

Figure 5.3: Controller Interface

Page 92: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

75

5.4.2 Charging Battery

Figure 5.4: Battery Charging

Figure 5.4 on the left above shows that flashing lights flicker when

it indicates weak battery, or even necessary for charging. When the

charging is full, the lights will stay on as shown in the Figure 5.4 on the

right above.

Page 93: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

76

5.4.3 Display

Figure 5.5: Displaying image

Figure 5.5 shows that receiver is turned on and the blue light is on

it also serves as notification that the receiver is turned on. When you turn

on the receiver, the display would be transmitted via computer or laptop

webcam you are using. In this process, you can take pictures or video via

computer or laptop. Figure 5.6 below shows an example of the images

that have successfully captured.

Figure 5.6: Images Captured

Page 94: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

77

5.4 Testing Operation

Figure 5.7 shows a Subbot control interface, where it has nine buttons.

Subbot can only carry two buttons at a time. For example forward and right. If

you want to move to other direction, you have to click the stop button first, and

then click on the next button that you want

Figure 5.7: Controller Interface

Page 95: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

78

5.5 Result Analysis

Figure 5.8 shows that how the camera was mounted under the

submarine. Bottom mounted camera is that equilibrium can be done easily from

the top of it installed.

Figure 5.8: Subbot with Camera

Figure 5.9 below shows the Subbot floats on the water surface, while the

right picture below shows Subbot sunk underwater.

Figure 5.9: Subbot Submerged in water

Page 96: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

79

Figure 5.10 shows that the result of video capturing.

Figure 5.10: Image Captured

Page 97: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

80

CHAPTER 6

CONCLUSION

Project of designing a submarine robot had successfully built and

operated underwater as well as achieved its objectives whereby user can control

the submarine robot via laptop using Radio Control. Subbot also can capture

pictures or videos while being underwater.

The designed “Subbot” has several functions. Firstly, the program data

that had been set in the interface software program will enable users to

communicate data. Moreover, it is also allows the users to understand the

movement that had already being set in the system. Furthermore, this project

was designed with Visual Basic 6.0 which enables users to manipulate the robot.

User can move the Subbot to the left, to the right, up, down, reverse and

forward.

Referring back to the problem statements stated earlier, this designed

submarine robot can solve the problem statement stated. It will substitute human

being as a diver so that the researchers will not face a physical and health risk

that they will face if they go underwater physically by themselves.

Page 98: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

81

RECOMMENDATION

Although this underwater robot submarine has many advantages, it is

also have some limitation due to some circumstances. For future project, this

limitation can be overcome by making an improvement to the robot such as

installing one or more tools or devices to the robot. First tool is LED underwater

light that will give a lightning effect. By installing this LED underwater light, it will

enable the camera attached on the robot to capture images in dark surrounding.

Second tool is an underwater sensor system. This sensor system will detect the

robot from hitting any object while being underwater.

Page 99: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

82

REFERENCES

[1] [email protected]

http://www.physics.org/explorelink.asp?id=3407

[2] Michael James, former About.com Guide

http://rcvehicles.about.com/od/rcsubs/f/buildasub.htm

[3] From Michael James, former About.com Guide http://rcvehicles.about.com/od/water/a/rcsubbasics.htm

[4] WirelessMicroColorCam.com

http://www.wirelessmicrocolorcam.com/

[5] NURP Album/Undersea Technology/Submersibles

Chief of Naval Operations - Submarine Warfare

Divisionhttp://www.onr.navy.mil/Focus/blowballast/sub/work1.htm

[6] NURP Album/Undersea Technology/Submersibles

Chief of Naval Operations - Submarine Warfare Division

http://marinebio.org/oceans/submarines/

[7] 1998-2012 HowStuffWorks, Inc

http://science.howstuffworks.com/nuclear-submarine5.htm

[8] Building an 'Improved' Wallace RC 1/16 scale KAIRYU

Suicidehttp://vabiz.com/d&e/CABAL/Building%20an%20%27Improved%27%20Wallace%20RC

%201_16%20scale%20KAIRYU%20Kit,%20Part-1.htm

[9] Refilling Liquid Nitrogenwww.ags.my

http://oscortega.hubpages.com/hub/How-Do-Radio-Control-Models-Work

[10] Clay Male, 66, Mayfield, Ky

http://wiki.answers.com/Q/How_do_submarines_float_and_dive

[11] PICkit-level., "Discussion of open-source development for Microchip's PICKit series

of programmers." URL: http://groups.google.com/group/pickit-devel

Page 100: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

83

[12] Flying Robot Surveyor (Image Analyser – FYP2(report) – Muhammad Nazrin Fikrin Bin

Abdullah – 30 April 2013.

[13]http://www.public.navy.mil/spawar/Pacific/Robotics/Pages/USV_Platform.aspx

[14] RF circuit design [electronic resource] /Chris Bowick /Newnes,

[15] http://www.jbprojects.net/articles/rc/ 1982 - Technology & Engineering

[16] RF Circuit Design: Theory and Applications by Reinhold Ludwig /Published April 1st

2008 by Prentice Hall .

[17] http://www.learningaboutelectronics.com/Articles/How-do-you-connect-a-voltage-regulator-in-

a-circuit- Design by CSS Templates For Free.

[18] http://www.hobbyprojects.com/microcontroller-tutorials/pic16f877a/introduction-to-the-

pic16f877a.html- Copyright © 1999-2011 www.hobbyprojects.com

[19] http://www.beyondlogic.org/serial/serial1.htm- Copyright 1995-2010 Craig Peacock 25th

October 2010.

[20] http://umpir.ump.edu.my/2351/1/ZULKIPLE_BIN_JAMAL.PDF/ Zulkiplie,

Jamal (2007) Design and fabricate remote controlled submarine with on board wireless

camera. EngD thesis, Universiti Malaysia Pahang./ 28 Feb 2013 11:35.

[21] http://hacknmod.com/hack/remote-control-pvc-submarine-with-onboard-camera/

HacknMod.com © 2013.

[22] http://www.gizmag.com/httpwwwgizmagcomneptune-sb-113768/13768/ By Ben

Coxworth/ January 7, 2010.

[23] http://www.edusoft4u.com/edusoft4u/Default.aspx/ Copyright © 2012 Edusoft Learning

Systems | Designed by Iota Softwares

[24] http://visualbasic.about.com/od/applications/a/whatisvb.htm/ From Dan Mabbutt, former

About.com Guide/ ©2013 About.com. All rights reserved.

[25] ec.edu.ly/ec593/contents/related-resources/intro_matlab.pdf‎/by K Sandberg - Cited by

12 - Related articles/Sep 4, 2011.

[26] http://wiki.xtronics.com/index.php/RS232_DB9_pinout/ 26 November 2010, at 20:42.

Page 101: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

84

APPENDIX A:

GANTT CHART

Page 102: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

85

Page 103: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

86

APPENDIX B:

MAIN MENU

INTERFACE

Page 104: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

87

Visual Basic v6.0 Programming (User Interface)

Subbot Controller Interface

Private Sub Command1_Click()

Command1.Enabled = False

Command2.Enabled = True

Command7.Enabled = True

MSComm1.Output = "a"

End Sub

Private Sub Command2_Click()

Command1.Enabled = True

Command2.Enabled = False

Command7.Enabled = True

MSComm1.Output = "b"

End Sub

Private Sub Command3_Click()

Command3.Enabled = False

Command4.Enabled = True

Page 105: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

88

Command9.Enabled = True

MSComm1.Output = "g"

End Sub

Private Sub Command4_Click()

Command3.Enabled = True

Command4.Enabled = False

Command9.Enabled = True

MSComm1.Output = "h"

End Sub

Private Sub Command5_Click()

Command5.Enabled = False

Command6.Enabled = True

Command8.Enabled = True

MSComm1.Output = "d"

End Sub

Private Sub Command6_Click()

Command5.Enabled = True

Command6.Enabled = False

Command8.Enabled = True

MSComm1.Output = "e"

End Sub

Page 106: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

89

Private Sub Command7_Click()

Command1.Enabled = True

Command2.Enabled = True

Command7.Enabled = False

MSComm1.Output = "c"

End Sub

Private Sub Command8_Click()

Command5.Enabled = True

Command6.Enabled = True

Command8.Enabled = False

MSComm1.Output = "f"

End Sub

Private Sub Command9_Click()

Command3.Enabled = True

Command4.Enabled = True

Command9.Enabled = False

MSComm1.Output = "i"

End Sub

Private Sub Form_Load()

MSComm1.PortOpen = True

End Sub

Page 107: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

90

Private Sub Form_Unload(Cancel As Integer)

MSComm1.PortOpen = False

End Sub

APPENDIX C:

PIC 16F877A

MICROCONTROLLER

PROGRAMMING

Page 108: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

91

PIC 16F877A MICROCONTROLLER PROGRAMMING

#include <16f877A.h> //use pic16f876a

#use delay(clock=20000000) //20mhz

#fuses hs,noprotect,nowdt,nolvp //fuse setting

#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, parity=N) //rs232 setting

int rcvdata=0;

void main()

{

set_tris_a(0b00000000); //set i/o

set_tris_b(0b00000000); //set i/o

set_tris_c(0b10000000); //set i/o

set_tris_d(0b00000000); //set i/o

set_tris_e(0b00000000); //set i/o

setup_port_a(NO_ANALOGS);

output_high(pin_a0); //on red led1

output_high(pin_a1); //on green led1

Page 109: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

92

output_high(pin_a2); //on red led2

output_high(pin_a3); //on green led2

output_high(pin_a5); //on red led3

output_high(pin_e0); //on green led3

output_high(pin_b7); //on relay1

output_high(pin_b6); //on relay2

output_high(pin_b5); //on relay3

output_high(pin_b4); //on relay4

output_high(pin_b3); //on relay5

output_high(pin_b2); //on relay6

delay_ms(1000);

output_low(pin_a0); //off red led1

output_low(pin_a1); //off green led1

output_low(pin_a2); //off red led2

output_low(pin_a3); //off green led2

output_low(pin_a5); //off red led3

output_low(pin_e0); //off green led3

output_low(pin_b7); //off relay1

output_low(pin_b6); //off relay2

output_low(pin_b5); //off relay3

output_low(pin_b4); //off relay4

output_low(pin_b3); //off relay5

output_low(pin_b2); //off relay6

do

Page 110: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

93

{

rcvdata=getch(); //get data from computer

if(rcvdata=='a') //if get 'a'

{

output_high(pin_a0); //on red led1

output_low(pin_a1); //off green led1

output_high(pin_b7);

output_low(pin_b6);

}

else if(rcvdata=='b') //if get 'b'

{

output_low(pin_a0); //off red led1

output_high(pin_a1); //on green led1

output_low(pin_b7);

output_high(pin_b6);

}

else if(rcvdata=='c') //if get 'b'

{

output_low(pin_a0); //off red led1

output_low(pin_a1); //off green led1

output_low(pin_b7);

Page 111: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

94

output_low(pin_b6);

}

if(rcvdata=='d') //if get 'd'

{

output_high(pin_a2); //on red led2

output_low(pin_a3); //off green led2

output_high(pin_b5);

output_low(pin_b4);

}

else if(rcvdata=='e') //if get 'e'

{

output_low(pin_a2); //off red led2

output_high(pin_a3); //on green led2

output_low(pin_b5);

output_high(pin_b4);

}

else if(rcvdata=='f') //if get 'f'

{

output_low(pin_a2); //off red led2

output_low(pin_a3); //off green led2

Page 112: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

95

output_low(pin_b5);

output_low(pin_b4);

}

if(rcvdata=='g') //if get 'g'

{

output_high(pin_a5); //on red led3

output_low(pin_e0); //off green led3

output_high(pin_b3);

output_low(pin_b2);

}

else if(rcvdata=='h') //if get 'h'

{

output_low(pin_a5); //off red led3

output_high(pin_e0); //on green led3

output_low(pin_b3);

output_high(pin_b2);

}

else if(rcvdata=='i') //if get 'i'

{

output_low(pin_a5); //off red led3

output_low(pin_e0); //off green led3

Page 113: WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY · PDF filei WIRELESS SUBMARINE ROBOT (SUBBOT) USING RADIO FREQUENCY (RF) MOHAMAD EDWAN BIN SAINEE Dissertation Submitted in

96

output_low(pin_b3);

output_low(pin_b2);

}

}while(1); //repeat always

}