24
i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD SAIFULAZWAN BIN CHE KU ALI This report is submitted in partial fulfillment of the requirement of the award of Bachelor of Electronic Engineering (Telecommunication Electronics) with Honours Faculty of Electronics and Computer Engineering Universiti Teknikal Malaysia Melaka April 2009

i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

Embed Size (px)

Citation preview

Page 1: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

i

MORSE CODE TRANSLATOR USING PIC

CHE KU MOHD SAIFULAZWAN BIN CHE KU ALI

This report is submitted in partial fulfillment of the requirement of the award of

Bachelor of Electronic Engineering (Telecommunication Electronics) with Honours

Faculty of Electronics and Computer Engineering

Universiti Teknikal Malaysia Melaka

April 2009

Page 2: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

ii

UNIVERSTI TEKNIKAL MALAYSIA MELAKA

FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN

KOMPUTER

BORANG PENGESAHAN STATUS LAPORAN

PROJEK SARJANA MUDA II

Tajuk Projek : MORSE CODE TRANSLATOR USING PIC

Sesi

Pengajian : 2008/2009

Saya CHE KU MOHD SAIFULAZWAN BIN CHE KU ALI

mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat

kegunaan seperti berikut:

1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.

2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.

3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi

pengajian tinggi.

4. Sila tandakan ( √ ) :

SULIT* (Mengandungi maklumat yang berdarjah keselamatan

atau kepentingan Malaysia seperti yang termaktub di

dalam AKTA RAHSIA RASMI 1972)

TERHAD* (Mengandungi maklumat terhad yang telah ditentukan

oleh organisasi/badan di mana penyelidikan dijalankan)

TIDAK

TERHAD

Disahkan oleh:

__________________________ ___________________________________

(TANDATANGAN PENULIS) (COP DAN TANDATANGAN PENYELIA)

Alamat Tetap: 79 Kg. Chepoh,

K. Telemong, 21210, K. Terengganu

Tarikh: ……………………….. Tarikh: ………………………..

Page 3: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

iii

“I hereby declare that this report is the result of my own work except for quotes as cited

in the references.”

Signature :……………………………………………………………..

Author : CHE KU MOHD SAIFULAZWAN BIN CHE KU ALI

Date : 30 April 2009

Page 4: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

iv

“I hereby declare that I have read this report and in my opinion this report is sufficient in

terms of the scope and quality for the award of Bachelor of Electronic Engineering

(Telecommunication Electronics) With Honours.”

Signature :………………………………………

Supervisor‟s Name : AZAHARI BIN SALLEH

Date : 30 April 2009

Page 5: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

v

ACKNOWLEDGEMENT

Alhamdulillah, thank god for his blessing and for my parents and my family that

supported me. I would like to express my gratitude to Mr. Azahari Bin Salleh for being a

helpful supervisor. Also to my friends, lecturers and those who have been so supportive

upon the completion of this project, thank you very much.

Page 6: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

vi

ABSTRACT

During the first half of 20th century, Morse Code communication using telegraph

line serves as dominant communication system in the world. It has been adapted to be

used in radio transmission later. However, with the advent of telephones and internet,

this communication mode dropped to second place of choice due to difficulties to

operate and low data rate. Because of the true reliability of Morse Code communication

(using On-Off keying), it has been used for backup communication and also serves when

other modes fail. Realizing the need of this communication mode is still exist, this

project made to build a Morse Code translator system using PIC. PIC will be

implemented in this project to make a simple, easy to use and mobile system that can

translate Morse Code into text. The system is aimed to help a Morse Code operator to

translate Morse Code sound in real time application and without error.

Page 7: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

vii

ABSTRAK

Komunikasi menggunakan Morse kod melalui sistem telegraf digunakan dengan

meluas semasa kurun ke-20. Kemudian, penggunaan radio diaplikasikan dalam

penghantaran Morse kod. Bagaimanapun, dengan penciptaan telefon dan Internet,

komunikasi dengan cara ini tidak lagi digunakan kerana sukar untuk digunakan dan

kadar data yang rendah. Dengan menggunakan teknik “On-Off Keying”, Morse Kod

sesuai digunakan sebagai sistem komunikasi sokongan. Menyedari kepentingan ini,

projek ini dijalankan untuk menghasilkan pentafsir Morse kod menggunakan PIC. PIC

digunakan untuk memudahkan penggunaan, mudah alih dan juga mampu menafsirkan

Morse kod ke dalam tulisan abjad. Sistem ini diharapkan dapat membantu pengguna

mentafsir Morse kod dengan segera tanpa sebarang kesilapan.

Page 8: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

viii

TABLE OF CONTENTS

CHAPTER SUBJECT PAGES

TITLE i

REPORT APPROVAL FORM ii

ADMITTANCE iii

DEDICATION iv

ACKNOWLEDGEMENT v

ABSTRACT vi

TABLE OF CONTENTS viii

LIST OF FIGURES xii

LIST OF TABLES xv

LIST OF ABBREVIATIONS xvi

LIST OF APPENDIX xviii

Ι INTRODUCTION 1

1.1 Project Background 1

Page 9: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

ix

1.2 Problem Statement 2

1.3 Project Objectives 3

1.4 Scope of works 3

1.5 Thesis Outline 3

II THE MORSE CODE & PIC MICROCONTROLLER 4

2.1 Introduction 4

2.2 On-Off Keying 6

2.3 Morse Code Designation 7

2.4 International Morse Code Characters 8

2.5 Code Weighting 10

2.6 Code "Speed" 11

2.7 The "Farnsworth" Method 12

2.8 PIC 12

2.9 Microcontrollers versus Microprocessors 15

2.10 PIC components 15

2.11 Programming Software 26

Page 10: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

x

III METHODOLOGY 32

3.1 Introduction 32

3.2 Projects‟ Methodology 32

3.3 Circuit Design 35

3.4 Code Writing 36

3.4.1 Learn 37

3.4.2 Listen and decode 38

3.5 Troubleshooting 40

3.6 PIC Programming 40

3.7 Simulation 40

3.8 PCB Design 41

3.9 PCB Fabrication 44

3.10 Assembling & Soldering 44

3.11 Finishing 45

3.12 Testing 46

3.13 Preparing the Project Report 46

Page 11: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xi

IV RESULTS AND DISCUSSION 47

4.1 Introduction 47

4.2 Circuit Diagram 47

4.3 Bill of Materials 49

4.4 Parts of the Circuit 50

4.5 Components 53

4.6 Operation (Signal Flow) 59

V CONCLUSION 63

5.1 Conclusion 63

5.2 Suggestions and Recommendations 64

REFERENCES 65

APPENDICES 66

Page 12: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xii

LIST OF FIGURES

FIGURE PAGE

Figure 2.1 First wired telegraph 5

Figure 2.2 SOS Message 5

Figure 2.3 Carrier waveform 6

Figure 2.4 Digital form 6

Figure 2.5 International Morse Code 8

Figure 2.6 Simplified Model of a Memory Unit 16

Figure 2.7 Simplified CPU with 3 Registers 17

Figure 2.8 Connecting Memory and CPU Using Bus 18

Figure 2.9 Simplified Input-Output Units 19

Figure 2.10 Serial Unit used to Send Data 20

Figure 2.11 Timer Unit 21

Figure 2.12 Watchdog Unit 22

Figure 2.13 ADC Converter 23

Page 13: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xiii

Figure 2.14 Physical Configuration of The Interior of a Microcontroller 23

Figure 2.15 Microcontroller Outline 25

Figure 3.1 Project‟s Flow Chart 34

Figure 3.2 Block Diagram of the System 35

Figure 3.3 Circuit Diagram 36

Figure 3.4 Operation Flow of The Program 37

Figure 3.5 Flow Chart 37

Figure 3.6 Position Multiplier 39

Figure 3.7 Flow Chart for Listen and Decode Parts 39

Figure 3.8 Circuit Diagram 41

Figure 3.9 Proteus ARES Drawing 42

Figure 3.10 Output Layout 42

Figure 3.11 Final PCB Layout 43

Figure 3.12 Printed PCB layout 43

Figure 3.13 Picture of The Finished PCB (Soldered) 45

Figure 3.14 Picture of The Finished Product 46

Figure 4.1 The Circuit Diagram 48

Figure 4.2 Bill of Materials 49

Figure 4.3 Parts of The Circuit 50

Figure 4.4 Diagram of Power Supply Section 51

Figure 4.5 Diagram of Amplifier Section 52

Page 14: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xiv

Figure 4.6 Diagram of Discriminator Section 53

Figure 4.7 Figure of LM7805 54

Figure 4.8 Diagram of LF353 55

Figure 4.9 LM567 Internal Circuits 55

Figure 4.10 A Picture of LMB162ABC 57

Figure 4.11 PCB 58

Figure 4.12 Signal Flow Diagram 59

Figure 4.13 State Flow Diagram 61

Figure 4.14 Initial State of The Program 61

Figure 4.15 Code Speed Display 62

Figure 4.16 The Displayed Texts 62

Page 15: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xv

LIST OF TABLES

TABLE PAGE

2.1 Special Characters 10

2.2 Additional Morse Code Characters 11

Page 16: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xvi

LIST OF ABBREVIATION

PIC - Programmable Interface Controller

ADC - Analog To Digital Converter

MCU - Microcontroller Unit

AC - Alternating Current

DC - Direct Current

US - United States

ITU - International Telecommunication Union

ARRL - American Relay Radio League

SOS - Save Our Souls

PC - Personal Computer

OOK - On-Off Keying

CPU - Central Processor Unit

I/O - Input / Output

VCO - Voltage Controlled Oscillator

Page 17: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xvii

LCD - Liquid Crystal Display

PCB - Printed Circuit Board

IC - Integrated Circuit

LED - Light Emitting Diode

TV - Television

Page 18: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

xviii

LIST OF APPENDIX

NO TITLE PAGE

A Programming codes 66

Page 19: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

1

CHAPTER 1

INTRODUCTION

1.1 Project Background

The telecommunication technology nowadays is growing very fast. New

invention of transmission systems has been developed to cater for high-speed data

communication. However, for some countries, many nature disasters have taken place

frequently. This lead to destruction of many telecommunication properties where it does

disabled the new telecommunication systems. The telecommunication systems that we

use nowadays are very dependant of installation like trunk cables, transmission line

pylons and transmitter towers. This has make the system broke down and no service is

available when massive disaster strikes.

A disaster is hard to be predicted and be prepared for. As for backup

communication, Morse Code transmission modes using radio waves has been continued

to be used when all other communication is not possible. The key of the reliability of

Morse is its simplicity and dependability. The On-Off keying it implemented has made it

the most reliable mode. However, only a few people understand the sound of short beep

and long beep used in Morse Code. This will be a problem when a Morse Code message

to be received in event of disaster.

Page 20: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

2

The aim of this project is to help people to get the message in the Morse code

signal. The input of the system will be a Morse Code sound (beeps and spaces). The use

of PIC will be implemented in the system to make it small, light and mobile.

1.2 Problem Statement

A Morse Code operator need to listen to the beep of the received signal to get

information from it. They have to distinguish the timing of each beep that will

eventually form a letter or a number from a group of characters. For a competent Morse

Code operator, the sound of dit (short beep) and dah (long beep) can be directly

translated into messages by using their ears. However, it took a lot of practice to master

the receiving skill and memorize all the codes. A long message can be a problem to the

receiving party to translate. A piece of paper and pen may help them to record the

received messages. However, it takes a lot of time and effort to do so and it is not

practical.

Nowadays, the Morse Code is a rarely used and not many person can do the

translation. However, as a backup communication system, somebody has to be able

translate the Morse Code. I came up with this project to help user to discern information

directly from the sound of Morse Code.

An operator must learn how to translate a series of dots and dashes into

messages. Among difficulties faced by Morse Code operator was to remember codes. It

also requires a lot of effort and time to discern information from codes. Furthermore,

data lost may result from mistranslated or untranslated codes as human errors always

happened while translating Morse Code. After a quick study, it has been discovered that

the code translator using computer software has already being used. However, it is bulky

& costly because we need to use computer to use it. It also consumes more power.

Page 21: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

3

1.3 Project Objectives

In this project, the main goal is to develop a system capable of translating Morse

code sound to text. PIC Microcontroller will be used in the system. It will add the value

to this design because it is lightweight, small and use little power. The most suitable

technique to translate Morse Code will be investigated and implemented in the system.

1.4 Scope of works

The scope of works for this project including:

i. Undergoing further study and understanding the communication using

Morse Code.

ii. Studying and experimenting the technique to translate Morse Code.

iii. Designing the system using PIC using suitable methods.

1.5 Thesis Outline

In this part, the summary or overview for each chapter is discussed. The

introduction of this project is outlined in Chapter I where it contains problem statement,

objectives of the project and project scope methodology. Literature research and review

is discussed in Chapter II such as basics of Morse code and PIC Microcontroller .

Chapter III discuss the methodology and process involved in the project. The flowchart

showing the flow of this project is outlined here to show step by step plan to achieve the

goal of this project. Result and discussion of the project is covered in chapter IV. All the

findings and result analysis is discussed in this chapter. Finally, in chapter V the

conclusion for the project is made and few enhancements is suggested for further

improvements the system itself.

Page 22: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

4

CHAPTER 2

THE MORSE CODE & PIC MICROCONTROLLER

2.1 Introduction

In this chapter, various aspects related to the study of the proposed project will

be discussed. Past projects and thesis which were related to the proposed project would

be referred. Besides that, this chapter will show the actual concept of Morse Code

communication and the various related aspect. The study on PIC microcontroller also

will be included as well.

Morse code was invented by an American, Samuel Morse (179 1-1872). Before

the invention of the telegraph, messages that had to be sent over long distances were

usually carried by messenger. These messages were delivered only using the fastest

available horse could travel.

In 1830, the first long distance telegraphic device was made by Joseph Henry

(1797- 1878) and Samuel Morse invented a telegraph system for sending messages using

electricity. Messages were sent by tapping out a special code for each letter in the form

of long or short signals. We will refer to them as „dots‟ (short signals) and „dashes‟

(long) although they were originally called „dits‟ and „dahs‟. The code was converted

into electrical impulses and sent over telegraph wires.

Page 23: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

5

Figure 2.1 First wired telegraph [6]

In 1844, Morse demonstrated the telegraph to the US Congress using the

message, “What hath God wrought” a quotation from the Bible.

In 1851, an international conference in Berlin established an international version

which is still in use today. We are probably familiar with the SOS that is used as distress

message which is shown below.

Figure 2.2 SOS Message [6]

Page 24: i MORSE CODE TRANSLATOR USING PIC CHE KU MOHD …eprints.utem.edu.my/5841/1/Morse_Code_Translator_Using_Pic_Che_Ku... · kegunaan seperti berikut: ... dalam AKTA RAHSIA RASMI 1972)

6

2.2 On-Off Keying

Morse code is transmitted using a mode called On-Off keying. The on-off means

that the carrier is present at “ON” state while it vanished at “OFF” state. An example for

a transmitted wave for letter “K” is as shown below.

Figure 2.3 Carrier waveform [6]

To decode messages that contained in the wave, the user have to assume the

waveform as digital form.

Figure 2.4 Digital form [6]