Automatic Qiblat Direction Using PDA GPS.

AUTOMATIC QIBLAT DIRECTION USING PDA GPS

NOOR BADAIUAH BINTI ASAN

This report is submitted in partial fulfillment of the requirements for the award of Bachelor of
Electronic Engineering (Telecommunication Electronics) With Honours

Faculty of Electronics and Computer Engineering
Universiti Teknikal Malaysia Melaka

May 2008

UNZVERSITI TEKNIKAL MALAYSIA MELAKA
FAKULTI KEJURUTERAAN ELEKTROMK DAN WJURUTERAAN KOMPUTER
BORANG PENGESARAN STATUS LAPORAN

PROJEK SARJANA MUDA II

:

---- ----- - ----- -.-- - -- - - - - - - - - ---Am-QmncQ!BUTD-WmON-USm-GW-A-G-B

.-

:

.20055!2008.....

8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

Saya .- -NW-RBADAMH -B-m
A$ANAN

AN AN AN AN

AN

AN AN AN

AN AN AN AN AN

..--------.--------


8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN

AN

AN AN AN AN AN AN AN AN AN AN

AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN

AN

AN

AN AN AN AN AN AN AN AN AN AN AN AN AN AN AN

-.

(HURUF BESAR)


mengaku membenarkan Laporan Projek Sarjana Muda ini diiimpan di Perpustakaan dengan symt-syarat kegunaan seperti
1.

Laporan adalah halanilik Universiti Teknilcal Malaysia Melaka.

2.

Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja

3.

Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaranimtara institusi pengajim tinggi.

4.

Sila tandakan (

4 ):


(Mengandungimakcurnat tehd yang telah ditemukan oleh
organisasi/badan di mana penyelidikan dijalankan)

at TetaP: 214, ...................................

J ! l L w - ~ m - ~ E~D-m-GmA
M

~3rn-DWGrn,------ - - - - - - ---- -- .EW-W-N:--- - - -- - - - - - -- ----- - -

m i & - 2 ~ ~ 1 ----------------2~.

Tarikh: -2ME!-2-9(,8-------

8 8 8 8 8 8 8 8 8

C

*CATATAN : Jika laporan ini SULIT atau 'IERERD, sila lampirkan swat daripada pihak berkdorganisasi berkenaan
dengan menyatakan sekali tempoh laporan ini perlu dikelaskan sebagai SULIT atau TERHAD.


I

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

references."

Signature
Author
Date

: NOOR BADARIAH B~~ ASAN

"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 Honous."

Signature
Supervisor's Name


: ---------------.---.-----------------------------------MISS NURMALA IRDAWATY BINTI HASSAN

Date

: ------.--------..--------------.-----------------.-------2& MAY 2008

Special dedication to my loving parents, Hj. Asan bin Abdullah and Hjh. Minah binti
Sidek, for giving me birth in the first place, for unconditional support and
encouragement to pursue my interests, even when the interests went beyond
boundaries of language, field and geography. My best thoughts are extended to
my parents, who taught me that education is the rest duty of both parents and
children. Also to my siblings, my kind hearted supervisors Mr. Azmi bin Awang
Md Isa and Miss Nurmala Irdawaty binti Hassan, all lecturers in Faculty of
Electronics and Computer Engineering (FKEKK) and also to my dearest fiiend,
Faridah Azura binti Yahaya.

ACKNOWLEDGEMENT

Alhamdulillah, all Praise to thank to Allah SWT the Almighty for giving me
the Rahmah to finish my Project Sarjana Muda successfully.

I would like to express my deep and sincere gratitude to all those who gave
me the possibility to complete this PSM. I am deeply indebted to my main supervisor

Mr Azmi bin Awang Md. Isa whose help, stimulating suggestions and
encouragement helped me in all the time of research for and writing of this thesis.
My sincere gratitude and many thanks goes to him for his endless support and ideas,
during which he has been patiently supervising my progress and encouraged me to
do this project the right way.
My sincere thanks are due to my second supervisor, Miss Nurmala Irdawaty
binti Hassan for her excellent advice and helped me not to get lost during the
development of this thesis. I also would like to express my deep gratitude to her
whose really supports me during the preparation of this thesis. Other than my
advisors, I would also like to thank the rest of my thesis committee, Faridah Azura
for her friendship and encouragement, who gave insightful comments and reviewed
my work on a very short notice.
Last, but definitely not least, I want to thank my beloved parents, Hj. Asan
bin Abdullah and Hjh. Minah binti Sidek for unconditional support and
encouragement to pursue my interests. Lastly, to everybody that has been involved in
my project directly and indirectly. I pray to Allah SWT may He bless all of you.


vii

ABSTRACT

The Qur'an states that Muslims must Solat (Muslim prayer) in the direction of
Mecca at certain times of the day. However, most Muslims have dificulty to perform
their duty when they are in traveling because there is no such equipment available to
determine the direction of Qiblat. Because of that, this project was developed for
Muslims to determine the cment Qiblat direction automatically by using Personal
Digital Assistant (PDA) or Pocket PC with Global Positioning system (GPS)
capability. This project can determine the current Qiblat direction automatically for

users, who are on moving vehicles (Mobile) such as airplane, ship, train etc or who
are in building (Static). For mobile condition, the Qiblat direction can be obtained by
pointing the PDA in fiont of the user or mobile vehicle direction and the arrow of the
compass will be pointing to the Qiblat automatically. For static condition, the Qiblat
direction can be obtained by pointing the device (PDA) at any direction. The
Graphical User Interface (GUI) based software has been developed using Microsoft
Visual Basic.NET. The GPS receiver provides information of users' current location
and the information will be synchronized with the developed s o h e in order for

the whole system to be operated correctly. This project is divided into 6 application
which is contains Prayer Times, Local Time, Location Info, Qiblat Direction,
Directional Finder and Calendar. This project focuses to improve the development of
Qiblat Direction, Directional Finder, and Calendar application. The other three

applications can be referred to '"Mobile Prayer Times for PDA Application" thesis by

Faridah Azura binti Yahaya. It is highly hoped that this system could facilitate
Muslims to perform their daily duty in a proper manner.

viii

ABSTRAK

Al-Quran menyatakan bahawa setiap Muslim wajib menunaikan Solat
(Sembahyang Muslim) menghadap ke arah Mekah pada waktu-waktu yang tertentu
setiap hari. Walau bagaimanapun, kebanyakan Muslim menghadapi masalah untuk
menumikan kewajipan mereka ketika perjdanan jauh kerana tiada peralatan untuk
menentukan arah Kiblat. Oleh kerana itu, projek ini telah di bangunkan untuk
Muslim mengetahui arah Kiblat semasa secara autornatik dengan menggunakan

pembantu digital persendirian (PDA) atau PC Poket dengan kebolehan Sistem
penentuan global (GPS). Projek ini boleh menentukan arah Kiblat secara automatik
untuk pengguna yang berada di dalam kenderaan bergerak (Mobil) seperti di dalam
kapal terbang, kapal, kereta api dan sebagainya mahupun yang berada di dalarn
bangunan (Statik). Bagi keadaan bergerak, arah kiblat dapat diperolehi dengan
menghalakan PDA di hadapan pengguna atau pada arah kenderaan yang bergerak
dan anak panah kompas tersebut akan menunjukkan arah Kiblat secara automatik.
Bagi keadaan statik, arah kiblat dapat diperolehi dengan menghalakan alat (PDA)
pada sebarang arah. Perisian Pengguna grafik antara muka (GUI) dibangunkan
menggunakan Microsoft Visual Basic.NET. Penerirna GPS akan memberikan
informasi kedudukan semasa pengguna clan informasi tersebut akan diseragamkan
dengan perisian yang dibina untuk membolehkan sistem tersebut beroperasi dengan
baik. Projek ini terbahagi kepada 6 aplikasi di mana mengandungi Waktu Solat,

Waktu Tempatan, Maklumat Lokasi, Arah Kiblat, Pencari Arah, dan Kalendar.
Projek ini fokus untuk meningkatkan pembangunan aplikasi Arah Kiblat, Pencari
Arah, dan Kalendar. Tiga aplikasi yang lain boleh merujuk kepada tesis "Mobile

Prayer Times for PDA Application" daripada Faridah Azura binti Yahaya. Adalah
diharapkan sistem ini dapat memberikan peluang kepada pengguna Muslim untuk

menunaikan tanggungjawab mereka menunaikan Solat dengan lebih sempurna.

CONTENTS

CHAPTER

I

n

TITLE

PAGE

PROJECT TlTLE

i

STATUS REPORT FORM

ii

STUDENT DECLARATION

iii

SUPERVISOR DECLARATION

iv

DEDICATION

v

ACKNOWLEDGEMENT

vi

ABSTRACT

vii

ABSTRAK

viii

CONTENTS

b

LIST OF TABLES

xiii

LIST OF FIGURES

xiv

LIST OF ABREVIATIONS

xviii

LIST OF APPENDICES

xix

INTRODUCTION
1.1

Project Background

1.2

Project Objectives

1.3

Problem Statements

1.4

Scopes of Project

1.5

System Operations

1.6

Organisation of Thesis

LITERATUREREVIEW

Falaq (Astronomy) Knowledge's
Traditional Equipments
Falaq (Astronomy) Equipents

2.3.1 Theodolite
2.3.2

Compass with Telescope (Ushikata)

2.3.3

GPS (GARMIN GPSmap 76CSx)

Traditional Method to Determine Qiblat Direction
2.4.1 Istiwa
2.4.2

Constellation Method

Spherical Trigonometry
2.5.1. TheEarth'sShape
2.5.2. Great Circles, Antipodes
2.5.3. Parallels and Meridians (Lines of Latitude
and Longitude)
2.5.4. Cardinal Directions, Latitudes, and
Longitudes
2.5.5. Basic Spherical Trigonometric Fonnula
Personal Digital Assistant (PDA)
PDA with Built-In GPS: 5466-1-ETEN x500
(Glofiish)
Advantages of PDA with Built-In GPS
Disadvantages of PDA with Built-In GPS
Wintec WBT- 100 Multi-Function (4-In- 1) GPS
Receiver

111

PROJECT METHODOLOGY
3.1

Overview

3.2

Definition of Qiblat

3.3

Determining Qiblat Direction

3.4

Concept of Qiblat Pole

3.5

The Global Positioning System (GPS)

N

3.6

NMEA - National Marine Electronics Association

33

3.7

How GPS Data String Reads

34

3-8

Workflow Description

35

3.8.1 System Design

36

SOFTWARE DEVELOPMENT
4.1

Introduction of Microsoft Visual Studio 2005

4.1.1 Overview Visual Studio 2005
4.1.2 Objectives Using Visual Studio 2005
4.1.3 Creating a Pocket PC 2003 Smart Device
Application

4.2

GPS Setup

4.3

Program Development Cycle

4.3.1. Performing a Task on the Computer
4.3.2. Program Planning
4.4

V

Automatic Qiblat Direction

PROJECT FINDING AND ANALYSIS
5.1

Last Results

50

5.2

Achievement for PSM Project

52

5.3

Results on Software

54

5.4

Application Using PDA with Built-In GPS

70

5.5

Analysis

72

5.5.1. Consistency of Global Positioning Systems
(GPS)

DISCUSSIONS AND CONCLUSIONS

75

xii
6.1

Discussions

6.2

Explanation on Analysis
6.2.1. Qiblat Direction
6.2.2, Calendar Converter

6.3

Consistency of the GPS

6.4

GPSSignalErrors
6.4.1. GPS Signal inside the Building
6.4.2. GPS Signal inside the Moving Vehicles

6.5

Improvement and Suggestions

6.6

Conclusions

REFERENCES

APPENDIX A
APPENDIX B
APPENDIX C
APPENDIX D
APPENDIX E
APPENDIX F

xiii

LIST OF TABLES

NO

TITLE

2.1

Estimation of the Difference Angle between the Qiblat and

PAGE
16

Sunset Direction for Malaysia
5.1

Results of GPS Measurement in a Wide Open Area

76

5.2

Results of GPS Measurement inside the Mosque (Without

80

Electronic Compass)
5.3

Results of GPS Measurement inside the Mosque (With

83

Electronic Compass)
6.1

Accuracy Expect from a GPS Receiver

91

xiv

LIST OF FIGURES

TITLE
A Simple Scheme of Sacred Geography in the Published

Text of the Kitab Al-Masalik of Ibn Khurradadhbih (3rd /
9th Century)
Qibla Indicator, Persian, 18'bCentury
Overall Block Diagram of the S o m e Development with
PDA with Built-In GPS
Rubu' Mujayyab
Theodolite

Learn How to Use Theodolite
Compass with Telescope (Ushikata)

GARMIN GPSmap 76CSx
Sun's Direction above the Ka'bah Show the Qiblat
Direction
Orion Constellation
(a) Al-Judah (Bajak / Ursa Minoris) (b) Polaris
Constellation
Finger Guideline for Angle Value
Great Circles, Small Circles, and Antipodes
The Spinning Earth.
(a) Parallels (Lines of Latitude, E-W) (b) Meridians (Lines
of Longitude, N-S)
Latitude and Longitude
Spherical Triangle for Determining the lQiblat

PAGE

The 5466-1-ETEN X500-Glofiish Model
Wintec WBT-100 Multi-Function (4-In-1) GPS Receiver
Direction to Ka'bah
8 Conditions on Determination Qiblat Direction
Concept of Qiblat Pole
The Constellation of NAVSTAR Satellites and Their Orbits
Latitude and Longitude from GPS Data String
Work Flow of System Design
The Microsoft Visual Studio.NET Logo
Overall Flow Chart of Designing in Microsoft Visual
Basic.NET
Create New Project and Solutions by Using the New Project
Window and a Name for the Smart Device Application
Tools Required by Microsoft Visual Basic.NET
Deploy GPSolat Using Windows Mobile 5.0 Pocket PC
Emulator
Program Developing Process
Flow Chart for Digital Qiblat Direction
Qiblat Arrow and Position of Ka'bah
Main Menu of Mobile Prayer Times and Qiblat Direction
Program
Second Menu for GPSolat
The Menu for Qiblat Direction
The Message Box for Qiblat Direction
Magnetic Qiblat Direction Program
Mobile Qiblat Direction Program
Menu for 'Direction Finder'
Mobile Direction Applications for 'Direction Finder' (a)
Previous Menu (b) Latest Menu
Save the Destination and Start the Mobile Direction
Application for 'Direction Finder'
The Direction and the Distance for the Magnetic Direction
Application for 'Direction Finder'

xvi

Remove Destinations

65

Previous Gregorian to Hijri Calendar

66

Calendar, Date Converter Gregorian Date to Hijri Date and

67

Special Event
The Hari Raya Puasa / Aidilfitri Event.

68

(a) Help Menu Application (Emulator) (b) Text for Qiblat

69

Direction
GPSolat Trial Period Has Expired

69

Qiblat Direction on Mobile Condition (a) Blue Arrow

71

Shows the Direction fiom Vehicle Clockwise (b) Red
Arrow Shows the Direction from North Clockwise
Direction Finder on Mobile Condition (The Picture Shows

71

"You are now about 2.2km fiom tarnan tasek utama")
Distance between Kuantan, Malaysia-Mecca

72

GPS Testing Position Float at Pole 1 (Wide Open Area)

77

GPS Testing Position Float at Pole 2 (Wide Open Area)

77

GPS Testing Position Float at Pole 3 (Wide Open Area)

78

GPS Testing Position Float at Pole 1, Pole 2 and Pole 3

79

Referring to Kaabah (Wide Open Area)
GPS Testing Position Float at Pole 1 inside the Mosque

81

(Without Electronic Compass)
GPS Testing Position Float at Pole 2 inside the Mosque

81

(Without Electronic Compass)
GPS Testing Position Float at Pole 1 and Pole 2 Referring

82

to Ka'bah (Qiblat) inside the Mosque (Without Electronic
Compass)
GPS Testing Position Float at Pole 1 inside the Mosque

84

(With Electronic Compass)
GPS Testing Position Float at Pole 2 inside the Mosque

84

(With Electronic Compass)
GPS Testing Position Float at Pole 1 and Pole 2 Referring
to Ka'bah (Qiblat) inside the Mosque (With Electronic
Compass)

85

xvii
6.1

L 1-Signal Re-Radiator Designed for Receiving GPS Signals

94

Indoors
6.2

External GPS Antenna on the Roof and Has a Strong

95

Magnet at the Base for Affixing to a Car Roof

6.3

Special Room for Muslim to Pray

96

xviii

LIST OF ABREVIATIONS

GPRS

General Packet Radio Service

GMT

Greenwich Mean Time

GPS

Global Positioning System

GUI

Graphic User Interface

mu

International Astronomical Union

NMEA

National Marine Electronics Association

PDA

Personal Digital Assistant

Qiblat

Ka 'bah in Makkah Saudi Arabia

RAM

Random-Access Memory

ROM

Read-Only Memory

SA

Selective Availability

Solat

Muslims Prayers

svs

Space Vehicles/ satellites

USB

Universal Serial Bus

UT

Universal Time

WAAS

Wide Area Augmentation System

WLAN

Wireless Local Area Networks

WAN

Wireless Wide-Area Networks

xix

LIST OF APPENDICES

NO

TITLE

A

IEEE Conference Paper, APACE2007, Melaka.

102

B

IEEE Conference Paper, International RF and Microwave

107

PAGE

Conference 2006, Putrajaya, Malaysia
C

Penentuan Arah Kiblat

112

D

Langkah-langkah Penpiraan Qiblat

115

E

Huraian Lokasi Masjid

116

F

An Extract of a Qibla Table ftom Circa A.D. 1360

117

CHAPTER 1

INTRODUCTION

This chapter will discuss about the project background, objectives and scope
of the project, problem statement, system operation and report structure.

1.1

Project Background
The Qur'an states that Muslims must pray in the direction of Mecca at certain

times of the day. For faithful Muslims, it was vital to be able to calculate the
direction of prayer towards Mecca. In the eariy centuries of Islam, Muslim did nat
have tools to determine the Qiblat with precision, Only from third century onwards
mathematical solutions for determining Qiblat were available even then their use was
not widespread.

A common instrument was the "Qibla Indicator", an adaptation of the
compass designed to indicate the direction of Mecca fiom other major cities. These
often incorporated similar features to the sundial. [I]
From 3rdl9th century onwards, Muslim astronomers working in the tradition
of classical astronomy devised methods to compute the Qiblat for any locality from
the available geographical data. For them, the Qiblat was the direction of greater
circle joining the locality to Mecca, measured as an angle to the local meridian. The

determination of Qiblat according to this definition is a non-trivial problem of
mathematical geography, whose solution involves the application of complicated
trigonometric formula or geometrical considerations.

EGYPT

w

Ka'bah

Figure 1.1 : A Simple Scheme of Sacred Geography in the Published Text of the
Kitab Al-Masalik of Ibn Khurradadhbih (3rd / 9th Century) [2]
However, mathematical methods were not available to the Muslims before
the late 2nd / 8th and early 3rd / 9th centuries, the Qiblat was not generally found by
computation anyway even after the mathematical solutions were available. This is
very well illustrated in the diagram below for Qiblat in the cities of Cordova, Cairo
and Samarqand. [3]
All the material above shows that the early Solat accepted some flexibility in
the determination of the Qiblat and that it was not determined with a compass
precision as the early Muslims did not have the tools to find that precision. In the
Shafie School, facing the direction of prayer is a necessary condition.
Figure 1.2 shows a "Qibla Indicator" which is used for finding the direction
of Mecca. The ornamental plate over the compass is engraved with the names of the
four cardinal points and with a scale of degrees. On the bottom of the compass-box
are engraved lines indicating the direction of the South point of the compass and
various places including Medina. [I]

Figure 1.2: Qibla Indicator, Persian, 18h Century
The importance of the prayer in Islam cannot be understated. It is the first
pillar of Islam that the Prophet (peace be upon him) mentioned after mentioning the
testimony of faith, by which one becomes a Muslim. It was made obligatory upon all
the prophets and for all peoples. Allah has declared its obligatory status under
majestic circumstances.
However, most Muslims have difficulty to perform their duty when they are
in traveling because there is no such equipment available to determine the direction
of Qiblat. For an instance, Muslims traveling abroad on airplanes are still required to
perform prayers, even though they may encounter difficulties to do so due to high
velocity of the airplane and its orientation. Furthermore, Muslims need to identifjr
their current location in order to know Qiblat direction. It is extremely difficult to
determine the direction of Qiblat due traveling.
This project is divided into two major part; hardware and software. For
hardware part, the Personal Digital Assistant (PDA) with built-in Global Positioning
System (GPS) is used with the software developed using Microsoft Visual
Basic.NET. PDA with built-in GPS will give the information of the latitude and
longitude. Then, the program that have done develop using Microsoft Visual
Basic.NET will synchronize with the information of PDA with built-in GPS. This
project need to study on how to develop GUI-based software, which can determine
the current Qiblat direction with additional features that can be incorporated into
portable devices such as Personal Digital Assistant (PDA) or Smartphones with
Global Positioning System (GPS) capabilities.

1.2

Project Objectives
The final project is named as GPSolat, which is a combination of Global

Positioning System (GPS) and Solat (Muslim Prayers). This GPSolat is divided into
2 main parts which is Automatic Qiblat Direction Using PDA GPS and Mobile

Prayer Times for PDA Application. This thesis covered the Qiblat Direction Using
PDA GPS application and carried out on the following objectives:
a)

To improve and design an innovative system for Muslims to determine the
current Qiblat direction in real time automatically by using Personal Digital
Assistant (PDA) or Pocket PC with Global Positioning system (GPS)
capability.

b)

To develop multi-function application such as directional finder, calendar,
converter Gregorian to Hijri vice versa, and etc.

c)

To develop the GW-based software to make it user-friendly device.

d)

To study how GPS works and the functionality of PDA with built-in GPS.

e)

To commercialize the project with protection '30 Days trial license key' and
Help Menu.

1.3

Problem Statements
The importance of the prayer in Islam cannot be understated. It is the fkst

pillar of Islam that the Prophet (peace be upon him) mentioned after mentioning the
testimony of faith, by which one becomes a Muslim. Performance of Solat five times
a day is mandatory to all Muslims. During performance of Solat, Muslims must turn
their face towards the Ka 'bah. It was made obligatory upon all the prophets and for
all peoples. Allah has declared its obligatory status under majestic circumstances.

(0Prophet!), We see your face turning to the heaven (For guidance). Now shall
please you turn then your face in the direction of The Sacred Mosque; Whereveryou
are, turn your faces in that direction. Thepeople of the book know we21 that this is
the truthcfiorn their Lord And Allah is not unmindfirl of what they do.
(Sura AI-Baqara, Jm 1: 144) [4]

Recently we are facing some confbsion regarding the methods of finding out
the direction of the Ka'bah. As far as my knowledge goes, this is the first time such
confusion has appeared since the inception of Solat more than fourteen hundred
years ago. Moreover, this confusion is apparently confined to North America. I
strongly feel that a thorough discussion and deliberation in a congenial environment
is needed to remove the confusion once and for dl.
The main problem in Islamic astronomy is the accuracy of Qiblat (the
position of facing the 'Ka 'bah' during prayers), There were no accurate methods in
finding the Qiblat. Muslim astronomers and geographers starting from the 8th
century took up for best methods of Qiblat direction using the techniques of
measurement of geographical coordinated and trigonometry that they have acquhd
fiom the Greeks.
However, most Muslims have dificulty to perform their duty when they are
in traveling because there is no such equipment available to determine the direction

of Qiblat. For an instance, Muslims traveling abroad on airplanes are still required to
perform prayers, even though they may encounter difficulties to do so due to high
velocity of the airplane and its orientation. Furthermore, Muslims need to identify
their current location in order to know Qiblat direction. It is extremely difficult to
determine the direction of Qiblat due traveling.
The previous project has their disadvantages and this project will update and
recover their disadvantages. The main disadvantage is the previous of this project is
the Qiblat direction is only can be used on moving condition (Mobile) such as inside
moving vehicles, but not on static condition. When we in the static condition, we
cannot know the Qiblat direction.