You are on page 1of 29

Page |1

CHAPTER 1: PROJECT DEFINITION

1.1 INTRODUCTION A data logger kit is a stand - alone electronic device that can read various types of information in form of electrical signals and store the data in internal memory over a period of time. The data can be from data acquisition devices. These devices measure real world physical conditions and parameters, and convert them into electrical signals that can be read by the computer, such as analog and digital signals. Physical conditions can be measured using sensors. Physical parameters include the temperature of the environment, humidity, voltages, chemical composition and motion. Data loggers are composed of microcontroller, memory, rechargeable battery, and sensors. Data loggers are important because they provide us with factual information that is needed to make good decisions that will maximize operations. They find applications in many areas such as; Transportation industry the data logger access GPS data and hence work as a tracking device of valuable and fragile merchandise and minimize theft [1] Environmental Monitoring Internal environmental monitoring of houses, offices, warehouses or museums External environmental monitoring of oceans, rivers, aquaculture, climate and general research into the natural world. The concentration of chemicals in the water can be recorded over time. Vandalism monitoring of installations such as underground cables.

Disaster management and mitigation

Page |2

Floods and earthquake prone areas can be monitored using sensors and the data sent to a monitoring center and early warning system.

The supply of essentials to affected people can be monitored using GPS data loggers. [2]

A data logger that is interfaced to a GPS module is able to receive and store location coordinates in the form of longitude and latitude. This is raw data and needs to be processed into a more meaningful form such as a map. This project is aimed at interfacing the data logger with GPS. The data logger stores the position coordinates on a Media Card. The GPS coordinates are then transmitted to authorized personnel through a text message via GSM. A computer can be connected to the data logger through a serial cable and data on the memory card is accessed. GPS visualizer software can be used to convert these latitude and longitude numbers to something that digital maps (e.g google maps) can understand. The progress report is outlined as follows. Chapter one gives a general overview of the subject i.e. problem statement, rationale, and objectives. Chapter two is the Methodology. The third Chapter covers literature review on the pic microcontroller and PCB designs. Chapter four explains the GPS and GSM technologies. It further gives a description of the communication methods selected and the overall system integration. Chapter five discusses the interfacing and script language programming of the GPS module. The last chapter gives a conclusion of the works done towards the completion of the project. This is then followed by conclusions and the Appendices. 1.2 Problem Statement Challenges in Water Sensor Monitoring and data capture location identification and data transmission Challenges in Vehicle Asset Tracking

Page |3

Challenges in Disaster Management and Emergency Response e.g Earthquakes, Tsunamis, Floods-Early warning Sys., tracking transportation of supplies to people 1.3 Rationale A data logger that is able to interface GPS and GSM can be used in many industries and a variety of applications such as Early Warning systems and Remote Sensing. In October 2010, Konkola Copper Mines polluted the river again, resulting in another shutdown of water supply [3]. Dennison Uranium mines has been closed after pollution of the Zambezi River in Siavonga. New mines have been established. There are continued risks of harmful effluents being discharged in the rivers that supplier water to sustain livestock, humans supply of fresh water and the farming sector. Such effluents have led to illnesses and also death of aquatic life. Such disasters can be avoided by monitoring the effluents of mining wastes in the rivers and streams. A data logger with GPS and GSM can be used for remote sensing and hence provide early warning to the relevant authorities. These data loggers can be placed in key areas where mines are located. Sensors are used to monitor the levels of toxic substance and the data transmitted to a central location. However, it has been challenging to identify the source of the data. A GPS/GSM data logger can be used to transmit location coordinates that can be used in an effective early warning system. Interfacing GPS and GSM to the data logger will make it possible to locate the source of logged data. Hence, the success in one data logger can be modified to other data loggers. Figure 1.1 below depicts how GPS/GSM data loggers placed in strategic mining areas can be used in Remote Sensing and Early Warning Systems.

Page |4

Figure 1.1: Map showing how Remote Sensing is achieved 1.4 Project Objectives The objectives of the project are outlined below; 1) To interface the data logger kit with Global Position System (GPS) and Global System Mobile (GSM) communication 2) To design a system that will incorporate hardware and software based in the field for data logging and transmission protocols 3) To redesign, assemble and configure a cost effective and efficient PIC Microcontroller based data logger 4) To display data logger output to a computer screen and automatically generate SMS messages to monitoring personnel The overall system architecture is shown in figure 1.2

Page |5

Figure 1.2: System architecture of the Data logger 1.5 SCOPE OF WORK DONE Literature review on the pic 18F27J53 microcontroller, GPS and GSM modules has been done. The EM408 GPS module has been selected for the project. Literature review on Easy Applicable Graphical Layer Editor (EAGLE) has been done. EAGLE software has been used for the preliminary system design of the data logger and explained further in chapters 3 to 5. Familiarisation of programing PIC microcontrollers using micro-IDE in C language, Proteus software for simulation of the preliminary system design has been done. Some of the components to be used in the project have been acquired. These include the pic microcontroller, voltage regulator, resisters, capacitors, and connector blocks. The GPS and GSM modules will be procured when the programming and simulation of the code is complete.The scope of work to be done is shown in the Appendix A, table A.1.

Page |6

CHAPTER 2: METHODOLOGY
A modular approach has been undertaken to ensure that the project is completed in time. The project has been divided into two sections or modules. The electronic part will range from
the GPS receiver to the microcontroller and the telecommunications part which will tackle

modem communication and interface to the mobile phone Global System for Mobile communication (GSM). Literature review has been carried out to get familiarisation of the hardware and software used. 2.1 System Design A System is a set of interrelated components which interact with one another in an organized fashion toward a common purpose. Design is the process of conceiving or inventing the forms, parts, and details of a system to achieve a specified purpose. Design can also be said to be an innovative act whereby the engineer creatively uses knowledge and material content of a system. The objective of systems engineering and design is to see to it that the system is designed, built, and operated so that it accomplishes its purpose in the most cost-effective way possible, considering performance, cost, schedule and risk. [4] This creates a technical solution that satisfies the functional requirements for the system. Therefore, using a systematic design plan, I will be able to come up with a fully operational and cost effective GPS/GSM data logger kit. The system design process has five steps these are; 1) Identify design goals 2) Model the new system design as a set of subsystems 3) System Implementation 4) Testing and debugging 5) Report writting/Documentation

Page |7

2.2 System design Goals The system design goals have been highlighted in the Objectives of the project. In summary the goal is to build a cost effective data logger kit that is interfaced with GPs and GSM technology. 2.3 Subsystems A system composed of interconnected modular subsystems is easier to design, document, debug, and modify. The data logger Preliminary system Block Diagram is shown in figure 3. The subsystems that will be considered are; i) ii) iii) iv) v) Hardware connection of the pic18F27J53 microcontroller. Serial communication interface. Interfacing the GPS module. Interfacing the GSM modem. Interfacing the media card and programming the full system.

Figure 2.1 depicts the interfacing of the GPS and GSM modules to the PIC18F27J53.

Figure 2.1: Subsystem interface

Page |8

2.4 System Implementation System implementation involves putting the planned system into action. This involves combining and organizing the subsystems systematically to form a complete system. The program code for each system is then linked and assembled into one code. The hardware and software developed are put together and installed in the simulation design software. After successful testing and debugging the prototype printed circuit board (PCB) is built. The components are soldered on the PCB board. 2.5 Testing and debugging Testing is done to find deffects in the code and remove errors in the system. A correct hardware (software inclusive) setup of the system does not entail proper functioning of the system, it takes many steps of testing and debugging for the system to work as intended. 2.6 Report writing/Documentation This is the process of providing written details/information about the project work.

Page |9

CHAPTER 3: LITERATURE REVIEW ON THE PIC 18F CONTROLLER ARCHITECTURE

3.1 Key features of the pic microcontroller A Microcontroller is an inexpensive single-chip computer. The microcontroller has the capabilities of storing and running a program. Therefore, a complete system can be built using one MCU chip and interfacing it with a few Input and Output devices such as a keypad, display and other circuits. The PIC18 family utilizes a16-bit program word architecture and nearly all instructions execute in a single cycle making this Reduced Instruction Set Computer (RISC) architecture extremely efficient. RISC architecture has 32 level-deep stacks, 8x8 hardware multiplier, and multiple internal and external interrupts. The PIC18 was selected for this project because programs that run on it can be written in C programming language. [5]

Figure 3.1: MCU Features


Figure 3.2 below shows the 28 pin diagram for the PIC 18F27J53 family and the pin configuration.

P a g e | 10

Figure 3.2: Pin configuration

The PIC18 family has a rich set of integrated communication and connectivity peripherals to reduce application system cost, and many of the PIC18 devices include Nano Watt technology for power management. Like all of Microchips microcontrollers, these products offer socket, software and peripheral compatibility for easy migration and scalability. 3.2 Memory Organization There are two types of memory in PIC18 Flash microcontrollers. These are; Program Memory Data RAM As Harvard architecture devices, the data and program memories use separate busses; this allows for concurrent access of the two memory spaces.

P a g e | 11

3.2.1 Program Memory PIC18 microcontrollers implement a 21-bit program counter, which is capable of addressing a 2-Mbyte program memory space. Accessing a location between the upper boundary of the physically implemented memory and the 2-Mbyte address returns all 0s.The PIC18F47J53 family offers a range of on-chip Flash program memory sizes, from 64 Kbytes (up to 32,768 single-word instructions) to 128 Kbytes (65,536 single-word instructions). 3.2.2 Data Memory The data memory in PIC18 devices is implemented as static RAM. Each register in the data memory has a 12-bit address, allowing up to 4096 bytes of data memory. The memory space is divided into as many as 16 banks that contain 256 bytes each

FIGURE 3.2:PIC18F27J53 MEMORY MAP The PIC18F47J53 family implements all available banks and provides 3.8 Kbytes of data memory available to the user. The Flash program memory is readable, writable and erasable during normal operation over the entire VDD range. A read from program memory is executed on 1 byte at a time. A write to program memory is executed on blocks of 64 bytes at a time or 2 bytes at a time. Program memory is erased in blocks of 1024 bytes at a time. A bulk erase operation may not

P a g e | 12

be issued from user code. Writing or erasing program memory will cease instruction fetches until the operation is complete. The program memory cannot be accessed during the write or erase, therefore, code cannot execute. An internal programming timer terminates program memory writes and erases. 3.3 Communication Features of the Pic18F27J53 2.3.1 Master Synchronous Serial Port (MSSP) Module The Master Synchronous Serial Port (MSSP) module is a serial interface, useful for communicating with other peripheral or microcontroller devices. These peripheral devices include serial EEPROMs, shift registers, display drivers and A/D Converters. [5] 3.3.1. Master SSP (MSSP) Module Overview The MSSP module can operate in one of two modes: Serial Peripheral Interface (SPI) Inter-Integrated Circuit (I2C) - Full Master mode - Slave mode (with general address call) The I2C interface supports the following modes in hardware: Master mode Multi-Master mode Slave mode with 5-bit and 7-bit address The modules operate independently: PIC18F27J53 devices: - MSSP1 can be used for either I2C or SPI communication - MSSP2 can be used only for SPI communication

P a g e | 13

3.3.2 ENHANCED UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (EUSART) The Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) module is one of two serial I/O modules. (Generically, the EUSART is also known as a Serial Communications Interface or SCI.) The EUSART can be configured as a full-duplex asynchronous system that can communicate with peripheral devices, such as CRT terminals and personal computers. It can also be configured as a half-duplex synchronous system that can communicate with peripheral devices, such as ADC integrated circuits, serial EEPROMs. The Enhanced USART module implements additional features, including Automatic Baud Rate Detection and calibration, automatic wake-up on Sync Break reception, and 12-bit Break character transmit. These make it ideally suited for use in Local Interconnect Network bus (LIN/J2602 bus) systems. 3.3.3 UNIVERSAL SERIAL BUS (USB) Peripheral PIC18F family devices contain a full-speed and low-speed, compatible USB Serial Interface Engine (SIE) that allows fast communication between any USB host and the PIC MCU. The SIE can be interfaced directly to the USB, utilizing the internal transceiver. Some special hardware features have been included to improve performance. Dual access port memory in the devices data memory space (USB RAM) has been supplied to share direct memory access between the microcontroller core and the SIE. Buffer descriptors are also provided, allowing users to freely program endpoint memory usage within the USB RAM space. Figure 23.1 provides a general overview of the USB peripheral and its features.

P a g e | 14

Figure 3.3: Overview of the USB peripheral and its features 3.4 Printed Circuit Board Design Printed circuit boards are electronic circuits created by mounting electronic components on a non-conductive board, and creating conductive connections between them. A PCB is used primarily to create a connection between components such as resistors, integrated circuits, and connectors. [6] A schematic is merely a collection of electronic symbols connected together with virtual wires. A schematic is needed when fabricating a printed circuit board to provide input (a netlist) to the layout and routing tool.

The Printed Circuit Board (PCB) is very important in all electronic gadgets, which are used either for domestic use, or for industrial purpose. PCB design services are used to design the electronic circuits. Apart from electrically connecting, it also gives mechanical support to the electrical components. The PCB designs can be created both manually and automatically. Manual layouts are created with the help of CAD drafting, and the automatic router helps in the creation of the designs automatically. The designers usually prefer the manual way of designs, since they can implement their own ideas and techniques in them. [7]

P a g e | 15

PCB design software provides a complete package of the PCB design services. An example is Easy Applicable Graphical Layout Editor (EAGLE). This includes the PCB editor, the design capture technology, an interactive router, a constraint manager, interfaces for manufacturing CAD, and the component tools. The PCB editor edits the layers in the PCB, both single and multilayered. Both two dimensional and three dimensional rendering of the image are possible. 3D rendering is preferred, since it is possible to analyze both the inner and outer designs vividly.

P a g e | 16

CHAPTER 4: GPS AND GSM TECHNOLOGIES 4.1 How GPS Works Advances in communication technology in the area of Global Position System and Geographical Information System are able to provide a means to navigate the area around us. This information can be accessed remotely. Global Positioning System is a real-time satellite based positioning available on the earth. The uniqueness of the system lies in the fact it is a cheap, accurate and easy way of locating any place on earth. Because of its features, it has become an essential part of any travel. The maturity of GPS (Global Positioning System) technology has led to its increasing utilization in commercial applications. Popularly used as navigational aid, GPS technology has, in recent years, made a tremendous in-road as a reliable tracking system for mobile objects. Combined with mobile communication network such as GSM network, it evolves into GPS tracker that capable of tracking mobile objects in real-time. Acting like a beacon, GPS tracker transmits positional information to a monitoring station at regular prescribe intervals allowing instant analysis of data transmitted. GPS tracker has been successfully deployed in business environment where there is a need to monitor large mobile workforces and assets such as commercial fleets, logistics and transportation companies. Tracking ability of such system is only limited to the availability of GSM network coverage [8]. The GPS is currently the only fully-functional satellite navigation system. More than 24 GPS satellites are in medium Earth orbit, transmitting signals allowing GPS receivers to determine the receiver's location, speed and direction Since the first experimental satellite was launched in 1978, GPS has become one of the important devices for navigation around the world and an important tool for map-making and land surveying. GPS also provides a precise time reference used in many applications including scientific study of earthquakes and synchronization of telecommunications networks [8]. The GPS has three components namely: 1. The space segment: consisting of 24 satellites orbiting the earth at an altitude of 11000 nautical miles.

P a g e | 17

2. The user segment: consisting of a receiver, this is mounted on the unit whose location has to be determined. 3. The control segment: consists of various ground stations controlling the satellites. 4.1 User Segment The user's GPS receiver is the user segment (US) of the GPS system. In general, GPS receivers are composed of an antenna, tuned to the frequencies transmitted by the satellites, receiver-processors, and a highly-stable clock (often a crystal oscillator). They may also include a display for providing location and speed information to the user. A receiver is often described by its number of channels: this signifies how many satellites it can monitor simultaneously 4.2 Calculating Positions The coordinates are calculated according to theWGS84 coordinates system. To calculate its position, a receiver needs to know the accurate time. The satellites are equipped with extremely accurate atomic clocks, and the receiver uses an internal crystal oscillator-based clock that is continually updated using the signals from the satellites. The receiver identifies each satellite's signal by its distinct C/A code pattern, and then measures the time delay for each satellite. To do this, the receiver produces an identical C/A sequence using the same seed number as the satellite. By lining up the two sequences, the receiver can measure the delay and calculate the distance to the satellite, called the pseudo range. The orbital position data from the Navigation Message is then used to calculate the satellite's precise position. Knowing the position and the distance of a satellite indicates that the receiver is located somewhere on the surface of an imaginary sphere centered on that satellite and whose radius is the distance to it. When four satellites are measured simultaneously, the intersection of the four imaginary spheres reveals the location of the receiver. Earth-based users can substitute the sphere of the planet for one satellite by using their altitude. Often, these spheres will overlap slightly instead of meeting at one point, so the receiver will yield a mathematically most-probable position (and often indicate the uncertainty).

P a g e | 18

Calculating a position with the P(Y) signal is generally similar in concept, assuming one can decrypt it. The encryption is essentially a safety mechanism; if a signal can be successfully decrypted, it is reasonable to assume it is a real signal being sent by a GPS satellite. In comparison, civil receivers are highly vulnerable to spoofing since correctly formatted C/A signals can be generated using readily available signal generators. [RAIM] features will not help, since RAIM only checks the signals from a navigational perspective. 4.3 Accuracy and Error Sources The position calculated by a GPS receiver requires the current time, the position of the satellite and the measured delay of the received signal. The position accuracy is primarily dependent on the satellite position and signal delay. To measure the delay, the receiver compares the bit sequence received from the satellite with an internally generated version. By comparing the rising and trailing edges of the bit transitions, modern electronics can measure signal offset to within about 1% of a bit time, or approximately 10 nanoseconds for the C/A code. Since GPS signals propagate nearly at the speed of light, this represents an error of about 3 meters. This is the minimum error possible using only the GPS Position accuracy can be improved by using the higher-speed P(Y) signal. Assuming the same 1% accuracy, the faster P(Y) signal results in accuracy of about 30 centimeters 4.4 GPS DATA The National Marine Electronics Association (NMEA) has developed a specification that defines the interface between various pieces of marine electronic equipment. The standard permits marine electronics to send information to computers and to other marine equipment. GPS receiver communication is defined within this specification. Most computer programs that provide real time position information understand and expect data to be in NMEA format. This data includes the complete PVT (position, velocity, time) solution computed by the GPS receiver. The idea of NMEA is to send a line of data called a sentence that is totally self-contained and independent from other sentences. There are standard sentences for each device category and there is also the ability to define proprietary sentences for use by

P a g e | 19

the individual company. All of the standard sentences have a two letter prefix that defines the device that uses that sentence type. (For GPS receivers the prefix is GP) which is followed by a three letter sequence that defines the sentence contents. In addition NMEA permits hardware manufactures to define their own proprietary sentences for whatever purpose they see fit. All proprietary sentences begin with the letter P and are followed with 3 letters that identifies the manufacturer controlling that sentence. For example a Garmin sentence would start with PGRM and Magellan would begin with PMGN. Each sentence begins with a '$' and ends with a carriage return/line feed sequence and can be no longer than 80 characters of visible text (plus the line terminators). The data is contained within this single line with data items separated by commas. The data itself is just ASCII text and may extend over multiple sentences in certain specialized instances but is normally fully contained in one variable length sentence. The data may vary in the amount of precision contained in the message. For example time might be indicated to decimal parts of a second or location may be show with 3 or even 4 digits after the decimal point. Programs that read the data should only use the commas to determine the field boundaries and not depend on column positions. There is a provision for a checksum at the end of each sentence which may or may not be checked by the unit that reads the data. The checksum field consists of a '*' and two hex digits representing an 8 bit exclusive OR of all characters between, but not including, the '$' and '*'. A checksum is required on some sentences. [9] 4.6 EM408 GPS module The USB Data Logger can connect to a GPS module using its on board UART (serial port). To do this, there are specific built in global functions that can be used to produce the required CRC signature for the NMEA commands. The EM408 GPS module requires a power supply of 75mA at 3.3V. Therefore, an external power source is required. This is because the data loggers the boost regulator can only supply 100mA and the microcontroller and memory card can use more than 25mA at full speed. The GPS data can be stored in Comma Separated Values (CSV) file which can easily be imported into a computer using the USB port and view in a spreadsheet or on a digital map.

P a g e | 20

4.5 GSM Technology- an Overview GSM, Global System for Mobile communications, is today the most successful digital mobile telecommunication system. This second-generation (2G) system provides voice and limited data services and uses digital modulation with improved audio quality. AT commands are instructions used to control a modem. AT is the abbreviation of ATtention. Every command line starts with "AT" or "at". That's why modem commands are called AT commands. Many of the commands that are used to control wired dial-up modems, such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state), are also supported by GSM/GPRS modems and mobile phones. Besides this common AT command set, GSM/GPRS modems and mobile phones support an AT command set that is specific to the GSM technology, which includes SMS-related commands like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages). Note that the starting "AT" is the prefix that informs the modem about the start of a command line. It is not part of the AT command name. For example, D is the actual AT command name in ATD and +CMGS is the actual AT command name in AT+CMGS Mobile phone manufacturers usually do not implement all AT commands, command parameters and parameter values in their mobile phones. Also, the behavior of the implemented AT commands may be different from that defined in the standard. In general, GSM/GPRS modems designed for wireless applications have better support of AT commands than ordinary mobile phones.

P a g e | 21

AT Command AT+CGMI AT+CGMM AT+CGSN AT+CGMR AT+CIMI AT+CSQ AT+CBC AT+CMGS AT+CMGR AT+CMGW AT+CMGD AT+CNMI AT+CPBR AT+CPBW AT+CPBF AT+CLCK AT+CPWD ATO ATH ATA ATD

Functionality Name of the manufacture Model number International mobile subscriber identity Software version International mobile subscriber identity Radio signal strength Charging status Send message Read message Write message Delete message Notifications of received messages Read phone book Write to phone book Search phone book Checking whether a facility is locked Change password Return to online data state Hook control Answer call Dial call

Table 4.1: Basic AT commands In addition, some AT commands require the support of mobile network operators. For example, SMS over GPRS can be enabled on some GPRS mobile phones and GPRS modems with the +CGSMS command (command name in text: Select Service for MO SMS Messages). But if the mobile network operator does not support the transmission of SMS over GPRS, you cannot use this feature. 4.2 Basic Commands and Extended Commands There are two types of AT commands: basic commands and extended commands. Basic commands are AT commands that do not start with "+". For example, D (Dial), A (Answer), H (Hook control) and O (Return to online data state) are basic commands. Extended commands are AT commands that start with "+". All GSM AT commands are extended commands. For example, +CMGS (Send SMS message), +CMSS (Send SMS message from storage), +CMGL (List SMS messages) and +CMGR (Read SMS messages) are extended commands. [10]

P a g e | 22

CHAPTER 5: INTERFACING AND PROGRAMMING MICROCONTROLLER

5.1 Hardware Connection to the pic microcontroller The data logger has two UART pins and one Universal Serial Bus (USB). These are serial interfaces. The other input/output ports on connector block 4 named CON4 are shown in table 5.1.

Table 5.1: Pin assignments for Sensors and devices Serial ports are required for interfacing the GSM and GPS modules. For full duplex (two way) communication with the microcontroller, two pins are necessary, . Therefore the

two UART (Universal Asynchronous Receiver/Transmitter) pins on the microcontroller are not sufficient. However, this is overcome by using software. The two hardware components can be multiplexed by using the Peripheral Pin Select (PPS) feature of the PIC18F27J53 microcontroller. The PPS feature not only simplifies the PC board design, but it also allows the onboard peripherals to be multiplexed on different lines. For example, a single UART peripheral can be used on different pins. 5.2 Programming Pic microcontroller using Script Language The scripting language is a high-level programming language that is interpreted by another program at runtime rather than compiled by the computer's processor as other

P a g e | 23

programming languages (such as C and C++) are. The scripting language is implemented on a virtual machine that incorporates virtual memory support and a (modified) Harvard architecture. The PC host program converts the source code to machine code that then executes on the Data Logger. The PC host program automatically detects the data logger once it has been connected to the computer. With the scripting language its possible to program the data logger so that the desired sensor can be interfaced to the data logger. Without the data logger being programmed, it is not possible to log any data via the sensors and devices. Programs written using the scripting language can be executed and debugged without the data logger being connected to the computer. The program for reading data from the GPS module has been written and tested. Figure 5.1 shows the simulation window of the program.

Figure 5.1: PC host software window executing the GPS script

P a g e | 24

START

Create new log file UART initialization Set baud rate UART to 4800

Detect and Receive GPS data

Data received?

Data processing

Check sum Decode data

GPSS

GPRMC

Store data

Display data

End

P a g e | 25

CHAPTER 6: CONCLUSION
Data loggers are important in almost all industries. They are used to capture and store data over a period of time. The data can be used to optimize the operations being carried. One area in which they can be used is Water Sensor Monitoring. Data captured by the loggers can be transmitted to a central location. This is important in remote sensing and Early warning systems.

The objective of the project is to Redesign, Assembly, configuration and interfacing of data logger kit to GPS and GSM. The GPS coordinates obtained by the GPS module are stored on a memory card. The data is then transmitted to mobile phone or personal computer by means of the GPS modem.

EAGLE software has been used to redesign the data logger and the GPS module has been interfaced. Interfacing the data logger to the GSM modem is under way using EAGLE software, Proteus and the PC host software for script writing. Once the interfacing of GSM is complete, the components that make up the data logger shall be soldered and the complete system tested. The findings and results shall then be documented and a final thesis submitted.

P a g e | 26

References
1. S.Smys1, Jennifer S Raj, Nixon Augustine, AUTONOUMOUS VEHICLE NAVIGATION IN COMMUNICATION CHALLENGED ENVIRONMENTS- A SIMULATION APPROACH, Journal of Automation & Systems Engineering 2. http://www.col.org/SiteCollectionDocuments/Disaster_Management_version 3. Zambia Weekly, Week 3, Volume 2, Issue 3, 21 January 2011 4. NASA Systems Engineering Handbook SP6105 5. PIC18F47J53 Family Data Sheet, 2010, Microchip Technology Inc. 6. Christopher T. Robertson, Printed Circuit Board Designer's Reference: Basics. 7. Jon Varteresian, Fabricating Printed Circuit Boards, 2002, Elsevier Science (USA) 8. NYS Project Management Guidebook 9. Ahmed El-Rabbany, Introduction to GPS: the Global Positioning System, 2010. 10. Ahmed Al Mansur, Alvir Kabir, Shahid Jaman, Nahian Chowdhury, Sadeque Reza Khan, Design and Implementation of Low Cost Home Security System using GSM Network , International Journal of Scientific & Engineering Research Volume 3, Issue 3, March -2012.

P a g e | 27

APPENDEX A Task Name Start Date End Date Duration % Completion 1 Project Selection 4/5/2012 18/5/2012 14 d 100% Resources Needed Supervisor + Nalumino 2 Literature Review 3 Procurement of Tools 4 5 System Design Review of Design 1/1/2013 23/1/2013 24/1/2013 1/2/2013 25 d 7d 90% 80% Nalumino Supervisor + Nalumino 6 First Oral Presentation 7 Progress Report Submission 8 Interfacing to GPS 9 interfacing to GSM 1 0 1 1 1 2 1 3 1 4 Final Project Demonstration 9/8/2013 9/8/2013 1d 0% Thesis Compilation Thesis Review 29/7/2013 2/8/2013 5d 0% Supervisor 1/6/2013 25/7/2013 30 d 0% Nalumino Building and System Testing Work Review 20/5/2013 24/5/2013 5d 0% 10/4/2013 15/5/2013 10 d 0% Supervisor + Nalumino Supervisor 26/3/2013 8/3/2013 10 d 0% Nalumino 11/3/2013 25/3/2013 14 d 70% Nalumino 7/3/2013 21/3/2013 14 d 100% Nalumino 25/1/2013 25/1/2013 1d 100% Nalumino 17/12/2012 8/5/1013 110 d 60% Nalumino 70% Nalumino

Table A.1: Work plan

P a g e | 28

APPENDIX B
The script file for the GPS interface was developed and simulated. The program is as follows;

header simpleGPS { // The script shows how to use the UART to connect to a GPS module, the EM408 // The USB Data Logger can automatically decode GPSS GPRMC NMEA sentences. } script simpleGPS { // Creates A new Log File for this script from scratch, "GPSDecoder.txt" clearFile "GPSDecoder.txt"; // Initialise the UART, pin D0 is Tx, pin D1 is Rx... // Baudrate 4800 bps is the default for the GPS module... // the special GPS decoding mode is enabled by using the define constant // in the mode definition when opening the serial port #GPSDecodingUART... @@openUART(#GPSDecodingUART + #noRxInvUART + #noTxInvUART, 4800, #D0, #D1); print "Sending commands to the GPS module...", newline; // Refer to the datasheet of the EMS408 for details... // The nmea built in command sends the output to the serial port, but it // also keeps a running XOR checksum that is appended to the end of the sentence for error checking // The NMEA CRC is sent by using the print function pf(#nmea), as shown below. The following // command sets the output sentences for the EMS408 module to be GPSS // GPRMC (recommended minimum // specific settings... nmea "$PSRF100,1,4800,8,1,0", pf(#nmea); nmea "$PSRF103,4,0,5,0", pf(#nmea); print "Waiting for GPS Sentences...", newline; precision(3); while(1) { if(@@receivedNMEAUART()) { print newline, "Rx: [", pf(#serialInPipe), "]", newline; // #GPRMCNumBytesToMatch==32 is the number of bytes output // by the internal automatic match for GPRMC sentences... if($$nmea.outputPtr>=#GPRMCNumBytesToMatch) { print "Output: ", $$nmea.outputPtr, newline; print newline, "Longitude: ", @@abs($$longitude), " "; if($$longitude>=0)print "E"; else print "W"; print newline, "Latitude : ", @@abs($$latitude), " "; if($$latitude>=0)print "N"; else print "S"; print newline, "Speed : ", $$speed, " knots (over ground)"; print newline, "Heading : ", $$course, " degrees "; print newline, "GPS Time : ", pf(#vmTime), newline; }

P a g e | 29
@@clearUART(); sleep(1); } } }

You might also like