Monitoring And Automatic Vehicle Tracking Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

This paper is for transportation security and fleet management. An embedded device is designed and fabricated into PCB. GPS in the embedded device, which is kept inside vehicle, acquires the speed and location of the vehicle. The fuel level detection circuit calculates the fuel level. In order to be efficient, SMS function is included to start and stop the communication. When the owner needs the information of the vehicle, a SMS is sent to the device which then establishes the connection to the server through GPRS. The collected data is sent through GPRS to the TCP sever. The web page and android designed for this purpose displays the vehicle information, location in the integrated map, speed, and fuel level of the vehicle.

Keywords: GSM/GPRS, MSP430, android application, fuel level sensor

I. Introduction

1.1 Hard ware

SIM908 is a quad-band GSM/GPRS module which includes GPS function for satellite navigation. Time and costs are saved because of its compact design which integrated GPRS and GPS in a single SMT package. It allows tracking our assets seamlessly at any location and anytime with signal coverage. The input supply voltage range is 3.3 to 4.5 Volts. SIM908 is controlled via AT commands. The SIM908 is connected to micro-controller through UART. The integrated TCP/IP stack makes it easy to establish TCP/IP connection. The data transfer supports two modes transparent mode and Non-transparent mode. In the transparent mode, the data received are sent serially to micro-controller automatically so that the micro-controller can easily process the received data.

LP38501AT-ADJ is the linear voltage regulator. FlexiCap LDO's feature unique compensation that allows the use of any type of output capacitor with no limits on minimum or maximum ESR. This ultra-low dropout linear regulator responds very quickly to step changes in load, which makes them suitable for low voltage microprocessor applications. The input can be in the range of 3 volts to 5.5 volts. Output current is 3A. The output can be varied from 0.65 volts to 5 volts. The Voltage regulator has five pins and is surface mounted component. The adjust pin acts like feedback and helps the regulator to maintain the required output voltage effectively. The enable pin is used to start the voltage regulator.

TVS arrays are designed to protect sensitive electronics from damage or latch-up due to ESD and other voltage-induced transient events. SMF05C is the surface mounted IC which is very small is size and provides up to five connections which can be used in parallel to the circuit to protect from the electrostatic discharge.

Microcontroller The F5419A is used in this project because it has four UART, SPI, I2C interfaces which will be useful when more features are added to the project. The total numbers of pins are 100. It has 87 general purpose input/output pins out of those 100 pins. The port 1 and port 2 has internal pull up resistors connected which can be enabled when required. It has 128KB flash memory which can be used for storing the collected data as well as the code.

The board is designed for the purpose of testing and developing applications. The board has soldered free pads for all 100 pins of the microcontroller. This can be connected with the board to board connector. The board has a JTAG pin which is connected to the USB programmer. The MSP430 FET USB is programmer used. The USB programmer is used to dump the codes in the micro-controller and acts as a simulator.

ADS1110 is a 16 bit ADC this will give a more accurate output in digital format and this is a precision, continuously self- calibrating Analog-to-Digital (A/D) converter with differential inputs and up to 16 bits of resolution in a small SOT23-6 package. The ADS1110 uses an I2C-compatible serial interface and operates from a single power supply ranging from 2.7V to 5.5V.

1.2 Software

In Server side, the GPS module starts collecting the data and sends it to the module in order to track the fleet. The data collected is sent to the server through a GPRS connection. A TCP/IP connection is established between the server and the module in order to transmit and receive the data. The data sent to the server is stored in their database from which the data can be retrieved. The data retrieved is sent to the webpage which is been hosted in the web server. The web page is embedded with the Google maps in order to provide the user with live tracking. The data retrieved from the database which contains the latitude and longitude position of the vehicle is shown in Google maps.

Android Application the user can see the results through their smart phone too. An android application is made to track the vehicle so that they can access their data at anytime and anywhere. The integrated Google maps will appear in the user's phone to show them the exact location of the vehicle. The android application is created in ECLIPSE software which allows the developer to access the GPS data to their phones and start tracking their vehicle.


2.1 Basic structure


Figure.1 Basic structure of system

2.1.1 Serial Communication

The microcontroller has four UART ports. One of the UART port is selected and connected to the SIM908 modem. The UART port A0 of the micro-controller is selected. The Transmission and receiver data lines of the UART port of the micro-controller is connected to the Receiver and Transmission data lines of the GSM modem respectively for the communication to take place. The CMOS logic level is used by both the modem and the micro-controller. So, there is no need for the level shifter circuit such as MAX232. The baud rate used is 115200. The micro-controller enters low power mode when there are no interrupts. There are four low power modes in which the LPM3 is chosen.

E:\Project\2nd review\UART.jpg

Figure 2 shows the Serial connection between MCU and SIM908

The RTC/CTS lines are optional when the hardware flow control has to be used. The modem has RI indicator which goes low for 300ms when a call is received.

2.1.2 I2C

The ADS1110 communicates through an I2C (inter-integrated circuit) interface. I2C is a two-wire open-drain interface supporting multiple devices and masters on a single bus. Devices on the I2C bus only drive the bus lines LOW by connecting them to ground; they never drive the bus lines HIGH. Instead, the bus wires are pulled HIGH by pull-up resistors, so the bus wires are HIGH when no device is driving them LOW.

E:\Project\2nd review\fuel.JPG

Figure 3 shows the overview of fuel level sensor

When the power gets ON the program will gets run, which is stored in microcontroller first it will send the start command and it will gets an acknowledgement signal back it will start I2C bus by using an interrupt ADS1110 will send the data to microcontroller, than it will gets receive data and stored in it, the stored data has to send to the UART port so that we can able to get the data and gives to GSM module and it send to web page

2.1.3 Fuel Level Detection

In the gauge it contains three wire, power supply (VCC), ground (GND), analog data line (ADL) by connecting data line to ADS1110 can get the output of digital format in ADC in ADS1110 it has a two pins one is SDA and SCL this SDA will gives the data serially to microcontroller and clock signal is controlled

only microcontroller and this also connected in to an microcontroller, so that MCU can able to control the device microcontroller is acting as an master and ADC will act only as slave.

2.2 GSM algorithm

E:\Project\2nd review\gsm algo.JPG

Figure 4 shows the working of Emergency call function

When the power is ON the will get executive which is stored in microcontroller and connected with GSM module and Emergency call button When it's gets on first initialize the GSM modem and enable the interrupt when the button 1 is pressed this send to SIM modem through microcontroller (MCU) this will dial to police and similarly for remaining 2, 3 buttons and 4th button is use to Answer and End the call.

The microcontroller is connected serially with the GSM modem and GPS device. Universal Asynchronous Transmission is used to send "AT Commands" and receive back data. When the button is pressed AT command will send to GSM module and it will dial a call for that particular number, each and every command has send through the UART only.

1. Initialize the variables and stop watch dog timer

2. Send the AT command so that GSM module call start, AT command has send by using character string

3. Set the baud rate by sending this "AT+IPR=115200". To answer the call "ATA", this command use to send

4. To dial a call this command has to send "ATD<number>" in this mobile number has to enter.

5. To end the call this command has to send "ATH". Enable the interrupts when the button is pressed correspondingly the call will make.

6. Interrupt 1, this interrupt will make a call to police by pressing a button, which is stored in microcontroller

7. Interrupt 2, this interrupt will make a call to Ambulance by pressing a button, which is stored in Microcontroller

8. Interrupt 3, this interrupt will make a call to owner Ambulance by pressing a button, which is stored in Microcontroller

9. Interrupt 4, this interrupt will make a call to END and ANSWER Ambulance which is stored in Microcontroller, by pressing a button.

2.3 GPS:

1. Initialize the variables and stop watch dog timer

2. Send the AT command so that GSM module call start, AT command has send by using character string

3. Set the baud rate by sending this "AT+IPR=115200".

4. To start GPS this command should get send "AT+CGPSPWR=1"

5. After powering ON the module, the GPS has to be reset, so this AT command should get send "AT+CGPSRST=1"

6. To check whether the location is fixed or not. "AT+CGPSSTATUS" command is used to send to module

7. To get current GPS location "CGPSINF" this AT command should get send to module

8. There are different format in which the GPS NMEA data is received from the modem. The required format is chosen and the command for the particular format has to be sent to acquire the NMEA data.

9. The acquired data is not in the format the server needs. The format needed by the server is also not in the list of supported formats. Hence re-arranging, the acquired data is to be done and the check sum has to be added before the data is sent to the server.

10. By calculating the number of commas, the data can be stored in the different character array and can be merged together in the single character array. This is achieved by using number of for loops and conditional statements.

2.4GPRS Algorithm:


Figure 5 shows the working of both GPS and GPRS

1. Start the GPRS connection when the start SMS is received

2. Send the AT command so that GSM module call start, AT command has send by using character string

3. Set the baud rate by sending this "AT+IPR=115200".

4. To start GPS this command should get send "AT+CGPSPWR=1"

5. After powering ON the module, the GPS has to be reset, so this AT command should get send "AT+CGPSRST=1"

6. Check the status of GPS for that sends the command "AT+CGPSSTATUS"

7. To get current GPS location "CGPSINF=0" this AT command should get send to module

8. To attach from GPRS server this command should be send "CGATT"

9. To define PDP context this command use to send "CGATT=1,"IP","network address" "

10. To start task and set APN, User name, password have to send "CSTT"

11. To bring up wireless connection with GPRS have to send "CIICR"

12. To get local IP Address, has to send "CIFSR" command

13. For knowing the current connection status has to send "CIPSTATUS" command

14. To add an IP head at the beginning of package Received has to send "CIPHEAD" this command

15. To start TCP connection, has to send "CIPSTART <mode>, <IP address>, <port>" this commands

16. Send the data through the TCP connection this command has to be send "CIPSTART"

2.5 Server protocol

Starting tracking

It will have the time than can get start sending the command after that particular time



Stop tracking

This command gets sends than controller will stop sending the data to the server

Syntax: $FRCMD,IMEI,_StopTracking*XX

Send message

This will carry a set of information like date, time, month and remaining has mention in syntax

Syntax: $FRCMD,IMEI,_SendMessage,,DDMM.mmmm,N,DDMM.mmmm,E,AA.a,,HHH.h,DDMMYY,hhmmss.dd,valid,var1=value,var2=value...*XX

2.6 Android Application

The application for the android phones is developed with the help of eclipse software and Java language is preferred. Google maps is integrated into the application. This is done by receiving API key from Google and generating a MD5 key from ECLIPSE. Tracking the fleet involves accessing the data which is received from the GPS module. Codes are written in a way that it requests the user for permitting "GPS functions" before installing the application. The data received from the GPS module is sent to the server and the data is fetched containing the details such as latitude and longitude. By fetching these details the position of the fleet is known and it is shown in the google map which is embedded with the application.

2.7 Web page:

The webpage application is developed using JAVA language and also the other scripting languages like HTML. The Google map is embedded into the web application to view the fleet. These maps can be integrated by requesting the API key. The pages are created and then all the web pages are linked to a single web application. The web application is integrated in a server to host online.

2.8 Fuel level algorithm

E:\Project\2nd review\fuel algo.JPG

Figure 6 shows the working of Fuel level sensor

1. Initialize the variables in unsigned integer

2. Initialize i2c clock, set baud rate, enable interrupt

3. Generate an acknowledgement and Not Acknowledgement signal

5. Start I2C bus

6. Stop I2C bus

7. Read data from ADS1110 Data register

8. Take the DATA from Microcontroller (MCU) pin and give to server.


E:\Project\2nd review\2013-04-25 01.10.36.jpg

Figure 7 Hardware Setup

The result obtained matched our design goals as the vehicle was tracked with hoped accuracy. Fuel quantities were successfully sensed and send over the air up to the needed distance.


The emergency call function is tested and have implemented in real time application. When the buttons are pressed the calls are dialed as per the project's idea and concept. The fuel level was detected and the value is sent through the server and displayed in liters in the webpage successfully. The GPRS connection and the SMS function are utilized successfully to start and stop the data usage and connect to the internet. The TCP connection is established successfully with the server which is shown by the ping command sent from the micro-controller and the server replies back accordingly. These are achieved successfully. The working can be proved by the display of position in the map. The android application shows the maps and the position information after the user has signed into the application. Thus, the all the objectives of the project are met and the real-time working device is designed successfully.