Final Year Project PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

A Project Report on

IoT BASED GPS TRACKING SYSTEM OVER 2G/3G/LTE

SHIVAM SINGH (ROLL: 16900319095)

GUIDE- AMIT KUMAR NANDY


CERTIFICATE

This is to Certify that this project report entitled IoT based GPS Tracking System over 2G/3G/LTE is
submitted to MAULANA ABUL KALAM AZAD UNIVERSITY OF TECHNOLOGY in the partial
fulfillment of the requirement for the award of the B. TECH degree in ELECTRONICS AND
COMMUNICATION ENGINEERING is originial work carried out by:

ABHISHEK KUMAR ROLL NO: 16900319135


ANIRUDH KUMAR ROLL NO: 16900319128
DEEPAK KUMAR ROLL NO: 16900319103
NILAYAN SAMANTA ROLL NO: 16901619004
SHIVAM SINGH ROLL NO: 16900319095

Under my guidance,
The matter embodied in this project report is genuine work done by the student and has not been
submitted whether to this University or to any other University/Institute for the fulfillment of the
requirement of any course of study.

__________________________

Prof. Jyotirmoy Chakrabarti


Assistant Professor
Department of Electronics and
Communication Engineering
Academy of Technology,
Date:
__________________________

Prof. Dr. Abhijit Banerjee


Head,
Department of Electronics and
Communication Engineering
Academy of Technology, Aedconagar,
Hooghly-712121, West Bengal, India
Date:
CONTENTS
Sl.No Topic

1 ABSTRACT

2 INTRODUCTION

3 COMPONENTS TO BE USED

4 FLOW CHART, BLOCK DIAGRAM

5 OVERVIEW OF TECHNOLOGICAL DETAILS

6 CURRENT PROGRESS

7 APPENDIX

8 FUTURE SCOPE
ABSTRACT
The increased rate of vehicle theft led to increasing concern among
vehicle owners. In addition, most of the smaller car rental companies
or personal car rental are also a concern when their rented vehicles
are not returned on the date line. Thus, the purpose of this project is
to study and analyse the existing vehicle tracking system. Next, a
tracking system is configured and developed using the Internet of
Things platform (Arduino) and web-based application. Then, the
usability and functionality of the Global Positioning System and Global
System for Mobile Communications module are tested together with
Arduino to get the location for vehicle tracking. This project is
developed using the Extreme Programming methodology. During the
planning phase, requirements are gathered through a questionnaire
from 40 participants. Requirements and data collected are analysed,
and features that need to be included are identified. Iteration starts at
design phase where every time there are changes to the system, the
design needs to be changed first. Coding is done based on the
features, functions, flows, and interfaces from the design phase. The
code is tested before small release of part of the system. Feedback is
gathered from the user after every small release of the system during
the iteration. The completed system enables vehicle owners to track
their vehicle through web application or Short Message Service (SMS)
anytime, anywhere.
INTRODUCTION
In the present-day tracking is becoming essential for the purpose of
improving our life condition. Convenience and ease of using vehicle iswhat
home vehicle tracking is offering. Vehicle tracking offers a futuristic way of
life in which an individual gets to control his vehicle using a smart phone,
from tracking a vehicle /detecting accidental place of a vehicle; it also offers
an efficient use of technology. But to get or acquire such system installed
will cost a lot of money and that is the major reason of why vehicle tracking
has not received much demand and attention, adding to that also the
complexity of installingit and configuring it. Thus, it is essential to make it
cost effective and easy to configure, if this is granted to people then they
will be willing to acquire it in their personal vehicles, school buses and
taxes/cabs etc. In other words, a system modification for the vehicle
tracking is required in order to lower the price of applying it to vehicles.
According to Missing Children Europe Organization report, 50,000 children
are reported missing every year in the EU; that would be 1 child per every
2 minutes. Further, records by the U.S. Department ofJustice Office of
Juvenile Justice and Delinquency Prevention indicatethat children of ages 5
to 16 are most likely to be subjected to such abuse. Due to the imminent
threat, parents are prone to buy their children Mobile phones to be in touch
with them. However, there aresome well know socio-psychological issues
associated with handing a Mobile phone to a child, such as cyber bullying,
improper use of SocialNetworking Media, access to inappropriate content
on the Internet, and possibly phone theft. Children and early adolescents
tend to seeka degree of independence from parents as part of their growing
up, and sometimes tend to do their day-to-day travel unaccompanied by a
parent or a guardian. The modern working culture may also limit the
opportunity for parents/guardians to accompany children on their daily
travel. These have raised concerns regarding the safety of children, paving
way to technologies and devices which enable child locating and tracking,
also considerations towards ethics should be respected in relation to
locating and tracking people.
Objective of the study
To construct a vehicle tracking system controlled by a smartphone
specifically an embedded device. To design and implement cost
effective vehicle tracking system yet an efficient one. To design a user
friendly and a safe system to control vehicles especially aimed to aid
the all useful to track soldiers or to track child/ kid for their safety or
missingpurpose and also can be useful for women safety purpose. So,
when this embedded system design takes care of every aspect of its
purpose as it mentioned above.

Significance of the study


This study will be undertaken to create a vehicle tracking system at
low cost and easy to create, this will benefit both the manufacturer
and the client. It will help the manufacturer by making it easy and
cheaper to apply it, and it will also benefit the clients by making it
cost effective and the most important advantageis that it will make
the vehicle much safer than it is actually for the clients.
COMPONENTS ARE TO USE:
1. NODE-MCU(ESP-8266)
2. GPS MODULE(NEO-6M)
3. GSM MODULE(SIM-900)
4. POWER SUPPLY (9V BATTERY)
5. CONNECTING WIRES (JUMPER WIRES)

FLOW CHART:
BLOCK DIAGRAM:
OVERVIEW OF TECHNOLOGICAL DETAILS
1. NODE-MCU(ESP8266-12e):
NodeMCU is an open-source firmware for which open-source
prototyping board designs are available. The name "NodeMCU"
combines "node" and "MCU" (micro-controller unit). Strictly speaking,
the term "NodeMCU" refers to the firmware rather than the
associated development kits.
Both the firmware and prototyping board designs are open source.
The firmware uses the Lua scripting language. The firmware is based
on the Eula project, and built on the Espressif Non-OS SDK for
ESP8266. It uses many open source projects, such as lua-cjson . Due to
resource constraints, users need to select the modules relevant for
their project and build a firmware tailored to their needs. Support for
the 32-bit ESP32 has also been implemented.
The prototyping hardware typically used is a circuit board functioning
as a dual in-line package (DIP) which integrates a USB controller with
a smaller surface-mounted board containing the MCU and antenna.
The choice of the DIP format allows for easy prototypingon
breadboards. The design was initially based on the ESP-12 moduleof
the ESP8266, which is a Wi-Fi SoC integrated with a Tensilica Xtensa
LX106 core, widely used in IoT applications.
Power Pins There are four power pins. VIN pin and three 3.3V pins.

 VIN can be used to directly supply the NodeMCU/ESP8266 and its


peripherals. Power delivered on VIN is regulated through the onboard
regulator on the NodeMCU module – you can also supply 5V regulated
to the VIN pin
 3.3V pins are the output of the onboard voltage regulator and can be
used to supply power to external components.

GND are the ground pins of NodeMCU/ESP8266

I2C Pins are used to connect I2C sensors and peripherals. Both I2C Master and I2C Slave are
supported. I2C interface functionality can be realized programmatically, and the clock frequency
is 100 kHz at a maximum. It should be noted that I2C clock frequency should be higher than the
slowest clock frequency of the slave device.

GPIO Pins NodeMCU/ESP8266 has 17 GPIO pins which can be assigned to functions such as I2C,
I2S, UART, PWM, IR Remote Control, LED Light and Button programmatically. Each digital
enabled GPIO can be configured to internal pull-up or pull-down, or set to high impedance.
When configured as an input, it can also be set to edge-trigger or level-trigger to generate CPU
interrupts.
ADC Channel The NodeMCU is embedded with a 10-bit precision SAR ADC. The two functions
can be implemented using ADC. Testing power supply voltage of VDD3P3 pin and testing input
voltage of TOUT pin. However, they cannot be implemented at the same time.

UART Pins NodeMCU/ESP8266 has 2 UART interfaces (UART0 and UART1) which provide
asynchronous communication (RS232 and RS485), and can communicate at up to 4.5 Mbps.
UART0 (TXD0, RXD0, RST0 & CTS0 pins) can be used for communication. However, UART1 (TXD1
pin) features only data transmit signal so, it is usually used for printing log.

SPI Pins NodeMCU/ESP8266 features two SPIs (SPI and HSPI) in slave and master modes.
These SPIs also support the following general-purpose SPI features:

 4 timing modes of the SPI format transfer


 Up to 80 MHz and the divided clocks of 80 MHz
 Up to 64-Byte FIFO

SDIO Pins NodeMCU/ESP8266 features Secure Digital Input/Output Interface (SDIO) which is
used to directly interface SD cards. 4-bit 25 MHz SDIO v1.1 and 4-bit 50 MHz SDIO v2.0 are
supported.

PWM Pins The board has 4 channels of Pulse Width Modulation (PWM). The PWM output can
be implemented programmatically and used for driving digital motors and LEDs. PWM
frequency range is adjustable from 1000 μs to 10000 μs (100 Hz and 1 kHz).

Control Pins are used to control the NodeMCU/ESP8266. These pins include Chip Enable pin
(EN), Reset pin (RST) and WAKE pin.

 EN: The ESP8266 chip is enabled when EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power.
 RST: RST pin is used to reset the ESP8266 chip.
 WAKE: Wake pin is used to wake the chip from deep-sleep.

Control Pins are used to control the NodeMCU/ESP8266. These pins include Chip Enable
pin (EN), Reset pin (RST) and WAKE pin.

 EN: The ESP8266 chip is enabled when EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power.
 RST: RST pin is used to reset the ESP8266 chip.
 WAKE: Wake pin is used to wake the chip from deep-sleep.

Features of the Node MCU:


● Microcontroller: Ten silica 32-bit RISC CPU Xtensa LX106 ● Operating
Voltage:3.3V ● Input Voltage: 7-12V ● Digital I/O Pins (DIO): 16 ● Analog
Input Pins
(ADC): 1 ● UARTs: 1 ● SPIs: 1 ● I2Cs: 1 ● Flash Memory: 4 MB ● SRAM: 64 KB ●
Clock Speed: 80 MHz ● USB-TTL based on CP2102 is included onboard, Enabling
Plug n Play ● PCB Antenna ● Small Sized module to fit smartly inside your IoT
projects.
Peripherals and I/O:
The ESP8266 NodeMCU has 17 GPIO pins broken out to the pin headers on both
sides of the development board. These pins can be assigned to all sorts of
peripheral duties, including: ● ADC channel – A 10-bit ADC channel. ● UART
interface – UART interface is used to load code serially. ● PWM outputs – PWM
pins for dimming LEDs or controlling motors. ● SPI, I2C & I2S interface – SPI and
I2C interface to hook up all sorts of sensors and peripherals. ● I2S interface – I2S
interface if you want to add sound to your project.

Multiplexed I/O:
1 ADC channels ● UART interfaces ● PWM outputs ● SPI, I2C & I2S interface
Thanks to the ESP8266’s pin multiplexing feature (Multiple peripherals
multiplexed on a single GPIO pin). Meaning a single GPIO pin can act as
PWM/UART/SPI.

On-board Switches & LED Indicator:


The ESP8266 NodeMCU features two buttons. One marked as RST located on the
top left corner is the Reset button, used of course to reset the ESP8266 chip.The
other FLASH button on the bottom left corner is the download button used while
upgrading firmware.

Switches & Indicators:


RST – Reset the ESP8266 chip ● Blue LED – User Programmable 16 The board also
has a LED indicator which is user programmable and is connected to the D0pin of
the board. Serial Communication The board includes CP2102 USB-to-UARTBridge
Controller from Silicon Labs, which converts USB signal to serial and allows your
computer to program and communicate with the ESP8266 chip. ● CP2102 USB-
to-UART converter ● 4.5 Mbps communication speed

SOFTWARE USED:
IDE: The Arduino integrated development environment (IDE) is a cross-platform
application (for Windows, macOS, Linux) that is written in the programming
language Java/C++. It originated from the IDE for the languages Processing and
Wiring. It includes a code editor with features such as text cutting and pasting,
searching and replacing text, automatic indenting, brace matching, and syntax
highlighting, and provides simple one-click mechanisms to compile and upload
programs to a compatible board. It also contains a message area, a text console,
a toolbar with buttons for common functions and a hierarchy of operationmenus.
The source code for the IDE is released under the GNU General Public License,
version 2. The Arduino IDE supports the languages C and C++ using special rules
of code structuring. The Arduino IDE supplies a software library from the Wiring
project, which provides many common input and output procedures. User-
written code only requires two basic functions, for starting thesketch and the
main program loop, that are compiled and linked with a programstub main () into
an executable cyclic executive program with the GNU toolchain,also included
with the IDE distribution. The Arduino IDE employs the program avrdude to
convert the executable code into a text file in hexadecimal encoding that is
loaded into the board by a loader program in the board's firmware.

Install ESP8266 Add-on in Arduino IDE


To install the ESP8266 board in your Arduino IDE, follow these next instructions:
● In your Arduino IDE, go to File> Preferences
Enter
http://arduino.esp8266.com/stable/package_esp8266com_index.jso
n into the “Additional Boards Manager URLs” field as shown in the
figure below. Then, click the “OK” button: -

SKETCH: A program written with the Arduino IDE is called a sketch.


Sketches are saved on the development computer as text files with
the file extension. ino. Arduino Software (IDE) pre-1.0 saved sketches
with the extension. pde. A minimal Arduino C/C++ program consist of
only two functions:
● setup (): This function is called once when a sketch starts after
power-up or reset. It is used to initialize variables, input and output
pin modes, and other libraries needed in the sketch.
● loop (): After setup () has been called, function loop () is executed
repeatedly in the main program. It controls the board until the board
is powered off or is reset.
2. NEO 6M GPS MODULE:

The NEO-6M GPS module is a well-performing complete GPS receiver


with a built-in 25 x 25 x 4mm ceramic antenna, which provides a strong
satellite search capability. With the power and signal indicators, you
can monitor the status of the module. Thanks to the data backup
battery, the module can save the data when the main power is shut
down accidentally. Its 3mm mounting holes can ensure easy assembly
on your aircraft, which thus can fly steadily at a fixed position, return
to Home automatically, and automatic waypoint flying, etc. Or you can
apply it on your smart robot car for automatic returning or heading to
a certain destination, making it a real "smart" bot!
The schematic diagram of the module is shown as below:
1) A complete GPS module with an active antenna integrated, and a
built-in EEPROM to save configuration parameter data.
2) Built-in 25 x 25 x 4mm ceramic active antenna provides strong
satellite search capability.
3) Equipped with power and signal indicator lights and data backup
battery.
4) Power supply: 3-5V; Default baud rate: 9600bps.
5) Interface: RS232 TTL
Test
In this test, we will send the positioning data collected by the NEO-6M
GPS Module to the software on the PC, and compare this result with
that of a standard GPS device. Thus, we can know whether this module
works or not.
Preparations:
1 X USB-to-Serial Module (e.g., FTDI Module)
1 x USB CableLaptop
1 x NEO-6M GPS Module
Note: Pay attention to the wiring between the power and ground of
the testing board, like VCC and GND, to prevent a short circuit.
Position Fix LED Indicator
There is an LED on the NEO-6M GPS Module which indicates the status of Position
Fix. It’ll blink at various rates depending on what state it’s in:  No Blinking – It’s
searching for satellites.  Blink every 1s – Position Fix is found (The module can
see enough satellites).
3.3V LDO Regulator
The operating voltage of the NEO-6M chip is from 2.7 to 3.6V. But the good news
is that, the module comes with MIC5205 ultra-low dropout 3V3 regulator from
micrel. The logic pins are also 5-volt tolerant, so we can easily connect it to an
Arduino or any 5V logic microcontroller without using any logic level converter.
Battery & EEPROM
The module is equipped with an HK24C32 two wire serial EEPROM. It is 4KB in
size and connected to the NEO-6M chip via I2C. The module also contains a
rechargeable button battery which acts as a super-capacitor. 28 An EEPROM
together with battery helps retain the battery backed RAM (BBR). The BBR
contains clock data, latest position data (GNSS orbit data) and module
configuration. But it’s not meant for permanent data storage. As the battery
retains clock and last position, time to first fix (TTFF) significantly reduces to 1s.
This allows much faster position locks. Without the battery the GPS always cold-
start so the initial GPS lock takes more time. The battery is automatically charged
when power is applied and maintains data for up to two weeks without power.
Antenna
An antenna is required to use the module for any kind of communication. So, the
module comes with a patch antenna having -161 dBm sensitivity. You can snap-
fit this antenna to small U. FL connector located on the module. 29 The NEO-6M
GPS engine on these modules is quite a good one, and it also has high sensitivity
for indoor applications. Furthermore, there’s one MS621FE- compatible
rechargeable battery for backup and EEPROM for storing configuration settings.
The module works well with a DC input in the 3.3- to 5-V range (thanks to its built-
in voltage regulator). The original circuit diagram of themodule, borrowed from
the web, is shown below:
3. GSM MODULE(SIM 900)
SIM900A Modem is built with Dual Band GSM/GPRS based SIM900A
modem from SIMCOM. It works on frequencies 900/ 1800 MHz SIM900A
can search these two bands automatically. The frequency bands can also
be set by AT Commands. The baud rate is configurable from 1200-115200
through AT command. The GSM/GPRS Modem is having internal TCP/IP
stack to enable you to connect with internet via GPRS. SIM900A is an
ultracompact and reliable wireless module. This is a complete GSM/GPRS
module in a SMT type and designed with a very powerful single-chip
processor integrating AMR926EJ-S core, allowing you to benefit from small
dimensions and cost-effective solutions.
Specification

 Dual-Band 900/ 1800 MHz

 GPRS multi-slot class 10/8GPRS mobile station class B

 Compliant to GSM phase 2/2+

 Dimensions: 24*24*3 mm

 Weight: 3.4g

 Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced


AT Commands)

 Supply voltage range: 5V

 Low power consumption: 1.5mA (sleep mode)

 Operation temperature: -40°C to +85 °

SIM Interface
As we know that module SIM900A is a GPRS/GSM module. The module is dependent
on some devices for some of its features. The most important one is the SIM. The
SIM needs to connect with the module for GPRS/GSM functions to fully operate. All
the sim interface of the module is:

 SIM_VDD – Pin30 – Power Supply of the SIM


 SIM_DATA – Pin31 – For data output
 SIM_CLK – Pin32 – For clock pulse
 SIM_RST – Pin33 – For reset
 SIM_PRESENCE – Pin34 – To detect the SIM
CURRENT PROGRESS:
Here we have gained a knowledge about Node-mcu, GPS module,
GSM module. In our project we write our code in Arduino-Ide. Arduino
company provides user friendly software allows writing any code. First,
we have to include some library in Arduino Ide. The libraries are
<TinyGPS++.h>, <ESP8266WiFi.h> etc.
We have connect GPS module to the Node-mcu. GPS module have 4
pins TX, RX, GND, VCC. We connect VCC and GND pins of GPS module
to the GND and 3v output pins of Node-mcu. Then connection is
complete.
Then write our code and send it to the Node-mcu through usb cable.
After that we see our latitude & longitude of the current location.
Till now this part is complete.
APPENDIX:
SOURCE CODE:

#include<SoftwareSerial.h>
SoftwareSerial GPSModule(3,2); /* TX,RX Pins of GPS Module*/
int updates;
int failedUpdates;
int pos;
int stringplace = 0;
char phone_no[]="7418916610"; //User’s Phone Number
String timeUp;
String nmea[15]; /* Character Array to store GPS data */
String labels[12] {"Time: ", "Status: ", "Latitude: ", "Hemisphere: ", "Longitude: ",
"Hemisphere:
", "Speed: ", "Track Angle: ", "Date: "}; /*Respective Labels for GPS data*/
/*Main() Function */
void setup() { Serial.begin(9600); /* Setting the baud-rate of the program */
GPSModule.begin(9600); /* Starting as well as setting the baud-rate of GPS Module */
Serial.println("Vehicle Tracking");
delay(3000);} /* End of Main() Function */
//Loop() Function for performing the task again and again
void loop() { Serial.flush();
GPSModule.flush(); //Tuning on the GPS flush LED
/* Checking GPS data available or not */
while (GPSModule.available() > 0){
GPSModule.read();} /* if GPS data available then reading the GPS data */
if (GPSModule.find("$GPRMC,")) {/*Storing and retrieving GPS data in their respective
order*/
String tempMsg = GPSModule.readStringUntil('\n');
for (int i = 0; i < tempMsg.length(); i++) { if(tempMsg.substring(i, i + 1) == ",") {
nmea[pos] = tempMsg.substring(stringplace, i);
stringplace = i + 1;
pos++;} //Those GPS data are in their GPS string format, not yet refine in normal form
if (i == tempMsg.length() - 1) { /* checking all the respective GPS data store or not */
nmea[pos] = tempMsg.substring(stringplace, i);}}
updates++;
/* Calling user define function to convert Latitude and Longitude respectively */
nmea[2] = ConvertLat();
nmea[4] = ConvertLng();
for (int i = 0; i < 9; i++) {
Serial.print(labels[i]);
Serial.print(nmea[i]);
Serial.println("");}
delay(300);
/* Sending SMS */
Serial.println("AT+CMGF=1"); /* AT Command for Sending SMS */
delay(2000);
Serial.print("AT+CMGS=\"");

Serial.write(0x0D); /* Hex Equivalent of Carriage Return


*/ Serial.write(0x0A); /* Hex Equivalent of Newline */
delay(2000);
/* SMS String or Message */
Serial.println("Welcome to Vehicle Tracking");
Serial.print("Latitude:");
Serial.println(nmea[2]);
Serial.print("Longitude:");
Serial.println(nmea[4]);
/* Generating The URL */
Serial.print("https://www.google.co.in/maps/place/");
Serial.print(nmea[2]);
Serial.print(",");
Serial.print(nmea[4]);
delay(500);
Serial.println (char(26)); /* The ASCII code of the ctrl+z is 26 */

else {
failedUpdates++;}
stringplace = 0;
pos = 0;}

String ConvertLat() {
String posneg = "";
if (nmea[3] == "S") {
posneg = "-";}
String latfirst;
float latsecond;
for (int i = 0; i < nmea[2].length(); i++) {
if (nmea[2].substring(i, i + 1) == ".") {
latfirst = nmea[2].substring(0, i - 2);
latsecond = nmea[2].substring(i - 2).toFloat();}}
latsecond = latsecond / 60;
String CalcLat = "";
char charVal[9];
dtostrf(latsecond, 4, 6, charVal);
for (int i = 0; i < sizeof(charVal); i++){

CalcLat += charVal[i];}
latfirst += CalcLat.substring(1);
latfirst = posneg += latfirst;
return latfirst;}

String ConvertLng() {
String posneg = "";
if (nmea[5] == "W") {
posneg = "-";}
String lngfirst;
float lngsecond;
for (int i = 0; i < nmea[4].length(); i++) {
if (nmea[4].substring(i, i + 1) == ".") {
lngfirst = nmea[4].substring(0, i - 2);
lngsecond = nmea[4].substring(i - 2).toFloat();}}
lngsecond = lngsecond / 60;
String CalcLng = "";
char charVal[9];
dtostrf(lngsecond, 4, 6, charVal);
for (int i = 0; i < sizeof(charVal); i++){
CalcLng += charVal[i];}
lngfirst += CalcLng.substring(1);
lngfirst = posneg += lngfirst;
return lngfirst;}
FUTURE SCOPE:
With the help of high sensitivity sensors, we can detect any accidents.
Whenever an accident occured unexpectedly, with the help of vibarting
sensors we can detect the exact location of the accident.
By adding many mods or extensions like other sensors many devastating
and unforseen situations can be dealt with by locating the exact location
of the place where the situation occured.
BIBLIOGRAPHY

Websites-

www.circuitdigest.com
www.how2electronics.com
www.electroniclinic.com

Books-

Building a Dedicated GSM GPS Module Tracking System for Fleet Management:
Hardware and Software by Franjieh El Khoury (Author), Antoine Zgheib (Author).

Global Positioning System by Pratap Misra.

You might also like