GSM BASED REMOTE MONITORING A thesis submitted to the Department of Electrical Engineering, University of Moratuwa in partial fulfilment of the requirements for the. Degree of Master of Engineering by JAYAWEERA KANKANAMGE KANTHI Supervised By: Dr. J.P. Karunadasa Department of Electrical Engineering University of Moratuwa, Sri Lanka 2005 84140 Abstract Critical nature of certain processes has made 24 hour daily monitoring and remote signaling an essential requirement despite the practical difficulty in fulfilling it. On the other hand the advancement of technology has opened new ways to communicate between man and machine by generating Human Readable text instead of Indicator bulbs and Audible alarms which are also stationary. Since SMS utilizes the unused component of the GSM voice bandwidth almost every GSM mobile service provider lets subscribers send and receive SMS for a nominal fee. Thus, SMS opens a new media for cost effective communication, across the globe to a fraction of the cost usually incurred in making a Voice call. The aim of this project is to provide Proof of Concept to an effective way to communicate the occurrence of an event to a geographically remote location in a cost effective manner. The functionality is explained by simulating the Input of a Burglar Alarm which causes a Status change of the monitoring system, which in-turn triggers sending of an SMS to a predefined number describing the condition. DECLARATION "I certify that this thesis docs not incorporate, without acknowledge, any material previously submitted for a degree or diploma in any university or higher educational institution in Sri Lanka or abroad and to the best of my knowledge and belief it docs not contain any material previously published or written by another person except where due reference is made in the text" . . ~~~1<~.: J K Kanthi Date: I endorse the declaration by the candidate. -~~-~~ ···· ············ Dr. 1 P Karunadasa ~ ,_ -~ <" l _,. .,..... ,_- , .... / / Declaration Abstract Acknowledgement List of Figures List ofTables Glossary Chapters I. Introduction 1.1 Background 1.2 Motivations 1.3 Goals 1.4 Achievement in brief 2. Problem Statement 2.1 Preliminaries 2.2 Problem Identification 3. Proposed Solution CONTENTS 3.1 SMS based remote indication 3.2 Methodology 4. Theoretical Developments 4.1 GSM Technology 4.1.1 History of GSM (Global Standardization) 4.1.2 Services provided by GSM 4.1.3 Architecture of GSM 4.1.4 SMS 4.1.5 Character Encoding Scheme I PDU ,. ' ... l IV v VI VII Vlll I I 2 3 4 4 5 6 6 7 9 9 9 10 10 12 12 4.2 System selection 13 4.2.1 Selection of a Mobile Phone Unit 13 .... 4.2.2 Selection of a Micro Controller 15 4.2.3 Interconnection between the mobile phone and the Circ~it · 19 5. The Components of the Design 5.1 Processing Unit 5.2 The Base Board I Prototyping Board 5.3 Mobile Phone 5.4 Level Converter and the Connecting Cable 5.5 Powering the Circuit :,..._ , 20 ~,, 20 23 24 / 24 25 II 6. The Design 6.1 Designing a Feasible system 6.2 The AT Command set 7. Implementation 7.1 The Bill Of Materials (BOM) 7.2 Application Code Development & Programming 7.3 Source Code of the application. 8. Conclusion & Further Developments 8.1 Conclusion 8.2 Further Developments. References Appendix A ~ ' ... ' t ·" 4- . .. I' ~ .;All. , _- / 26 26 26 28 28 29 32 65 65 68 70 71 Ill ACKNOWLEDGEMENT This report is a result of my Master of Engineering thesis which fulfils the Project Work of the Second Year program at the Department of Electrical Engineering, University of Moratuwa Sri Lanka. The complete project consists of a Theoretical Part and a Practical implementation of the proposed system which describes the applicability of the solution in a simulated environment. I am highly grateful to Dr. J.P. Karunadasa Supervisor, for the invaluable guidance, assistance and encouragement given to me throughout the eour~ and specially during the initial stages of identifying the problem domain, and in the design & development stages thereafter. Also I appreciate the contribution of Prof. J. R. Lucas, Prof. Ranjith Perera, Head of the Department of Electrical Engineering, and Dr Lanka Udawatta, Course Coordinator of the Master of Engineering Programme in Electrical Engineering. This project wouldn't have been completed without the help and support of Mr. Manjulal Waas and Mr. Dinesh Lanka Bulathsinghala who provided Expert Help in programming the Micro Controllers and debugging the application pro!,'Tarn. Last but not least the ETS I (European Telecommunication Standards Institute) and the official Sony Ericsson ~ Developer Forum deserve a big thank you for providin{ me the necessary documentation free of charge. _,> ~ ... - :,.. "~ , / v LIST OF FIGURES Figure I. 2. 3. 4. 5. 6. 7. 8. 9. 10. II. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. Moeller, Remote Communication Module Use of Mimic Panels to locate the fault Basic Topology of the proposed system Layout of a Generic GSM Network Ericsson Tl Os Mobile Phone Ericsson Tl 0 Mobile Phone PCB exposed ATMEL AVR Micro Controller family Generic A VR Functional Block Diagram A Universal Programmer A TMEL A VR Butterfly IAR Systems Embedded Work Bench (Screen Shot) Ericsson T lOs Data Cable Working set up Pin description of the ATmega 169 Micro Controller l Page 2 6 7 II 13 13 15 16 17 18 18 19 20 22 The Front side of the Butterfly Board showing the UART connector 23 The Bottom side of the A VR Butterfly Showing the Battery & Flash chip 23 Program Flow Chart 29 IAR Systems Embedded work bench for A VR 30 AVR Studio Version 4 Startup screen 31 A VR Studio Flash Programming Screen 32 Basic parallel port programmer 66 Burning the micro controller 6 7 Mobile phone connected to external power supply 69 ~ ' ... ... ~ ~ --~ A•- I' / VI LIST OF TABLES Table 1 Comparison of Mobi le phones 2 Bill of materials l ,. ' ... .... ,...,. ~"-"" ~-.. , / Page 14 28 VII IliA / IL S3:JION3ddV .!10 .LSI1 GLOSSARY · API • AuC • Bps • BSC • BTS • CMOS • EEPROM • EIR • ETSI • GSM • Gl.Jl • HLR • IMEI •!MEl • ISDN • Kbps • ME • ME • MMS • MS • MSC •POTS • PC • PDU • PLC • PST~ • RISC • RTC • Rx • SRAM • SIM • SMS • TTL • Tx • !lc • UART • USART • VLR -Applications Programming interface - Authentication Centre - Bits per second - Base Station Controller - Base Transceiver Station - Complementary Metal Oxide Semi Conductor - Electrically Erasable Read Only Memory -Equipment Identity Register - European Technical Standards Institute established by the European Commission. -Global System for Mobile Communications - Graphical User Interface - Home Location Register -International Mobile Equipment Identity - International Mobile Equipment Identity l - Integrated Services Digital Network - Kilo bits per second - Mobile Equipment - Million Instructions per second - Multimedia Messaging Service - Mobile Station - Mobile services Switching Center - Plain Old Telephone System - Personal Computer -Protocol Description Unit - Programmable Logic Controller -Public Switched Telephone Network - Reduced Instruction Set Computers - Real Time Clock -Receiver - Static Random Access Memory - Subscriber Identity Module - Short Message Service ~ ' ~ .... - Transistor-Transistor Logic - Transmitter - Micro Controller -Universal Asynchronous Receiver Transmitter ~ - Universal Synchronous Asynchronous Receiver T ransmitter - Visitor Location Register ~ ~ "- i• ... , / IX