Presented here is a GPS based vehicle tracking system based on the ATMega16 microcontroller using global positioning system (GPS) and global system for mobile communication (GSM).
This is a cheaper solution than a two-way GPS communication system wherein communication is done in both ways with GPS satellites. This project uses only one GPS device and two-way communication is achieved using a GSM modem. GSM modem with a SIM card used here implements the same communication technique as in a regular cellphone.
The system can be mounted or fitted in your vehicle in a hidden or suitable compartment. After this installation, you can easily track your vehicle using your mobile phone by dialling the mobile number of the SIM attached to the GSM modem. You will automatically get the location of the vehicle in the form of an SMS (short message) on your mobile phone.
This system allows you to track your vehicle anytime and anywhere. Whether you own a company with a fleet of hundreds of vehicles or you have expensive piece of equipment and you want to keep an eye on them, this tracking system can inform you of the status without you having to be actually present on the site.
Fig. 1 shows the block diagram of the GSM and GPS based vehicle tracking system.
Applications and benefits
1. You can locate your stolen vehicle easily using your mobile without any extra cost.
2. It can be used for trucks carrying valuable goods, to keep track of the status of delivery and location of the truck at all times.
3. The device ensures vehicle security and smooth fleet management.
4. You can easily install it in any vehicle such as cars, boats and motorbikes. An SMS will inform you whether the vehicle is stationary or on the move.
5. You can also use it to keep tab on your driver. It reduces vehicle abuse and ultimately results in significant cost-savings for individuals, fleet owners and the like.
Before delving into the detailed working of the project, let’s discuss some basics of GPS and GSM technologies.
GPS is a space-based satellite navigation system. It provides location and time information in all weather conditions, anywhere on or near the Earth. GPS receivers are popularly used for navigation, positioning, time dissemination and other research purposes.
The GPS consists of satellites that orbit the earth. These satellites are geosynchronous with an orbital period that is the same as the Earth’s rotation period. So they maintain exactly the same position with respect to the earth below them. All the GPS satellites transmit radio signals, which are then captured by a GPS receiver and used to calculate its geographical position. A minimum of four satellites may be required to compute the four dimensions of X, Y, Z (latitude, longitude and elevation) and time. GPS receiver converts the received signals into position and estimates time and some other useful information depending on the application and requirements.
GPS determines the distance between a GPS satellite and a GPS receiver by measuring the amount of time taken by a radio signal (the GPS signal) to travel from the satellite to the receiver. To obtain accurate information, the satellites and the receiver use very accurate clocks, which are synchronised so that they generate the same code at exactly the same time.
If accuracy is important, you need GPS with a wide-area augmentation system (WAAS) capability. This is a satellite service providing additional correction information to the GPS receiver in order to increase its accuracy.
Before purchasing a GPS receiver, it’s good to know the protocols supported by it. Some popular protocols for GPS receivers are:
An industry-standard protocol common to marine applications defined by National Marine Electronics Association (NMEA), USA. NMEA provides direct compatibility with other NMEA-capable devices such as chart plotters and radars.
TSIP (trimble standard interface protocol)
A binary packet protocol that allows the designer to configure and control the GPS receiver for optimal performance in any number of applications.
TAIP (trimble ASCII interface protocol)
Designed specifically for vehicle tracking applications. It is a bidirectional protocol using simple ASCII commands with the associated ASCII responses.
GSM is a standard set developed by the European Telecommunications Standards Institute (ETSI) to describe technologies for second-generation (2G) digital cellular networks.
A GSM modem is a specialised type of modem that accepts a SIM card and operates over a subscription to a mobile operator just like a mobile phone.
GSM modems are a cost-effective solution for receiving SMS messages because the sender is paying for the message delivery. To perform these tasks, a GSM modem must support an extended AT command set for sending and receiving SMS messages, as defined in the ETSI GSM 07.05 and 3GPP TS 27.005 specifications.
It should also be noted that not all phones support this modem interface for sending and receiving SMS messages, particularly most smartphones like the Blackberry, iPhone and Windows mobile devices.
GPS based vehicle tracking system: Circuit description
Fig. 2 shows the circuit of a GSM and GPS based vehicle tracking system. It consists of a microcontroller, GPS module, GSM modem and 9V DC power supply. GPS module gets the location information from satellites in the form of latitude and longitude. The microcontroller processes this information and sends it to the GSM modem. The GSM modem then sends the information to the owner’s mobile phone.
ATmega16 microcontroller (IC2) is the heart of the project that is used for interfacing to various hardware peripherals. It is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture.
ATmega16 microcontroller is interfaced serially to a GPS module and GSM modem. The GPS module outputs many data but in this project only the NMEA data is read and processed by the microcontroller. The processed data is sent to the user’s mobile through a GSM modem.
This GPS based vehicle tracking system implements RS-232 protocol for serial communication between the microcontroller, GPS and GSM modem. A serial driver IC MAX232 (IC3) is used for converting RS-232 voltage levels into TTL voltage levels.
The user’s mobile number should be included in the source code written for the microcontroller. Thus the user’s mobile number resides in the internal memory of the MCU.
iWave GPS module
In this project, we have used the iWave GPS module (refer Fig. 3). GPS always transmits the data to the microcontroller. Transmit pin TXD of GPS is connected to the microcontroller via MAX232. NMEA defined an RS-232 communication standard for devices that include GPS receivers. The iWave GPS module supports the NMEA-0183 standard that is a subset of the NMEA protocol. It operates in the L1 frequency (1575.42 MHz) and provides information with accuracy of up to 10 metres in open sky. Antenna should be placed in the open space and there should be at least 50 per cent space visibility.
This GPS based vehicle tracking system uses SIM300 GSM modem (refer Fig. 4). GSM modem transmits and receives the data. Modem SIM300 is a tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz, DCS 1800 MHz and PCS 1900 MHz.
Transmit pin TXD and receive pin RXD of GSM modem are connected to the microcontroller (IC2) via MAX232 (IC3). Port pin PD0 (RXD) and port pin PD1 (TXD) of the microcontroller are connected to pins 12 and 10 of MAX232, respectively.
The circuit is powered off a 9V battery. 7805 regulator (IC1) is used to convert 9V into 5V. The microcontroller and MAX232 are powered by 5V. LED1 indicates the presence of power supply.
The program for the microcontroller is written in ‘C’ language and compiled using AVR Studio. The user’s mobile number should be included in the source code in order to receive the call from the SIM card used in the GSM modem. The hex code of the program is burnt into the MCU using PonyProg2000 software. You can use any other suitable tool for the same.
GPS module with 9600 baud rate is used to receive the data from the satellites, which is defined in the software. The software is developed to decode the NMEA protocol. This protocol includes a set of messages that use ASCII character set and have a defined format that are continuously sent by the GPS module to the interfacing device.
The GPS module or receiver provides data in the form of ASCII comma-delimited message strings. Each message starts with a dollar sign ‘$’ (hex 0x24) and ends with (hex 0x0D 0x0A).
Download PCB and Component Layout PDFs: click here
Download Source Code: click here
The software output protocol message includes global positioning system fixed data (GGA) and geographic position latitude/longitude (GLL). In this project, we will use GGA only.
Note that the latitude and longitude information are both represented in the ‘degrees, minutes and decimal minutes’ format as ddmm.mmmm. However, most mapping applications require longitude and latitude to be expressed in decimal, degrees, in ‘dd.dddddd’ format with a corresponding sign (negative for south latitude and west longitude). So some kind of conversion is required in the software if you want a particular format.
The NMEA standard explains how each message string is formed with a dollar sign ($) leading each new GPS message.
For example: $GPGGA,002153.000,3342.6618,N,11751.3858,W where $GPGGA is the GGA protocol header, 002153.000 is UTC time in hhmmss.ss format, 3342.6618 is the latitude of the GPS position fixed data in ddmm.mmmm format, 11751.3858 is the longitude of the GPS position fixed data in dddmm.mmmm format, and ‘N’ stands for North and ‘W’ for West.
With this data you can find out the exact location using a map or you can use freely available software to check the location.
Construction and testing
An actual-size, single-side PCB layout of the GPS and GPS based vehicle tracking circuit is shown in Fig. 5 and its component layout in Fig. 6.
Assemble the components on the PCB with IC bases for ATmega16 and MAX232. Burn the code into the MCU and mount it on the PCB. Insert the SIM card with sufficient balance in the GSM module. Connect the circuit as shown in Fig. 2.
This system can also be used where the information is not needed so frequently and the subject has to be tracked at irregular time periods, such as monitoring of adolescents by parents, in research to track animals in the jungle, coordinating search and rescue efforts, and mapping trails and exploring new terrains.
Lalit Prakash Vatsal is a third-year integrated dual degree (electronics and communication engineering) from IIT, Roorkee, Prince Gupta is a second-year B.Tech (electrical engineering) from IIT, Rajasthan and Sani Theo is working at EFY Lab as team leader.