GPS TRACKER – Designing and Prototyping Hardware and Software
Total Page:16
File Type:pdf, Size:1020Kb
Bachelor’s Thesis (UAS) Degree Program in Information Technology 2013 David-Alexandre Davenne GPS TRACKER – Designing and prototyping hardware and software BACHELOR´S THESIS | ABSTRACT TURKU UNIVERSITY OF APPLIED SCIENCES Degree Program in Information Technology 30.10.2013| 42 Instructor: Hazem Al-Bermanei David-Alexandre Davenne GPS TRACKER – DESIGNING AND PROTOTYPING HARDWARE AND SOFTWARE This main goal of this thesis is to define a process starting from an idea and ending with an electronics final product. A GPS tracker is taken as an example to explain each step. The thesis is divided into 2 main parts: hardware and software. The hardware part consists of dividing the project into modules which are explained in detail. Then, the design part describes the tools required to produce a schematic representation and also give information about basic electronics components. Testing is an important step for that kind of project and different tools are illustrated. Finally, the printed circuit board creation process will be described from design to ordering and soldering. The software part is based on a web-app. The main goal was to make it available for any platform, simple and easy to use and it was made possible by using bootstrap, jQuery and PHP. The app offers basic functionalities to interpret the data generated from the GPS tracker. KEYWORDS: Arduino, GPS, PCB, Eagle, Design, Electronic components, Bootstrap, jQuery, PHP CONTENTS LIST OF ABBREVIATIONS (OR) SYMBOLS 5 1 INTRODUCTION 6 2 HARDWARE 7 2.1 Modules 7 2.1.1 Arduino 7 2.1.2 GPS 10 2.1.3 SD card 13 2.1.4 74HC595 13 2.2 Designing 14 2.2.1 Eagle 14 2.2.2 Datasheet 18 2.2.3 Visual Studio 19 2.3 Testing 23 2.3.1 Breadboard 23 2.3.2 Strip board 25 2.3.3 Results 26 2.3.4 Battery life 27 2.4 Producing 29 2.4.1 PCB 29 2.4.2 List of components 31 2.5 Improvements 33 3 SOFTWARE 35 3.1 Modules 35 3.1.1 Bootstrap 35 3.1.2 jQuery 36 3.1.3 PHP 37 3.1.4 Google 37 3.2 Process 38 4 CONCLUSION 38 SOURCE MATERIAL 40 APPENDICES Appendix 1. Eagle Schematic Appendix 2. Eagle PCB & OSH Park PCB Appendix 3. Website’s front page with tracker data loaded PICTURES Picture 1. Arduino Duemilanove 9 Picture 2. Arduino IDE 10 Picture 3. Skylab SKM53 GPS module 11 Picture 4. Breadboard 23 Picture 5. GPS Tracker on a stripboard 26 Picture 6. A 3,7V 1000mAh battery with built-in protection 28 Picture 7. Comparison between a DIP and a SMD micro controller 31 Picture 8. Final product with custom PCB from OSHpark 32 FIGURES Figure 1. A GPRMC Message 12 Figure 2. Simple schematic 16 Figure 3. Transistor used as a switch 17 Figure 4. 7404 pinout 18 Figure 5. Simple Arduino Circuit 22 Figure 6. Breadboard's hole pattern 23 Figure 7. Arduino on breadboard 24 TABLES Table 1. SKM53 specifications 11 Table 2. Arduino basic code example 22 Table 3. List of components for the GPS tracker 33 Table 4. haversine formula 37 LIST OF ABBREVIATIONS (OR) SYMBOLS MIT Massachusetts Institute of Technology AVR Alf and Vegard’s RISC processor RISC Reduced Instruction Set Computing PWM Pulse-Width Modulation I/O Input/Output USB Universal Serial Bus ICSP In-Circuit Serial Programming GPS Global Positioning System NMEA National Marine Electronics Association SD Secure Digital FIFO First-In First-Out EDA Electronic Design Automation PCB Printed Circuit Board LED Light-Emitting Diode OLED Organic Light-Emitting Diode GND Ground Vcc Voltage at Common Connector IC Integrated Circuit ERC Electrical Rule Check DRC Design Rule Check IDE Integrated Development Environment EEPROM Electrically Erasable Programmable Read Only Memory XML eXtensible Markup Language LiPo Lithium Polymer DIP Dual Inline Package SMD Surface Mounted Device AJAX Asynchronous JAvascript and Xml PHP Php Hypertext Preprocessor REGEX REGular EXpression API Application Programming Interface 6 1 INTRODUCTION In a world where almost everything can be found on the Internet, it becomes possible for anyone to start their own projects. Resistors, capacitors and transistors are used everywhere and by everyone but a few actually know how they work and how they can be utilized. With the apparition of development boards such as Arduino few years ago, people can create simple projects using basic electronics components. Arduino offers both a hardware and a software platform and has rich documentation available online. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. Thousands of people have chosen Arduino as their main tool to create all kinds of projects, from blinking lights to space exploration. Creating simple projects is a good start to become familiar with the tools, codes and components but when starting a more advanced project it is necessary to establish ground rules. Without rules and steps a project can become difficult and might be abandoned due to the lack of preparation. Planning is the key and will help during the whole process. Testing will help finding the problems and improve the features of the project. Producing one or more copy is also possible and will affect costs. This thesis focuses on a simple step-by-step process used to create a GPS tracker from scratch. It is divided in two main parts: hardware and software. The hardware part is the board with the electronic components and the software part is the interface used to display the data from the tracker. The purpose is not to explain in detail the electronics components and software code but to give a general idea of the steps from designing to testing and producing. TURKU UNIVERSITY OF APPLIED SCIENCES THESIS | David-Alexandre Davenne 7 2 HARDWARE 2.1 Modules A module is a part of a project whose goal is to execute a specific task. By dividing the project into several functional modules, it is easy to try, analyze and improve each functionality separately. 2.1.1 Arduino Arduino is an electronic open-source platform based on a simple microcontroller (hardware) and a development environment (software) used to write, compile, and transfer the program to the microcontroller. Arduino can be used to develop interactive objects. It can use inputs from a wide range of switches or sensors and can control several items such as lights, motors or any other kind of hardware. Arduino projects can be autonomous or they can communicate with software running on your computer. The platform can be built manually or can be bought pre-assembled. The development software can be downloaded for free. The Arduino programming language is an implementation of Wiring, a development platform based on the programming multimedia environment Processing. 2.1.1.1 Why Arduino? There are a lot of microcontrollers and platforms based on microcontrollers available for embedded electronics. Parallax Basic Stamp, Phidgets, Netmedia’s BX-24, MIT’s Handyboard and several others offer the same capabilities. All these tools help microcontrollers programming by proposing an easy way to use them. Arduino simplifies the way to work with microcontrollers and offer several advantages for teachers, students and hobbyists: TURKU UNIVERSITY OF APPLIED SCIENCES THESIS | David-Alexandre Davenne 8 Cheap: Arduino boards are relatively cheap compared to other platforms. The cheapest version of Arduino can be assembled by hand and the pre- assembled versions are usually under 25€. Multi-platform: The Arduino software, written in Java, runs on Windows, Macintosh and Linux. Most of the microcontrollers systems are limited to Windows. A simple and clear programming environment: Arduino’s programming environment is easy to use for beginners but is flexible enough for advanced users. For teachers, it is based on Processing environment and students who are used to working with that environment will be familiar with the Arduino software. Open-Source software and extensible: Arduino software and Arduino language are published under the open-source license and are available for advanced programmers to work with. The language can also be extended thanks to C++ libraries and people who want to know more about technical details can use C language for AVR microcontroller on which it is based. One can also add the AVR-C language directly in Arduino programs if required. Open-source hardware and extensible: Arduino boards are based on Atmel ATMEGA8, ATMEGA168, ATMEGA328, and similar. Schematics are published under the Creative Commons license so advanced electronics designers can create their own version of the Arduino board. Even less advanced users can build the breadboard version in order to understand how it works and save money. 2.1.1.2 Arduino boards There are several types of Arduino boards. The common basic version, Duemilanove (Italian for “2009”), uses the Atmel ATmega328 microcontroller. The former version of Duemilanove was using an ATmega168 microcontroller. A more advanced version (i.e., more capabilities and more powerful) named Mega is based on the ATmega1280. TURKU UNIVERSITY OF APPLIED SCIENCES THESIS | David-Alexandre Davenne 9 Picture 1. Arduino Duemilanove 2.1.1.3 Arduino Duemilanove This thesis will only focus on the Duemilanove board because it is the board used for this project. The Duemilanove board is a microcontroller board based on the ATmega168 for the first versions or the Atmega328 for the recent versions. Its features: 14 digital I/O (Input/Output) whose 6 can be used as PWM (Pulse-Width Modulation) outputs, 6 analog inputs which can be used as digital I/O, a 16 MHz crystal, a USB connector, a power supply connector, ICSP connector (In-Circuit Serial Programming), a reset button.