You are on page 1of 140

Final Year Project Report

Underwater Acoustics Communication


B.E Telecommunication, Batch 2008-09
Submitted by:
Faraz Bin Younus Muhammad Aadil Chauhan Muhammad Naeem Uddin Muhammad Talha Anwar Syed Waris Hussain Zaidi Wamique Ahmed Laeeque 9530 9524 9771 9515 9503 9493

Project Advisor
Engr. Jawwad Ahmed Assistant Professor

Faculty of Engineering, Sciences and Technology IQRA University, Karachi


Copyright 2012

ACKNOWLEDGMENT

First of all, we are thankful to Al-Mighty ALLAH, who praises us with the ability to think, work and to deliver what we are assigned to do. Secondly, we must be grateful and thankful to Dr. Muhammad Moinuddin, who really appreciate and co-operate us in all the critical conditions, and then our project supervisor Engr. Jawwad Ahmed, who really guide and help us in this project. We also acknowledge our teachers, departmental staff, university staff and all other than this that throughout our studies help and guide us.

INTRODUCTION TO GROUP MEMBERS

Faraz Bin Younus Immediate Contact: (0333-2063742, farazby@gmail.com)

Reg. # 9530

Muhammad Aadil Chauhan Immediate Contact: (0321-2632786, aadilchauhan@gmail.com)

Reg. # 9524

Muhammad Naeem Uddin Immediate Contact: (0344-2543656, engr_m.naeem@hotmail.com)

Reg. # 9771

Muhammad Talha Anwar Immediate Contact: (0314-2372530, talha_anwar@hotmail.co.uk)

Reg. # 9515

Syed Waris Hussain Zaidi Immediate Contact: (0345-3053245, wasi_zaidi1990@yahoo.com)

Reg. # 9503

Wamique Ahmed Laeeque Immediate Contact: (0321-8955598, wamiquelaeeque3@gmail.com)

Reg. # 9493

ABSTRACT

The outcome of the project is to achieve the Underwater Acoustic Communication using the ultrasonic sensors. The design carries difficult task to implement as the channel has unreliable and varying characteristics. The principal element of this layout is to communicate within water, which is accomplished as an objective uptill now. The feature of the transceiver has given a great inspiration, to execute other parts of the block diagram which contain some operations like data encoding, data decoding, encryption, and decryption, multiplexing and de-multiplexing. The BPSK modulation and demodulation scheme is being used. Since the baud rate is within a constraint thus Low frequency acoustic signals are used to encounter less attenuation.

LIST OF ACRONYMS
3DES 3G ADC AES ALU AM AVR BD BER BPSK CPU DAC DES EM FM FSK GSM GUI IR KEIL MUX PIC PSK RADAR RAM RF ROM RSA SMPS SONAR Triple Data Encryption Standard 3rd Generations Analog to Digital Converter Advanced Encryption Standard Arithmetic Logic Unit Amplitude Modulation Automatic Voltage Regulator Baud Bit Error Rate Binary Phase Shift Keying Central Processing Unit Digital to Analog Converter Data Encryption Standard Electromagnetic Frequency Modulation Frequency Shift Keying Global System for Mobile Communication Graphical User Interface Infrared Knowledge Engineering Integration Laboratory Multiplexer Peripheral Interface Controller Phase Shift Keying Radio Detection and Ranging Random Access Memory Radio Frequency Read Only Memory Rivest, Shamir, and Adelman Switched-Mode Power Supply Sound Navigation and Ranging

SPI SWARM TDM UAC UART UI UNIX UWA UWU WI-FI WI-MAX

Serial Peripheral Interface Small World Autonomous Robot for Micromanipulation Time Division Multiplexing Ultrasonic Acoustic Communication Universal A-synchronous Receiver-Transmitter User Interface Universal Network Information Exchange Underwater Acoustic Communication Underwater Ultrasonic Communication Wireless Fidelity Worldwide Interoperability Microwave Access

TABLE OF CONTENTS

Title Acknowledgement Introduction to Group Members Abstract List of Acronyms Table of Contents Chapter 1: INTRODUCTION 1.1 History 1.2 Structure of Report 1.3 Project Objective Chapter 2: ACOUSTIC COMMUNICATION 2.1 Description 2.1.1 Basic Concept 2.1.2 Speed of Sound 2.2 Early Implementations 2.3 Acoustic 2.4 Acoustic Communication 2.5 Ultrasonic Chapter 3: UNDERWATER ACOUSTIC COMMUNICATION 3.1 Early Research 3.2 Underwater Ultrasonic Communication 3.3 Channel Characteristics 3.4 Working with SONAR Chapter 4: SYSTEM MODEL 4.1 Basic Model 4.2 Overall System Model

i ii iii v vi viii
1

1 4 5 7 7 7 8 9 11 11 12
14

14 15 16 17
18

18 19

4.3 Block Diagram 4.4 Ultrasonic Transducer 4.5 Microcontroller 4.6 Encryption/Decryption 4.7 Transceiver 4.8 Project Features 4.8.1 Facilities 4.8.2 Problems Solved 4.8.3 Advantages Chapter 5: HARDWARE SECTION 5.1 Power 5.1.1 Linear Regulated Power Supply 5.1.2 Switched-Mode Power Supply 5.2 Microcontroller (at89c51, at89c2051, atmega8) 5.2.1 At89c51 5.2.2 Atmega8 5.2.3 At89c2051 5.3 Ultrasonic Transducers 5.4 Transceiver 5.5 PC to Serial Interfacing 5.6 Block Diagram of Serial Communication Chapter 6: SOFTWARE SECTION 6.1 KEIL 6.1.1 Working with KEIL Software 6.1.2 Starting with New Project 6.2 MATLAB 6.2.1 Configuring Serial Port Communication by using tmtool 6.2.2 MATLAB with Serial Devices (RS-232) 6.3 HyperTerminal 6.3.1 Baud-Rate 6.3.2 Data Bits Chapter 7: PROGRAMMING SECTION 7.1 Programming in C & Assembly Language 7.1.1 C-Language 7.1.2 Syntax in C

21 22 23 24 25 26 26 26 26
27

27 27 28 29 29 30 31 32 32 33 34
35

35 36 37 42 42 44 45 46 47
49

49 49 49

7.1.3 Assembly Language 7.1.4 Special Function Register (SFR) 7.2 8051 Serial Communication Programming 7.2.1 Useful Programs 7.2.2 Testing Microcontroller Chapter 8: CONCLUSION & FUTURE WORK 8.1 Conclusion 8.2 Future Work Reference Appendix A (Coding) Appendix B (Schematic) Appendix C (Datasheet)

50 51 52 53 54
55

55 56
57 61 95 102

CHAPTER 1 INTRODUCTION

1.1

History
The word communication is derived from the Latin word Communis, which

means to share or exchange of opinions, letters, or any information; as by vocalizations, visuals, written, or any action [1]. As per our knowledge, communication necessitate a correspondent sender, a message (data), and an addressee; although the addressee needs not to be in attendance or sentient of the correspondents aim to communicate at the instant of communication; thus communication can occur across vast distances in time and space. Communication requires that the communicating parties share a region of communicative shared aims. The communication process is complete once the recipient has understood the message of the correspondent. Early years, the communications between two users were not so much easy. Peoples used different methods to communicate with each others, such as corresponding through letters, signaling etc. In 1876, a famous scientist, inventor, engineer and leading light, named Alexander Graham Bell invented the very first communicating device called Telephone; this invention brought revolutionary change in the world of communication. This telephonic communication processed on the fixed line using coaxial wire. As the years passed, different inventions took place, different ways of communication introduced and technology improvised. People were getting familiar with those devices for communication. Engineers compelled to think that how to achieve an effective way of communication.

Scientists researched and introduced different methods, techniques for communications such as wireless communication, simplex, and full duplex

communication. GSM, Wi-Fi, WiMax, Fiber Optics, Radar, Sonar, Satellite etc; these all are the types of basic and new ways of communication. EM waves cannot propagate over long distance underwater, to overcome this barrier in communication, the researchers or scientist found Acoustic waves by three characteristics i.e. frequency, wavelength, and amplitude [3]. Acoustic waves are longitudinal waves that provide the occurrence of interference, diffraction and reflection. Dont have any polarization on sound waves since they have the same route of vibration as their route of travel. The propagation of acoustic waves is specified via speed of sound. The law followed by the reflection process is the angle of incidence equals to the angle of reflection. The waves caused by reflection wit h the incident wave generating patterns of constructive and destructive interference. Diffraction causes through the bending of waves around the small obstruction and the spreading out of beyond the small gap. In such cases diffraction helps sound to bend around the obstacle. Two or more sound waves that have different sources of propagation reaching at the same time, they interact with each other to form another wave. This wave is the result of all different waves that are present at the same time, this interaction of wave provides the phenomena for interference. Basically ultrasonic transducer is an acoustic wave transmitter or receiver that propagates frequency range above from 20 KHz
[4] [2]

. Acoustic

wave is a fluctuation of stress through a solid, liquid or gas in a wave pattern. It is defined

. An

ultrasonic sensor can transmit ultrasonic waves into air as well as in water, and detects the reflected waves from any object that the signal reflects from and approaching towards it. There are so many applications that an ultrasonic transducer can be able to used in such as; automatic door openers, backup sensors for automobiles, in interference alarm systems, distance measuring etc[5].

Whereas the velocity of wave transmission is expressed by the multiplication of frequency and the wavelength, and the velocity of the EM wave is 3 x 10 8 meter per second, whereas the velocity of the sound wave propagation in air is as slow as about 344 meter per second (at 20C to 22C, or 293.15 K to 295.15 K). At these slower speeds of sound waves, the wavelengths are short, so therefore it means that the higher resolution of distance and a path can be obtained from it
[6]

. Because of the higher resolution, it

might be possible to get the higher measurement that can make large accuracy, and the surface dimension of the ultrasonic transducer can be able with no difficulty to acquire the specific radiation. In order to detect the presence of an object, the ultrasonic waves are reflected from objects. Because metal, concrete, rubber, wood, glass, and paper etc reflect approximately 100% of ultrasonic waves, because of the relative permittivity of the objects, it is noted that if the relative permittivity of anything that is greater than 1.1, then it can be able to reflect the ultrasonic waves, and also by making up the angle we can increase the distance according to the law of reflection[7]. Absorption can also effect the ultrasonic wave because of the selection of an object that has relative permittivity same as cloth, wool, cotton, etc. are difficult to detect, and it may also be difficult also to detect the objects that having larger surface undulation because of irregular reflection. The strength of ultrasonic wave is directly proportional to the distance; this is caused by diffusion loss on a sphere-shaped surface due to diffraction occurrence and inclusion loss that the energy is occupied by the channel. As higher the frequency of an ultrasonic wave, the larger attenuation rate and also the shorter space, the wave reaches. As we move on the wireless communication, the ultrasonic communication is also a wireless way to communicate. Basically the ultrasonic transducers have frequency higher than the rate of humans hearing i.e. above from 20 KHz. This new technology could be an option or an approach to the accessible IR and R.F. based communication systems for small and secured way of communication.

1.2

Structure of the Report


The Chapter 1 is the introduction of this project, which describes the history/background of the project, project objectives that how we are arranging the work in this project and then the structure of the report that what we are doing in the topics of the project. The remaining chapters are organized as given below. Chapter 2 discusses the description of the basic concepts of Acoustic, Acoustic Communication, early implementations in it, and further about the ultrasonic transducer. Chapter 3 briefly describes the underwater acoustic communication, it consist of the early research in the field of underwater acoustic communication. Further describes the channel characteristics. It also consists of the working with SONAR, transducers and modern research in the Underwater Acoustic Communication. Chapter 4 includes the overall system model, block diagram, detailed description of each block and the Project features. Chapter 5 consists of the hardware section. All the hardware working of this project described in this chapter, that what are we going to do for powering up the project, Serial communication, interfacing the hardware, ultrasonic transducer and microcontroller. Chapter 6 consists of the software section.In this section, we described that how we are interfacing the hardware through the software and how we are burning the microcontroller and the software that used as a compiler for microcontroller. Chapter 7 consists of the programming of this project. For this purpose, we proposed different programs for the serial communication in this project, which is written in C and ASSEMBLY language.

Chapter 8 describes the Conclusion and the Future work in this Project.

1.3

Project Objective
The objective of this project is to describe the newly way to communicate by

using the water as a medium, that would permit the ultrasonic communication systems to be used efficiently under the circumstances of the medium. PC is being used on both sides, for sending and receiving the data. Following are the targets that we had followed during this project.

Target 1
Study the basics of the UWA and the conditions of the ultrasonic transducers.

Target 2
Study the equipments of the UWA, which are used in the project and research on the UWU (Underwater Ultrasonic Communication), and to study the ultrasonic transducers.

Target 3
Designing of the ultrasonic transceivers that are being used bi-directional communication underwater.

Target 4
Designing the microcontroller transmitter and receiver, that connects the ultrasonic transducer both sides in water.

Target 5
Programming the microcontroller devices, that receives data from the PC1 and then it will send that data to the ultrasonic transducer for conversion of the signal from electrical to acoustic.

Target 6
We are studying the encryption algorithms for securing the data from involving the 3rd party, because data will spread underwater.

Target7
Making a device, that takes input from Serial COM port, and shows data on the transmitting PC for authentication, in which we have to use the encryption algorithm for security of the data.

Target 8
First, cascading these two devices through each other, and checking the outcome.

Target 9
After receiving the data at the receiving micro-controller, decryption block is used to decrypt the data and get the original data from it.

CHAPTER 2 ACOUSTIC COMMUNICATION

2.1

Description
Sound is a sensation of acoustic waves (disturbance/pressure fluctuations setup in

a medium).Unpleasant, unwanted, disturbing sound is generally treated as Noise and is a highly subjective feeling. Sound is a disturbance that propagates through a medium having properties of inertia (mass) and elasticity. The medium by which the audible waves are transmitted is air. Basically sound propagation is simply the molecular transfer of motional energy. Hence it cannot pass through vacuum. The disturbance gradually diminishes in strength as it travels outwards, since the initial amount of energy is gradually spreading over a wide area. If the disturbance is confined to one dimension (tube / thin rod), it does not diminish as it travels (except for the loss of acoustic energy at the walls of the tube). [8]

2.1.1 Basic Concept


Sound is a pressure wave that propagates through an elastic media. It is molecular transfer of motion energy cannot transfer through vacuum. Elasticity and inertia are the desired characteristics of the medium.

Fundamental mechanisms responsible for sound generation are Vibration of solid bodies-structure born sound. Turbulence, unsteady flow induced sound-aerodynamic sound. Structure borne sound region of interest is surrounding fluid. The source which generates sound is external to the medium. Aerodynamic sound sources of sound are not readily identifiable. Region of interest is within fluid or external to it.

2.1.2 Speed of sound


The rate at which the disturbance (sound wave) travels property of the medium

Alternatively,

Where, C = Speed of sound = Ratio of specific heat , = Pressure and density R = Universal gas constant T = Temperature in K

M = Molecular weight = 0 (1 + ) 273

25 = 343.5 / 40 = 355 / Speed of light is 299,792,458 m/s Speed of sound in air is 344 m/s

2.2

Early Implementations
Before the 7th century BC, the earliest Greek theorist Pythagoras required to

distinguish why several harmonious intervals seemed more beautiful than others, and he found answers in stipulations of arithmetical ratios representing the harmonic connotation sequence on a string. He presumed to have pragmatic that when the lengths of vibrating strings are expressible as ratios of integers (e.g. 1 to 2, 2 to 3).The tones fashioned will be harmonious or melodious. For example, a string sounds the note B when hit, a string twice as long will sound the same note an octave lower. The tones in between are then put forwarded then given by 16:9 for D, 8:5 for E etc. in rising order, understood that sound consisted of contractions and extension to the nature of wave proposition. In about 20 BC, the Roman architect and engineer Vitruvius wrote a dissertation on the aural properties of the theatres counting discussion of obstruction, echoes, and reverberationthe beginnings of architectural acoustics. [9] The substantial indulgent of acoustical processes advanced hastily during and after the scientific insurrection. Mainly Galileo (1564 1642) but also Marin Mersenne (15881648), in parallel, exposed the absolute laws of vibrating strings (completing what Pythagoras and Pythagoreans had started 2000 years earlier). Galileo wrote "Waves are

produced by the vibrations of a sonorous body, which spread through the air, bringing to the tympanum of the ear a stimulus which the mind interprets as sound", a significant declaration that points to the early development of physiological and psychological acoustics. Investigational dimensions of the momentum of sound in air were conceded out lucratively among 1630 and 1680 by a number of investigators, significantly Mersenne. In the intervening time Newton (16421727) derived the relationship for wave velocity in solids, a cornerstone of physical acoustics (Principia, 1687). The 18th century saw major advances in acoustics as mathematicians applied the techniques of calculus to feature the theories of sound wave propagation. Before the 20th century the major figures of mathematical acoustics were Helmholtz in Germany, who consolidated the field of physiological acoustics, and Lord Rayleigh in England, who combined the previous knowledge with his own numerous contributions to the field in his massive work The Theory of Sound. Also in the same century, Wheatstone, Ohm, and Henry developed the analogy between electricity and acoustics. The 20th century saw rapidly increasing of technological applications of the large body of scientific knowledge that was by then in place. The first application was Sabines revolutionary work in architectural acoustics, and many others followed. Underwater acoustics was used for detecting submarines in the 1stWorld War sound recording and the telephone played important roles in a global transformation of society. Sound measurement and analysis reached new levels of exactness and complexity through the use of electronics and computing. The ultrasonic frequency range enabled entirely new kinds of application in medicine and industry. New kinds of transducers (generators and receivers of acoustic energy) were made-up and put to use.

2.3

Acoustic
Acoustic is the physical characteristics of sound and the intelligence of hearing. It

can be defined as the science that deals with the transmission, controlling, reception and the sound effects. Acoustic wave includes in the Sonar, medical ultrasound, electro acoustic communication and bio-acoustics communication. Acoustic is the interdisciplinary science that deals with the study of all mechanical waves in gases, liquids, and solids including vibration, sound, ultrasound and etc. A scientist who works and study in the field of acoustics is an acoustician. The application of acoustics can be seen in all parts of modern society with the most obvious being the audio and noise control industries. Acoustic derived by a Geek word called akoustikos, which mean to hear or ready to hear and akoustikos is derived from akoustos, which means to Heard and Audible, which in turn derives from the verb Akouo which means I hear. The Latin synonym of acoustic is Sonic. There are wide range of acoustic waves, frequencies or spectrum, those frequencies are above from the audible or hearing range is called Ultrasonic and those frequencies which are below than the audible or hearing range is called Infrasonic.

2.4

Acoustic Communication
Sound is produced when a physical objects vibrates rapidly, disturbs nearby (or

other surrounding medium), and generates compression waves that travel in all directions away from the source. We perceive these waves as sound when they collide with our ear drum and cause a mechanical disturbance that is detected by sensory neurons in our inner ear. Both living and non-living objects produce sound, but only animals use it as a means of communication.

Sound serves as a very effective communication modality. It can be made to vary frequency (High pitch VS Low pitch), amplitude (loudness), and periodicity (the temporal pattern of frequency and amplitude). Since the sound wave moves rapidly through air about 331 m/sec. Acoustic signals can be quickly started, stopped, or modified to send a time-sensitive message.

2.5

Ultrasonic
The term "Ultrasonic" applied to sound refers to anything above the frequencies

of audible sound, and nominally includes anything over 20,000 Hz. Frequencies used for medical diagnostic ultrasound scans extend to 10 MHz and beyond. Sounds in the range 20 100 KHz are commonly used for communication and navigation by bats, dolphins, and some other species. Much higher frequencies, in the range 1 - 20 MHz, are used for medical ultrasound. Such sounds are produced by ultrasonic transducers. A wide variety of medical diagnostic applications use both the echo time and the Doppler shift of the reflected sounds to measure the distance to internal organs and structures and the speed of movement of those structures. Typical is the echocardiogram, in which a moving image of the heart's action is produced in video form with false colors to indicate the speed and direction of blood flow and heart valve movements. Ultrasound imaging near the surface of the body is capable of resolutions less than a millimeter. The resolution decreases with the depth of penetration since lower frequencies must be used. The use of longer wavelengths implies lower resolution since the maximum resolution of any imaging process is proportional to the wavelength of the imaging wave. [10] Ultrasonic sensor or transducer used for measuring distance of moving objects, presence detection, ranging, proximity sensor, level monitoring and others like scientific, automated and industrial applications. These sensors are not affected by the high moisture environment, dust and dirt. It works on the sound wave detection techniques.

The frequency of 40 KHz transducer is designed for the communication in the air as a medium. Whereas the sensors direct contact with water and the operating frequency is usually about 20 KHz to 38 KHz. The direct coupling with the water gives better efficiency of the transmission.

CHAPTER 3 UNDERWATER ACOUSTIC COMMUNICATION

3.1

Early Research
In 1687 Isaac Newton wrote his Mathematical Principles of Natural Philosophy

which included the first mathematical treatment of sound. The next major step in the development of underwater acoustics was made by Daniel Colladon, a Swiss physicist, and Charles Sturm, a French mathematician. In 1826, on Lake Geneva, they measured the elapsed time between a flash of light and the sound of a submerged ship's bell heard using an underwater listening horn. They measured a sound speed of 1435 meters per second over a 17 kilometer distance, providing the first quantitative measurement of sound speed in water. The result they obtained was within about 2% of currently accepted values. In 1877 Lord Rayleigh wrote the Theory of Sound and established modern acoustic theory. Before 1920, there was a paper published for underwater acoustics communication, tentatively describing the refraction of sound waves that was formed by temperature and salinity gradients in the ocean. The range predictions of the paper were experimentally validated by transmission loss measurements. The next two decades saw the development of several applications of underwater acoustics. The fathometer, or depth sounder, was developed commercially during the 1920s. Originally natural materials were used for the transducers, but by the 1930s sonar systems incorporating piezoelectric transducers made from synthetic materials were being used for passive listening systems and for active echo-ranging systems. These systems were used to good effect during World War II by both submarines and antisubmarine vessels. Many advances in underwater acoustics were made which were summarized later in the series Physics of Sound in the Sea, published in 1946 [11].

The past 30 years have observed that a growing interest in underwater acoustic communications because of its applications in marine research, oceanography, marine commercial operations, the offshore oil industry and defense. It has been resulted after the research over the years in improved presentation and strength as compared to the initial communication systems.

3.2

Underwater Ultrasonic Communication


Basically, it is much harder to produce sound underwater because the water has

greater acoustic resistance (or impedance), which is the (mathematical) product of its density and acoustic velocity. Impedance should not be confused with signal attenuationunderwater signals take more energy to propagate, but can travel longer distances. The most important concept in underwater communication is the electronic transducer. A transducer converts energy from one from to another, in this case, from an electrical signal into an ultrasonic wave that can propagate through the water, and back into an electrical signal. Air-coupled transducers (such as electrostatic, moving coil and moving armature) are not appropriate underwater due to their poor impedance match with water. Ceramic transducers (and all transducers relying on piezoelectricity properties) have better-sited impedance, and are used comprehensively. Some of these need large DC biases to work (hundreds of volts). Transducers that convert from an acoustic to an electrical signal are usually called hydrophones. Ones that convert from an electrical to an acoustic signal are usually called projectors. Most transducers work using the piezoelectric effect. This refers to the electric field resulting from the mechanical stressing of certain crystalline substances, and the strain produced in the substance by supplying the electric field.

3.3

Channel Characteristics
The channel characteristics of underwater acoustic communication determines the

maximum data rate that can be supported by an acoustic channel for a given source power and source/receiver configuration. Broadband acoustic propagation modeling is applied to estimate the channel capacity of a shallow water waveguide for a single source-receiver pair, both with and without source bandwidth constraints. Range-independent environment defined by the mean (time-averaged) sound speed profile measured at a site in the 1995 SWARM experiment. Without bandwidth constraints, estimated channel capacities approach 10 megabits per second at 1 km range, but after 2 km range they decay at a rate consistent with that of estimated, which were based on a sonar equation analysis for a generic underwater channel. Channel capacities subject to source bandwidth constraints are approximately 30! 90% lower than the upper bounds predicted by the sonar equation analysis, and exhibit significant wind speed dependence. Simulations of internal wave effects on channel capacity show minimal effects at low frequencies but, at 2500 Hz, show a significant increase in the channel capacity at longer ranges. In observe, additional constraints are compulsory on the source spectrum by the bandwidth restrictions of actually achievable transducers. Broadband acoustic propagation modeling is applied to guess the acoustic communication channel capacity of a shallow water waveguide as a function of range for a single source-receiver pair, both for unrestricted source bandwidth and for the limited bandwidths afforded by state-ofthe-art transducers. We also present a preliminary examination, confined to a limited frequency band, of the effects of internal wave induced channel fluctuations on the channel capacity. In early work in communication theory, the problem of determining the capacity of a linear communication channel with Gaussian source and perfectly known channel impulse response function was formulated as an external problem, leading to the explicit water fill solution of. Recent work has extended the determination of channel

capacities to include simple channel models with, e.g., Rayleigh signal fading statistics. Significant work remains before these analyses can be extended to realistic representations of time-varying underwater acoustic channels. The question of the maximum data rate has important practical implications. One would like to know what is theoretically possible and what causes degradation in the data rate. To obtain an upper bound on the channel capacity, we will assume that both the transmitter and receiver know the channel transfer function exactly for each transmission, and that the channel function does not vary during each transmission. These assumptions idealize the actual underwater acoustic communication scenario, in which there is a finite time, determined by the temporal coherence function, during which the channel transfer function varies minimally and can be learned, to considerable accuracy, through probe signals. The data rates of very short packets are experimentally measurable and can be compared with the theoretical channel capacity.

3.4

Working with SONAR


During the 1930s American engineers developed their own underwater sound

detection technology and important discoveries were made, such as thermo clines that would help future development. After technical information was exchanged between the two countries during the Second World War, Americans began to use the term SONAR for their systems, coined as the equivalent of RADAR. The detection, classification and localization performance of sonar depends on the environment and the receiving equipment, as well as the transmitting equipment in active sonar or the target radiated noise in a passive sonar. Sonar operation is affected by variations in sound speed particularly in the vertical plane. Sound travels more slowly in fresh water than in sea water though the difference is small. The speed is determined by the water's bulk modulus and mass density.

CHAPTER 4 SYSTEM MODEL

4.1

Basic Model
The basic concept of the project is referred to general communication model,

based on the sender, receiver and a channel between them. For half duplex communication the model can be shown as;

Figure 4.1: Basic Model

The basic model for the project is based on; Ultrasonic transducers with sender and a receiver, and channel that is in between them. The basic underwater acoustic communication in which channel is water, can be shown as:

Figure 4.2: Basic Acoustic Communication Model

4.2

Overall System Model


The system model is basically depended on some real diagrams of the modules

that are being used in this project. It includes the practically implemented flow of the communication. The flow of communication consists of computer, encryption/decryption module, transceiver and ultrasonic transducer. The computers are used for input purpose, the hyper terminal software used for sending and receiving the data using the serial interface, encryption and decryption are used for securing the information between the sender and receiver, the sound waves have the spreading characteristics, in that case information would be spreading throughout the channel, and any other 3rd party can intercept the data, so encryption and decryption are introduced. Transceiver includes the modulation and demodulation of the information, the superimposition of the message signal on the carrier signal is done by using transceiver. The ultrasonic transducers are used to excite the information on the channel.

This model is based on the bidirectional communication, so it can transmit and receive the data. The practically implemented system model for the underwater acoustic communication is shown as:

Figure 4.3: Overall System Model

4.3

Block Diagram

Data

Encryption/ Decryption

Transceiver

Noise

Channel

Data

Decryption/ Encryption

Transceiver

Figure: 4.4: Block Diagram

4.4

Ultrasonic Transducers
The ultrasonic transducers are used to convert electrical signal to acoustic signal

or ultrasonic signal and vice versa. Ultrasonic sensor or transducer used for measuring distance of moving objects, presence detection, ranging, proximity sensor, level monitoring and others like scientific, automated and industrial applications. These sensors are not affected by the high moisture environment, dust and dirt. It works one the sound wave detection techniques. The frequency of 40 KHz transducer is designed for the communication in the air as a medium. Whereas the sensors direct contact with water and the operating frequency is usually about 20 KHz to 40 KHz. The direct coupling with the water gets better the efficiency of the transmission.

Figure: 4.5: Ultrasonic Transducer [12]

4.5

Microcontroller
A microcontroller is an electronic device consists of a microprocessor, ROM and

RAM, various timers I/O parallel and serial ports all embedded on a single chip. In latest controllers it also includes DAC and ADC. We have different architectures of microcontroller like 8051, PIC, AVR and ATML. According to the requirement to do a variety of functions microcontroller can be programmed for that specific task. Microcontrollers are mainly used in the embedded systems where required a less computing power. For the execution of program burning is required on the chip (ROM) with the help of relevant compiler and a burner device. The two basic programming languages are commonly used i.e. C language and assembly language. It controls the output of the digital and analog signals fluctuation by using the programming code. It controls the physical disturbance using the sensors at the output and other sensors like acoustic, ultrasonic, proximity, moving objects and temperature.

Figure 4.5: Microcontroller (ATMEGA8) [13]

The internal architecture of the microcontroller based on timers, counters, RAM, ROM, and CPU, interrupt control, BUS control, Serial TX and RX, Parallel data and addressing, and oscillator. The oscillator is the key factor for the selection of the baud rate.

Figure 4.6: Structure of Microcontroller (ATMEGA8) [14]

4.6

Encryption/Decryption
The use of the encryption/decryption is as old as the act of the communication. In

war time a cipher often incorrectly called a code, which can be employed or implemented to keep the enemy from obtaining the contents of transmission. Simple ciphers include a substitution of letter for numbers the rotation of letter in the alphabet and the scrambling of the voice signal by inverting the side band frequency.

Encryption is especially important in wireless communication because wireless circuits are easier to tap than to tap the wired communication. Considering the sound waves that have spreading effect, it requires encryption and decryption to secure the information. There are generally two kinds of encryption and decryption techniques one is symmetric and other one is Asymmetric. Symmetric comprises same key at both the ends, while Asymmetric involves different key at both the ends. The algorithm of the encryption and decryption are programmed on ATMega8 microcontroller.

Figure 4.6: Symmetric Encryption [15]

4.7

Transceiver
Transceiver is the merger of transmitter and receiver means it can transmit and

receive the information at a time. It comprises modulation and demodulation; it involves superimposition of information signal on the carrier signal. The carrier frequency of the transceiver operates on 40 KHz. Digital modulation technique is being used for underwater acoustic communication.

The ultrasonic sensors or transducers are linked with the transceiver in order to transmit and receive the acoustic signal or ultrasonic signal. The input of the transceiver is based on the serial data send by the computer. The data consist of the binary bits and these bits are then assigned corresponding waveforms in order to transmit and receive the signal through the acoustic or ultrasonic transducers. MAX-232 and AT89c2051 microcontroller are used to assemble transceiver, in which RS-232 protocol is being used.

4.8

Project Features

4.8.1 Facilities
This Project is cheap, because we are using the Ultrasonic transducer instead of using SONAR, hydrophones etc, because they are very costly device and confidential. By using the Ultrasonic transducer, that converts the electrical energy to acoustics, it could be an alternate way of communication in underwater environment.

4.8.2 Problems Solved


This Project can solve the problem for the communication underwater by embedding it on a system that communicates with each others, for e.g. an AUV system with another AUV system or an ROV with another ROV system.

4.8.3 Advantages
Low absorption characteristics for underwater communication Communication will be secured It can be used in AUV & ROV system It can be useful in mammal researching projects

CHAPTER 5 HARDWARE SECTION

5.1 Power
A power supply is a device that supplies electric power to an electrical load. The term is most commonly applied to electric power converters that convert one form of energy (mechanical, chemical, solar) to electrical energy
[16]

. There are basically two

types of power supplies according to our circuitry designing. 1) Linear Regulated Power Supply 2) Switch Mode Power Supply

5.1.1 Linear Regulated Power Supply


The voltage produced by an unregulated power supply will vary depending on load and on the variations in the AC supply voltage. For critical electronic applications, a linear regulator may be used to set the voltage to a precise value, stabilized against fluctuations in input voltage and load. The regulator also greatly reduces the ripple and noise in the output direct current. Linear regulators often provide current limiting, protecting the power supply and attached circuit from over current
[17]

The power supply circuit mainly comprises of four basic parts i.e. given below: a) Transformer b) Bridge Rectifier c) Shunt Capacitors d) Voltage Regulators

The transformer steps down the 220V a/c and works on the principle of magnetic induction, where two coils i.e. primary and secondary are wounded around an iron core. The two coils are physically insulated from each other in such a way that passing an a/c current through the primary coil creates a changing voltage in the primary coil and a changing magnetic field in the core. This in turn induces a varying a/c voltage in the secondary coil [18]. The output of the transformer is then fed to the bridge rectifier. It rectifies the AC signal into full-wave rectifier. The full-wave rectifier converts the whole of the input waveform to one of the constant polarity (positive or negative) at its output. Full-wave rectification converts both polarities of the input waveform to DC (direct current), and yields a higher mean output voltage. Two diodes and a center tapped transformer, or four diodes in a bridge configuration and any AC source (including a transformer without center tap), are needed [19]. For details, refer Appendix B.

5.1.2 Switched-Mode Power Supply


A switched-mode power supply (SMPS or switcher) is an electronic power supply that incorporates a switching regulator to convert electrical power efficiently. Like other power supplies, an SMPS transfers power from a source to a load, while converting voltage and current characteristics. An SMPS is usually employed to efficiently provide a regulated output voltage, typically at a level different from the input voltage. Unlike a linear power supply, the pass transistor of a switching-mode supply continually switches between low-dissipation, full-on and full-off states, and spends very little time in the high dissipation transitions (which minimizes wasted energy). Ideally, a switched-mode power supply dissipates no power. Voltage regulation is achieved by varying the ratio of on-to-off time. In contrast, a linear power supply regulates the output voltage by continually dissipating power in the pass transistor. This higher power conversion efficiency is an important advantage of a switched-mode power supply.

Switching regulators are used as replacements for the linear regulators when higher efficiency, smaller size or lighter weight is required. They are, however, more complicated; their switching currents can cause electrical noise problems if not carefully suppressed and simple designs may have a poor power factor Appendix B.
[20]

. For details, refer

5.2

Microcontroller (at89c51, at89c2051, atmega8)


Three different series of microcontroller are being used to develop hardware for

serial interface, encryption/decryption and transceiver. Following are the series: AT89c51 ATmega8 AT89c2051

AT89c51
This microcontroller is being used to develop demo codes for serial interfacing using assembly and C language, it consist of 40 pins having 3 ports for parallel communication or interfacing devices, each port consist of 8 pins and each pin operates on one bit. Each port contains 8 bits or 1 byte of data. For serial communication it has 2 pins, one for transmit and other one is for receive. Two pins for clock or oscillation, the crystal decide the baud rate for serial communication. Initializing of the timer is necessary to enable serial communication. For details, refer Appendix C.

Figure 5.1: Microcontroller (AT89c51) [21]

ATmega8
This belongs to AVR family of the microcontroller, in the project four ATmega8 microcontrollers are being 2 for each side means two for transmission and 2 for reception, and the two microcontrollers contains serial interfacing and

encryption/decryption, at one side both the microcontrollers are linked using port2 P2. The major controllers input and output are dependent on serial data with 9600 baud rate; this baud rate is achieved by using the crystal 11.059 MHzs. For reset the communication pin no. 1 is used. This microcontroller operates on 2.7v to 5v with a current of 3.6mA to 15mA. The input of the encryption/decryption microcontroller is based on the P2, NOT or inverter command is used to encrypt or decrypt the bits with an addition of one bit. After that the encrypted bits are then placed on the SBUF register of the microcontroller, then initialize the timer T1 and transmit the data using TX pin of microcontroller, and vice versa for bidirectional communication. The code is developed on C language and compiled on the KEIL software. For details, refer Appendix A & C.

Figure 5.2: Microcontroller (ATMEGA8) [22]

AT89c2051
This microcontroller belongs to Atmel family, it consist of 20 pins with one general purpose port for interfacing the sensors or other devices, having the programmable serial UART. This controller is used to develop the transceiver. This transceiver is based on the 9600 baud rate or symbol rate. TX and RX pins are used to send and receive the data using the sensors. Whenever any disturbance occurs at sensor it gives the high bit to the microcontroller, then it will receive the data. The ultrasonic sensors are linked to the parallel port of the microcontroller. For details, refer Appendix A& C.

Figure 5.3: Microcontroller (AT89c2051) [23]

5.3

Ultrasonic Transducer
The ultrasonic transducers are the equipment that sends or receive the ultrasonic

waves. In this project, two transducers are used at a same place for transmission and reception of the signal. These transducers are fully packed from the silicone gel for avoiding water and will be operating by the power supply. This sensor operates on 5V with a current of 15mA.These transducers are working like an antenna that radiates the sound waves. For details, refer Appendix C.

5.4

Transceiver
The operation of the transceiver is to transmit and to receive; it consists of

transmitter and receiver circuit on a microcontroller based on 20 pins i.e. AT89C2051. This transceiver includes modulation and demodulation using the BPSK technique. This technique allows a modulated signal with two state of phase 0 and . BPSK modulation consists of a phase modulation with the state of intermediate frequency by a serialized numerical signal. It has the fixed amplitude. It has one fixed phase when the data is at one level and when the data is at the other level, phase is different by 180 degree. VBPSK (t) = b (t) 2 cos 2 Where, b (t) = +1or -1, for NRZ, fc is the carrier frequency, and T is the bit duration. The signal has a power, so that, where A represents the peak value of sinusoidal carrier. The receive signal has the waveform VBPSK (t) = b (t) 2 cos(2 + ) where, is phase shift introduced by the channel, it is done due to synchronous modulation [24].

Figure 5.4: BPSK Signal [25]

5.5

PC to Serial Interfacing
It is done by using the hyper terminal software in windows, the data is serially out

or in from the DB9 or DB25 ports of the computer. In serial communication, the information transmits one bit at a time or one bit after the other. In order to communicate computer with any device the RS-232 protocol is required.

DB-9 Pin

Signal Name

IDC Dir Description internal (newer)*

IDC internal (older)*

CD

Carrier Detect

RXD

Receive Data

TXD

Transmit Data

DTR

Data Terminal Ready

GND

System Ground

DSR

Data Set Ready

RTS

Request to Send

CTS

Clear to Send

RI

Ring Indicator

Figure 5.5: DB-9 Pin Chart

5.6

Block Diagram of Serial Communication

Figure 5.6: Block Diagram

CHAPTER 6 SOFTWARE SECTION

Software is the set of instructions, programs, procedures and algorithms that has related data that provides the instructions to the microprocessor that what to do and how to do. There are two types of software application software and operating system software, however our work is not concerned with the operating system software but using the following tools and application software to achieve our task such as: 1. KEIL 2. MATLAB 3. HYPERTERMINAL

6.1

KEIL
KEIL compiler is the software where the machine language code is used to

compile and after compilation of machine code it converts into the hex code for microcontroller for further processing. KEIL is the cross compiler that also supports C language, there is the difference in between compiler and cross compiler. Compiler is the program that translates the source code to the object code. It reorganizes the instructions into the way it works for the microcontroller. Similarly, the cross compiler has same functionality but it is more specific when using cross compiler because it works on targeted processors that varies on processors specifications.

Figure 6.1: KEIL

6.1.1 Working with KEIL Software


For getting started and working with KEIL, here are the following procedures to start with. Click on start button, then program, and then click the KEIL software, the following window should appear on screen.

Figure 6.2: Working with KEIL You can see three different windows in this screen.

1. Project work space window 2. Editing window 3. Output window

Project workspace window is for showing all the interrelated files connected with your task. Editing window is the place where you will edit the code. Output window will show the output when you compile or build or run your project.

6.1.2 Starting with New Project


Now to start with new project track the steps. Click on project menu and select the new project Create the new project in specified directory. Now, move to the directory and create new folder for project name first.

Figure 6.3: Starting a New Project Give the name test of project. Choose the target device for which we are writing the code.

Scroll down the cursor and choose Generic and select 8051 (all variants) .

Figure 6.4: Selecting Device

Click OK and then it will be asked to add startup code, Click Yes.

Figure 6.5: Setting up Software

Now, click on file menu and select the new file. Start writing program on C but we still have to add header file. Right click on file and select and open document <reg51.h>. The following window should appear.

Figure 6.6: Creating Source File

Now, we can write the code same as C language start with void main () Right click on Source Group 1 in workspace window. Select add files to Source Group1. Select the C file where the code is edited and click Add Button.

Figure 6.7: Adding File to Source Group The C file should be added on source group Compile the program from project menu and select build target Now, you are ready to run your program. From debug menu select start/stop debug session

Figure 6.8: Debugging Program To RUN the program you can use any of option provided go, step by step, step forward etc. Down load your program on targeted board that is 8051, for this you must create Hex file. Right click on target 1 and select option for target 1. Following window should appear.

Figure 6.9: Creating HEX File Select output tag and check create hex file box Now, Hex file is created This file can directly be loaded in 8051 and RUN the application Here, it is clearly described the procedure to create a project in KEIL for 8051 microcontroller similarly; it is used to create a project for ATMEL microcontrollers such as 89c51 and ATMega8 by using the KEIL software to write the code.

6.2

MATLAB
MATLAB (matrix laboratory) is the fourth generation programming language.

MATLAB allows the matrix manipulation, implementation of algorithms, plotting of functions, creation of UI (user interface) and interfacing with other languages such as C, C++, Java and Fortan.

Figure 6.10: MATLAB MATLAB is the high performance language for any technical computing nowadays. It is the modern programming language which provides the environment like data structures, built-in editing and debugging tools that supports the object oriented programming. MATLAB is the very efficient tool for learning purpose and doing experiments using MATLAB and also for research work.

6.2.1 Configuring Serial Port Communication by using tmtool


We can also do serial port communication by using the MATLAB command tmtool. Basically tmtool is the syntax of Test and Measurement Tool. The Test and Measurement tool shows the resources of (interfaces, drivers, hardware etc.) that are accessible to the toolboxes that supports it, and enables you to communicate and configure with those resources.

This tool enables to do the following: Detect available hardware and drivers Connect to and instrument or device Configure instrument and device settings Read and Write data Automatically generates the MATLAB script Visualize acquired data to MATLAB workspace

Figure 6.11: Test & Measurement Tool This following figure is showing the general description of the tool and getting started with the Test and Measurement Tool.

6.2.2 MATLAB with Serial Devices (RS-232)


Using MATLAB with Serial Devices (such as RS-232), MATLAB supports communication with serial devices including RS-232 when using the Instrument Control Toolbox. There are many devices with serial interfaces, including gas chronometers, mass spectrometers, imaging devices, pulse oximeters, and instruments. The toolbox provides a graphical tool that allows you to configure, control, and acquire data from your serial device without writing code. The tool automatically generates MATLAB code that allows you to reuse your work. generated by the tool. This code example below shows you how you can communicate with your serial device using MATLAB. The "*IDN?" command was used which is a typical command for communicating with an instrument. The commands you can use will depend on what your serial device supports. Automatically generating a report in MATLAB, Press the "Save and Publish to HTML" button in the MATLAB Editor to execute this code example and automatically generate a report of your work with the serial device. It automatically generates MATLAB script for your RS-232 device. To automatically create your own MATLAB script, launch "tmtool". Open the "Hardware" node, open the "Serial" node, select your serial port (such as COM1, press the "connect" button. Once connected, enter your device commands in the right pane, press "Session log" to see the code generated, and press "Save Session" to save the code to a MATLAB (.m) file. MATLAB script automatically generated for the RS-232 device, the following MATLAB script was automatically generated by interacting with the device configuration tool provided by the toolbox. The code example below was automatically

6.3

HyperTerminal
HyperTerminal (also known as Hyper Term) is a communications and terminal

emulation program that comes with the Windows operating system, beginning with Windows 98. HyperTerminal can be used to set up a dial-up connection to another computer through the internal modem using Telnet of to access a bulletin board service (BBS) in another computer. It can also be used to set up a connection for data transfer between two computers (such as your desktop computer and a portable computer) using the serial ports and for serial-port control of external devices of systems such as scientific instruments, robots, or radio communications stations. HyperTerminal can also be used as a troubleshooting tool when setting up and using a modem. You can send commands through HyperTerminal to make sure that your modem is connected properly. It is developed by Hilgraeve from a more comprehensive communication program called Hyper ACCESS. HyperTerminal has features similar to the Linux program, minicom. In Windows XP, HyperTerminal can be located from the start menu. ( Start ==> Programs ==> Accessories ==> Communications ==> HyperTerminal). In

Windows 7, you can install it manually through internet. It would be located after installing in Windows 7 by setting its default location in installation (C:\Program Files\Windows NT\HyperTerminal\HyperTrm). We are using the Serial COM port to communicate through HyperTerminal from 1 PC to another. In this process, there are several settings to configure the COM port to communicate i.e. the Baud-rate, Data bits, Parity, Stop bit and Flow Control.

6.3.1 Baud-Rate
Baud-Rate is a technical term associated with modems, digital televisions, and other technical devices. It is also known as symbol rate and modulation rate. The term roughly means the speed that data is transmitted. It is a derived value based on the number of symbols transmitted per second. The Baud-Rate is associated with many mathematical formulas. Its units are either symbols per second or pulses per second. Baud can be determined by using the following formula given below: Baud = (Gross Bit Rate / Number of Bits per Symbol) This can be used to translate baud into a bit rate using the following formula given below: Bit Rate = (Bits per Symbol * Symbol Rate) Baud can be abbreviated using the shortened form Bd when being used for technical purposes. In HyperTerminal, there are several Baud-Rates starting from 110 to 921600. The significance of these formulas is that higher Baud-Rate equate to greater amounts of data transmission as long as the bits per symbols are the same. A system using 4800 Baud modems that has 4 bits per symbol will send less data than a system using 9600 Baud modems that also has 4 bits per symbols. So, all other things being equal, a higher Baudrate is generally preferred.

6.3.2 Data Bits


In HyperTerminal, it is the desired value for sending the data in bits. It has minimum 5 bits and maximum 8 bits to send or to receive.

Figure 6.12: Setting up the Data-Bits Select the Parity to none and Stop bits to 1. Select the Flow Control to None.

The following window should appear.

Figure 6.13: Hyper Terminal Now, the HyperTerminal connection is now successfully set to communicate through hardware. You can send data to another end of the HyperTerminal to receive the data.

CHAPTER 7 PROGRAMMING SECTION

7.1

Programming in C & Assembly Language

7.1.1 C-Language
The C programming language is a general purpose language. This was initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs [29]. This design provides construct that map efficiently to typical machine instruction, and therefore it found lasting use in applications that had formerly been coded in assembly language, most notably system software like the UNIX computer operating system [30]. C is one of the most widely used programming languages of all the time.

7.1.2 Syntax in C
C-Language has very easy syntax to write, it has formal grammar specified by the C standard, unlike other languages such as FORTRAN, COBOL etc. C source code is free from which allows arbitrary use of whitespace to format code, rather than columnbased or text-line base restrictions. Comments may appear either between the delimiters /* and */. C source files contain declarations and functions definition. It contains declarations and statements. Declarations either define new types using keywords such as STRUCT, union and ENUM, or assign types to and perhaps reserve storage for new variables, usually by writing the type followed by the variable name. Keywords such as CHAR and INT specify built -in types. Section of code is enclosed in braces {and} to limit the scope of declarations and to act as a single statement for control structures.

As an imperative language, C uses statements to specify actions. The most common statement is an expression statement, consisting of an expression to be evaluated, followed by a semicolon; as a side effect of the evaluation, functions may be called and variables may be assigned new values. To modify the normal sequential execution of statements, C provides several control-flow statements identified by reserved keywords.

7.1.3 Assembly Language


An Assembly language is a low-level programming language for microcontroller, or other programmable device, in which each statement corresponds to a single machine code instruction. Each assembly language is specific to particular computer architecture, in contrast to most high-level programming languages, which are generally portable utility program referred to as an assembler, the conversion process is referred to as assembly, or assembling the code. Assembly language uses a mnemonic to represent each low-level machine operation or op-code. Some op-codes require one or more operands as part of the instruction, and most assemblers can take labels and symbols as operands to represent addresses and constraints, instead of hard coding them into the program. A program written in assembly language consists of a series of processor instructions and meta-statements, comments and data. Assembly language instructions usually consist of an op-code followed by a list of data, arguments or parameters[31].These codes are translated by an assembler into machine language instructions that can be loaded into memory and executed.

7.1.4 Special Functions Registers (SFR)


The special function registers are the dedicated to specific functions such as ALU status, timers, serial communication, Input / Output ports, ADC, and so on. The function of each special function register is fixed by the CPU designer at the time of design because it is used for control of the microcontroller or peripheral. The number of locations in the file registers set aside for SFR depends on the pin numbers and peripheral functions supported by that chip. That number can vary from chip to chip even among members of the same family. There are some special functions registers which are used in Assembly language for microcontroller programming.

Figure 7.1: Special Function Registers Chart

[32]

7.2

8051 Serial Communication Programming


To establish a serial communication link between the PC and the 8051, Serial

communication is often used either to control or to receive data from an embedded microprocessor/microcontroller. Serial communication is a form Input / Output in which the bits of a byte begin transferred appears one after the other in a timed sequence on a single wire. Serial communication has become the standard for inter-computer communication. The port used for serial communication is 3.0 and 3.1 for Rx and Tx respectively. The desired baud rate could be configured through calling the Special Function Register on your command screen. The desired baud rate could be achieved by the following formulation. Baud Rate = XTAL Oscillator / 12 Machine Cycle XTAL Oscillator = 6MHz, 11.0592MHz, 12MHz, etc.

7.2.1 Useful Programs


#include<reg51.h> VoidInitSerial(void) { SCON = 0x52; TMOD = 0x20; TH1 = 0xFD; TR1= 1; } Void main() { InitSerial(); unsigned char trans[]="A",i; for(i=0; i<5;i++) { SBUF=trans[i]; While(!TI); TI=0; } } // Place value in buffer // Wait for transmit //Flag must clear software // setup serial port control // Hardware (9600 Baud-Rate at 11.05592MHZ) // TH1 // Timer 1 on

The above program shows that microcontroller will transmit A from its Tx pin, to SBUF i.e. Serial buffer.

For details, see Appendix A.

7.2.3 Testing Microcontroller

MOV AGAIN: MOV ACALL CPL SJMP ; ------- Time Delay DELAY: HERE1: HERE2: HERE3: MOV MOV MOV DJNZ DJNZ DJNZ RET END

A, #55H P2, A DELAY A AGAIN

R5, #50 R4, #180 R3, #255 R3, HERE3 R4, HERE2 R5, HERE1

The above program will glow the LEDs alternatively with 5 seconds of delay. By this, you can check whether your microcontroller is transmitting or not.

For details, see Appendix A.

CHAPTER 8 CONCLUSION & FUTURE WORK

8.1

Conclusion
Throughout this Project The Underwater Acoustic Communication, it is

possible to communicate bi-directional through the ultrasonic transducer that converts the electrical signal to acoustic signal. This is a complex task to execute as the medium has much unknown varying characteristics. For this purpose, the proposed block diagram is to be of great concerned. The major part of this scheme is to communicate underwater, which is attained as a milestone uptill now. The performance of transceiver has given a great motivation, to implement other parts of the block diagram. In this project, we overviewed the effective challenges for efficient and encrypted communication via water. We considered the peculiarities of the channel depending on the environment of the ocean or sea with the ambient noise. The ultimate goal of this project is to encourage the efforts for development of new and advanced solutions and communication techniques for efficient underwater communication and networking for enhancing the stability and reliability of the project.

8.2

Future Work
There are a lot of works required in the medium to enhance the data rate, to

realize the effective medium. Some of the future works are given below: Analog to Digital (ADC) / Digital to Analog (DAC) Better and more secure encryption technique Advanced ultrasonic transducer Other modulation techniques Multiplexing techniques Channel characteristics Better range

REFERENCE
[1] Definition of Communication, Principles of Communication http://www.scribd.com/doc/23738883/5-Principles-of-Communication [2] Jos S. G. Panaro, Fbio R. B. Lopes, Leni J. Matos and Leonardo M. Barreira, "Underwater Acoustic Noise Model for Shallow Water Communications", the Brazilian Telecommunication, Symposium, September 2012. [3] Ultrasonic Sensors, Application Manual, Murata Manufacturer, August 2008: www.murata.com/products/catalog/pdf/s15e.pdf [4] Ultrasonic Sensors, Application Manual, Murata Manufacturer, August 2008: www.murata.com/products/catalog/pdf/s15e.pdf [5] Ultrasonic Sensors, Application Manual, Murata Manufacturer, August 2008: www.murata.com/products/catalog/pdf/s15e.pdf [6] Ultrasonic Sensors, Application Manual, Murata Manufacturer, August 2008: www.murata.com/products/catalog/pdf/s15e.pdf [7] Ultrasonic Sensors, Application Manual, Murata Manufacturer, August 2008: www.murata.com/products/catalog/pdf/s15e.pdf [8] Description Basic Principles of Engineering Acoustics, Indian Institute of Technology Delhi
http://www.iitr.ac.in/outreach/web/CIRCIS/PG/NVH/Chapter%201%20Basic%20Princip les.pdf

[9]

History of Acoustic, Early Research in Acoustics http://en.wikipedia.org/wiki/Acoustics

[10]

Ultrasonic Sound http://hyperphysics.phy-astr.gsu.edu/hbase/sound/usound.html

[11]

Early Research http://en.wikipedia.org/wiki/Underwater_acoustics

[12]

Figure: Ultrasonic Transducer http://www.societyofrobots.com/robotforum/index.php?topic=13802.0

[13]

Figure: Microcontroller (atmega8) http://electromac.wordpress.com/category/mac-osx-arduino-avr-atmega8atmega168/

[14]

Figure: Structure of Microcontroller http://projectus.freehost7.com/Railway-anticollision-system/?main-hardwarecomponents

[15]

Figure: Symmetric Encryption http://www.devx.com/dbzone/Article/29232/0/page/3

[16]

Definition of Power Supply http://en.wikipedia.org/wiki/Power_supply#Linear_regulated_power_supply

[17]

Linear Regulated Power Supply http://en.wikipedia.org/wiki/Power_supply#Linear_regulated_power_supply

[18]

Description of Power Supply http://www.scribd.com/doc/34802710/Power-Supply-Description

[19]

Description of Rectifier http://en.wikipedia.org/wiki/Rectifier

[20]

Switched-Mode Power Supply http://en.wikipedia.org/wiki/Switched-mode_power_supply

[21]

Figure: At89c51 http://kuliah.andifajar.com/arsitektur-mcs-51/

[22]

Figure: Atmega8 http://www.mikrocontroller.net/mcproject/Pages/AVR/Grundlagen/grundlagen.html

[23]

Figure: At89c2051 http://voltsandbytes.com/8051-tutorial-3-io-port-programming-in-c/

[24]

Transceiver BPSK Modulation http://iitg.vlab.co.in/?sub=59&brch=163&sim=262&cnt=970

[25]

Figure: BPSK Modulation Signal http://iitg.vlab.co.in/?sub=59&brch=163&sim=262&cnt=970

[26]

KEIL http://en.wikipedia.org/wiki/Keil_%28company%29 http://www.keil.com/uvision/

[27]

HyperTerminal Description http://searchenterprisedesktop.techtarget.com/definition/HyperTerminal

[28]

Baud Rate http://www.wisegeek.com/what-is-a-baud-rate.htm

[29]

Giannini, Mario; C/C++The Internet encyclopedia1John Wiley and Sons p.164ISBN 0-47122201-1, Code Fighter, Inc.; Columbia University(2004), In HosseinBidgoli. Retrieved,16thDecember, 2012.

[30]

Lawlis, Patricia K. "Guidelines for Choosing a Computer Language: Support for the Visionary Organization",Ada Information Clearinghouse, (August 1997).

[31]

Intel Architecture Software Developers Manual, Volume 2: Instruction Set Reference. INTEL CORPORATION. 1999. Retrieved 18th November, 2010.

[32]

Figure: Special Function Register (SFR) Muhammad Ali Mazidi, Janice GillispieMazidi, The 8051 Microcontroller and Embedded Systems, Published in 2000 by Pearson Education Inc.

APPENDIX A PROGRAMS

Unidirectional Serial Communication (Receive)


Flow Chart START

INITIATE TIMER & BAUD RATE

INPUT

IF 1 or 0

NO

YES RECEIVE CHAR.

LOAD CHAR. TO PORT 2 TRANSMIT SERIALLY

STOP

Code
MOV SCON, #50h MOV TMOD, #20h MOV TH1, #0fdh SETB TR1 RET ; Initialize serial communication ; Timer 1 Mode 2 ; for 9600 baud-rate ; Start Timer 1

HERE: JNB RI, HERE ; Wait for char to come in ; Save incoming byte in Register A ; Move the contents of A at P2 ; Get ready to receive next byte ; keep getting data

MOV A, SBUF MOV P2, A CLR RI

SJMP HERE

END

Unidirectional Serial Communication (Transmit)


Flow Chart

START

INITIATE TIMER & BAUD RATE

FOR P2=1

FOR P2=0

LOAD CHAR. TO SBUF

TRANSMIT SERIALLY

END

Code
MOV MOV MOV SETB AGAIN: MOV ACALL SJMP A, P2 TRANS AGAIN ; Keep doing it ; Receive contents from P2 to A TMOD, #20H TH1, #0FDH SCON, #50H TR1 ; Timer 1, Mode 2 (Auto-Reload) ; Baud-Rate = 9600 ; 8-bit, 1 stop bit, REN enabled ; Start Timer 1

: -------Serial Data Transfer Subroutine TRANS: MOV HERE: JNB CLR RET END TI, HERE TI ; Wait for last bit to transfer ; Get ready for next byte SBUF, A ; Move contents of A in SBUF

Encryption & Decryption


Flow Chart
START

INITIATE TIMER & BAUD RATE

INPUT CHAR

IF Rx IS 1 OR 0 YES GET CHAR. FROM SBUF

NO

RECEIVE CHAR. FROM PORT 1

ENCRYPT CHAR. LOAD CHAR. TO PORT 2

DECRYPT CHAR.

PUT IN SBUF & TRANSMIT SERIALLY

STOP

Code
#include <avr/io.h> #include <avr/interrupt.h> #include <delay_basic.h>

/******************* Underwater Acoustic Communication **********************/ unsigned char R_data; unsigned char data; void USART_Init_Interrupts( unsigned int baud_rate ); unsigned char USART_Receive( vo11id ); void USART_Transmit( unsigned char transmit_data ); int main () { DDRC=(F<<PC0); p=1; //PORTD=(2<<PD0); //PORTB = 0xFF; SREG=~(0x7F); MCUCR =0x03; GICR=(8<<7);

//PORTC|=(1<<PC0); USART_Init_Interrupts(12); while (p==1) { /*if(R_data==49) { PORTC=(2<<PC0); /* Delay of 1 second */ _delay_loop_2(65536); _delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); /* PORTC=~(8<<PC0); _delay_loop_2(65536); _delay_loop_2(65536); _delay_loop_2(65536); _delay_loop_2(65536); }*/ ;

//1_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //UDR = 49; } }

void USART_Init_Interrupts( unsigned int baud_rate ) { UBRRH = (unsigned char)(baud_rate>>8); UBRRL = (unsigned char)baud_rate; UCSRB= (1<<RXEN)|(1<<TXEN)|(1<<RXCIE)|(1<<TXCIE); UCSRC= (3<UCSZ0); } void USART_Transmit( unsigned char transmit_data ) { /* Wait for empty transmit buffer */ while ( !( UCSRA & (1<<UDRE))) ; /* Copy 9th bit to TXB8

UCSRB &= ~(1<<TXB8); if ( data & 0x0100 ) UCSRB |= (1<<TXB8);*/ /* Put data into buffer, sends the data */ UDR = transmit_data; } unsigned char USART_Receive( void ) { while ( !(UCSRA & (_BV(RXC))) ); return UDR; } ISR(_VECTOR(13)) { reti(); } /* Wait for incomming data */

ISR(_VECTOR(1)) { PORTB^=PORTB; data = PINB;

_delay_loop_2(255); _delay_loop_2(255); UDR = data;

PORTC=1; _delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255);

PORTC=0; //UDR = data; reti(); }

ISR(_VECTOR(11)) { R_data = UDR; PORTB = R_data; _delay_loop_2(255);

_delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255); //PORTD=~(8<<PD3); //_delay_loop_2(1000); PORTC=(8<<PC0); PORTC=~(8<<PC3); //_delay_loop_2(65535); DDRB = 0x00; PORTB=0X00; //PORTD=(8<<PD3);

PORTC=(2<<PC0); _delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255); PORTC=~(2<<PC0); //UDR = R_data; }

Bi-directional Serial Communication by interrupt (Transmit & Receive)


Flow Chart
START

INITIATE TIMER & BAUD RATE

INPUT CHAR

IF RX IS 1 OR 0 YES GET CHAR. FROM SBUF

NO

RECEIVE CHAR. FROM PORT 1 RECEIVING THE DATA

TRANSMITTING THE DATA

LOAD CHAR. TO PORT 2

PUT IN SBUF & TRANSMIT SERIALLY

STOP

Code
#include <avr/io.h> #include <avr/interrupt.h> #include <delay_basic.h>

/*********************** Underwater Acoustic Communication *********************/ unsigned char R_data; unsigned char data; unsigned int r,p;

void USART_Init_Interrupts( unsigned int baud_rate ); unsigned char USART_Receive( void ); void USART_Transmit( unsigned char transmit_data ); void start(); int main () { DDRC=(F<<PC0); p=1;

DDRD=(8<<PD0);

PORTD=8; //PORTD |=(1<<PD2) ; SREG=~(0x7F); MCUCR =0x03; GICR=(8<<7);

//PORTC|=(1<<PC0); /* 9600 baudrate */ USART_Init_Interrupts(12);

while (r<2) { /*if(R_data==49) { PORTC|=(1<<PC1); Delay of 1 second */ //r=1; _delay_loop_2(65536); _delay_loop_2(65536); //_delay_loop_2(65536);

//_delay_loop_2(65536);

//PORTC&=~(1<<PC1); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //} //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //_delay_loop_2(65536); //UDR = 49; ; } }

void USART_Init_Interrupts( unsigned int baud_rate ) { UBRRH = (unsigned char)(baud_rate>>8); UBRRL = (unsigned char)baud_rate; UCSRB= (1<<RXEN)|(1<<TXEN)|(1<<RXCIE)|(1<<TXCIE); UCSRC= (3<<UCSZ0); }

void USART_Transmit( unsigned char transmit_data ) { /* Wait for empty transmit buffer */ while ( !( UCSRA & (1<<UDRE))) ; /* Copy 9th bit to TXB8 UCSRB &= ~(1<<TXB8);*/ UDR = transmit_data; }

unsigned char USART_Receive( void )

{ while ( !(UCSRA & (_BV(RXC))) ); return UDR; } ISR(_VECTOR(13)) { r=0; } /* Wait for incoming data */

ISR(_VECTOR(11)) { start(); } /********************* Int ***********************/ ISR(_VECTOR(1)) { PORTB = 0xFF; _delay_loop_2(30); data = PINB;

if(r<1) { UDR = data; }

PORTC=1; _delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255); _delay_loop_2(255); PORTC=0; reti(); }

void start() { R_data = UDR; UDR = R_data; PORTB = R_data; //DDRD=(8<<PD3);

//PORTD=~(1<<PD3); //_delay_loop_2(1000); //PORTD=(1<<PD2); PORTC=(3<<PC2); _delay_loop_2(1000); r=1;; //DDRD=(4<<PD3); //PORTD=(1<<PD0); //_delay_loop_2(1000); PORTC=~(4<<PC1); //_delay_loop_2(65535); DDRB = 0x00; PORTB=0X00;

//PORTD=~(2<<PD0); PORTC=(3<<PC0); _delay_loop_2(30000); PORTC=~(3<<PC0); //PORTD=~(1<<PD0); }

Transceiver (Transmit &Receive) Flow Chart

Code

APPENDIX B SCHEMATIC

LINEAR REGULATED POWER SUPPLY

SWITCH MODE POWER SUPPLY

MAX 232 CONNECTIONS

SERIAL COMMUNICATION DEVICE

ENCRYPTION & DECRYPTION DEVICE

TRANSCEIVER

APPENDIX C DATASHEETS

MICROCONTROLLER (AT89C51)

MICROCONTROLLER (ATMEGA8 AVR)

MICROCONTROLLER (AT89C2051)

MAX 232

ULTRASONIC TRANSDUCER

LM7805 (VOLTAGE REGULATOR)

LM2576 (SWITCH REGULATOR)

You might also like