Tracev 6
Tracev 6
Tracev 6
A Thesis
College of Engineering
In Partial Fulfillment
Jomiel L. Enriquez
Jonnel Laig
Paulino H. Rimas
May 8, 2020
1
APPROVAL SHEET
PANEL EXAMINERS
Chairman
Member Member
1
ACKNOWLEDGEMENT
The proponents would like to thank the following who supported and who
To Angelica Hernandez Libang and her family, for their support throughout
To Dr. Wilma Weng Casalme, Vice President of student Affairs, for sharing
To our beloved parents, for their moral and financial support they gave
And above all, to our almighty God for giving us the strength and courage
2
DEDICATION
someday.
Table of Contents
Acknowledgements i
Dedication i
Table of Contents ii
List of Figures iv
List of Tables v
3
Hardware Design and Implementation 25
Software Used in System development 27
Proposed Design 27
Chapter IV Results and Discussion 33
Considerations in Developing the system 33
Hardware Component Selection 34
Hardware Component Assembly 38
Software requirements of the System 38
Testing and Evaluation 42
Chapter V Summary, Conclusions and Recommendations 22
Summary 45
Conclusions 45
Recommendations 46
References 47
4
List of Figures
Figure 2.1 Sensitivity Curve 10
Figure 2.2 Response and Resume 11
Figure 2.3 Graph of MQ-3 Gas Detector 11
Figure 2.4 Test Circuit of Alcohol Sensor 1
Figure 2.5 Conceptual Framework 20
Figure 3.1 Conceptual Diagram 23
Figure 3.2 Schematic Diagram in Motorcycle 5
Figure 3.3 Schematic Diagram in Helmet 6
Figure 3.4 Welcoming Installation of TrACE UI 8
Figure 3.5 Entering PIN UI 8
Figure 3.6 Entering Personal Info UI 9
Figure 3.7 TrACE Main Screen UI 30
Figure 3.8 TrACE Settings UI 31
Figure 3.9 Top View, Front View and Isometric View of the Proposed Design 31
Figure 3.10 Back View and Front View of the Helmet 3
Figure 4.1 Interfacing with the Arduino Mega 37
Figure 4.2 Interfacing with the Arduino Nano 37
Figure 4.3 Entering PIN UI 38
Figure 4.4 Loading Screen UI 39
Figure 4.5 TrACE Main Screen UI 39
Figure 4.6 TrACE Settings UI 40
Figure 4.7 Google Map UI 40
Figure 4.8 Emergency Personnel UI 41
Figure 4.9 Bluetooth Terminal UI 41
Figure 4.10 About UI 42
5
List of Tables
Table 2.1 MQ-3 Specifications 13
Table 3.1 Trace Hardware Requirements 22
Table 4.1 Comparison of Available Arduino Board 35
Table 4.2 Tested Material 43
6
CHAPTER I
Introduction
Philippines. It consistently ranks third next to theft and robbery among all
property crimes in the country, accounting for about 10% of this type of crime.
expanding. Numerous cases about the loss of motorcycles were being heard
anywhere. It isn't only the cases that have been accounted for, however, there
are additionally different cases that have not been accounted for. In spite of the
fact that the Philippine National Police is trying to trace criminal gangs and
arrests them, the thieves have numerous methods on the best way to take a
motorcycle in a short period of time. They also smuggled it out and sold it to near
cities. At the same time, it is hard to track the criminal and also to track the stolen
The statistic of motorcycle theft ranks on the second rank of general theft.
According to the Highway Patrol Group (HPG), about 150 motorcycles are stolen
every week in Metro Manila alone or an average of 21 per day. It is also reported
that in 2014, a total of 11,870 motorcycles were stolen, while 10,771 were taken
in 2013. The lost trend is still high. What is the way to reduce loss?
1
Therefore, having a motorcycle anti-theft alarm and tracking device should
be a priority among Filipinos. Its evolution began after the first motorcycle was
motorcycles for security had occurred. Since then, the wireless remote control for
owner and motorcycle. This decreases the number of stolen motorcycles and
makes it more difficult to steal. However, skilled and determined thieves can still
overcome the electronic immobilizer systems. On the other hand, the evolution of
the anti-theft device does not affect the number of motorcycles lost in the
Alarm and Tracker system with Accident Notifier and Engine Controller Device
Module and GPS Module to prevent motorcycles from being stolen. At the same
time, the device will also notify the user once the motorcycle has been stolen and
will be able to track it using the GPS that is in the device. The GSM module will
notify the user. If an accident happens, the device is capable of notifying and
sending the accident location with emergency personnel using the GSM module.
The device will send the location of the accident or the location of the motorcycle
in a form of google map link derived from the latitude and longitude from the GPS
2
module. The device is also connected to the battery of the motorcycle and also
battery is discharged.
motorcycles from thieves, and also for tracking their motorcycles if someone
stole it.
Problem Statement
against property went down from 301 cases in the 1st semester of 2016 to 209
FROM December 2014 to October last year, PNP-HPG reports show there are
more incidents of motornapping (MN) compared to carnapping (CN) on a weekly
average.
The December 2013 to June 2014 period posted the highest record of stolen
vehicles, 81 in the National Capital Region (NCR) alone: 39 CN and 42 MN. The
rates dropped significantly in the months of January to June 2015 as the weekly
rates plunged to 14 CN incidents and 37 MN incidents within a 24-week period.
Gunnacao said the higher MN rates were due to the ability of criminals to pick
keyholes of motorcycles. Likewise, lighter vehicles became easier for criminals to
stow away or take apart.
Corrective measures were also instituted in the reporting system of PNP as the
records obtained from the Directorate for Investigation and Detective
3
Management (DIDM) did not tally with HPG records. The discrepancy was due to
the bypassing of reports that territorial police files to the DIDM without being
validated. Police officials are moving to harmonize the two agencies’ records.
https://businessmirror.com.ph/2016/02/15/motor-vehicle-theft-cases-
bare-crafty-players-tech-reliant-cops-2/ businessmirror
The main objective of this study is to design a device for tracking a stolen
motorcycle.
2. To create a device that will continuously monitor the location of the moving
stolen vehicle
motorcycles.
device.
The Philippines is one of the countries in South East Asia with many
motorbike users. In almost every street, every corner, every road—big or small,
for sure, there is a motorcycle rider just speeding his way and avoiding fatal
4
Conference (CEIC) data, Philippines’s No of Motor Vehicles Registered data was
Dec 1981 to 2019, with 39 observations. The data reached an all-time high of
have recently been the common target of thieves. The National Capital Region
Division (RIDMD) reported that in 2015, over 3,000 motorcycles have been
https://www.ceicdata.com/en/philippines/no-of-registered-motor-vehi
cles/no-of-motor-vehicles-registered CAIC
The Motorcycle Anti-theft Alarm and Tracker system with Accident Notifier
and Engine Controller Device using Smartphones will be a big help to motorcycle
riders in tracking their motorcycles because of the gps module that is installed in
person is lost, they can easily be tracked and brought back to a safe place by
5
In this study, the system will inspire other researchers to develop more
effective and efficient GPS-based location tracking systems for motorcycles via
an Android device to make motorcycles more secure and safe in public places.
The technological significance will benefit from this project as well, in this case,
the researchers want the people to make more use of this one of the latest
technologies.
Alarm and Tracker system with Accident Notifier and Engine Controller Device
using Smartphone. The system will be using an Accelerometer, GSM, GPS, MQ3
and Bluetooth module. With this device, tracking and locating of your motorcycle
will be easy. Using GSM and GPS modules, the device will be able to send
messages and locate the user’s motorcycle. Using Smartphones, the users will
enable on and off the engine of the motorcycle. Using the MQ3 and Bluetooth
module, the user needs to wear the helmet to start the engine of the motorcycle.
This will help motorcycle riders to prevent accidents. Below are the scope,
The system was designed to detect the alcohol concentration in the breath
of motorcycle riders. If the riders drink wine or anything kind of alcohol and thier
blood alcohol concentration does not match the allowed blood alcohol
concentration for driving, the rider will not be able to start the engine of the
6
motorcycle. It will help the riders to prevent motorcycle accidents. Another
feature of the system is to track the motorcycle if someone stole the vehicle. With
the help of TrACE android application, the location of the motorcycle can be
tracked and it will help the riders to know the exact location of the motorcycle.
When an accident occurs, it will help the emergency personnel to track the
PIN Code or Password. TrACE application is also used to control the engine of
the vehicle.
The system was designed to get the exact latitude and longitude of the
system and use that information in checking the location of the motorcycle. To
get that information, the device requires a strong connection to a satellite using a
GPS module. But not all places have a stable connection, this limits the system
in getting the exact location of the motorcycle. Thus the user will not be able to
The helmet has a MQ3 alcohol sensor module to measure the blood
alcohol concentration of the user to trigger the system to turn off the ignition of
the motorcycle when the blood alcohol concentration of the user has not matched
7
The device was designed to be mounted only in the compartment of the
motorcycle where the device will be safe and not be deactivated easily by
thieves.
The device uses the motorcycle’s battery as the backup power supply of
the device to all the modules that are connected in the arduino. This can drain
The device length is seven inches, with a width of 5.5 inches and a height
of 3.2 inches. With this size, it can’t be installed in other types of motorcycle that
Definition of Terms
For better understanding of the study, the following terms are defined:
acceleration forces. Such forces may be static, like the continuous force of
gravity or, as is the case with many mobile devices, dynamic to sense movement
or vibrations.
tablet computers.
8
Anti-theft system. Used to describe equipment that is intended to prevent
something from being stolen. In this study, the researchers create an anti-theft
BAC of .10% means that an individual's blood supply contains one part alcohol
between fixed and mobile devices over short distances using short-wavelength.
number of short-range radio stations to cover the area that it serves, the signal
being automatically switched from one station to another as the user travels
about.
that prevents the engine from running unless the key is the correct key.
9
GPS. A global navigation satellite system that provides location, velocity
warning or signal.
Lithium-ion batteries are commonly used for portable electronics and electric
vehicles.
on your breath, just like your common breathalyzer. It has a high sensitivity and
or service.
10
Relay. Switches that open and close circuits electro mechanically or
electronically. Relay control one electrical circuit by opening and closing contacts
in another circuit.
https://alcohol.stanford.edu/alcohol-drug-info/buzz-buzz/what-bac
“Stanford”.
TrACE. This is the given name to the android application, which stands for
Tracker ACE.
trail. In this study, the user tracks their motorcycle using a smartphone.
involved transmit information. In this study, the GSM module is the device to
11
CHAPTER II
REVIEW OF LITERATURE
and conceptual framework that demonstrates the concepts and ideas used in the
Theoretical Background
SouthEast Asia with many motorcycle users. In pretty much every road, each
corner, each street, huge or little, without a doubt, there is a cruiser rider simply
speeding his direction and keeping away from Manila's 'deadly' traffic
circumstance.
have recently been the common target of thieves. In fact, during the previous four
years, the most noteworthy number of motor napping in the nation has reliably
been recorded.
more than 3,000 motorcycles have been stolen from January-March alone. The
figures demonstrate a monstrous 11.89% hop from the insights during a similar
period the earlier year with just a little more than 2,500 units taken.
12
Everyone riders think that there are safe places to park their motorcycle,
but there is not. Even good restaurants with an armed guard is not actually a safe
place. So, what will you do if your motorcycle is stolen without knowing who took
it? Using a cellphone, anti-theft and tracker device will help to prevent your
motorcycle from thieves and to recover your stolen motorcycle (Man, 2015).
motorcycle. This anti-theft device will immediately notify the motorcycle’s user if
someone tries to start or move his motorcycle. And it will be easy to recover his
motorcycle using a tracker device that will send the location of the motorcycle.
Using a phone, it will be easy to turn off the ignition of the bike in just one tap on
The Motorcycle Security System using GSM and RFID is meant to make a
motorcycles. This technique provides the most effective level of safety for
motorcycle users from hackers or thieves. it's the sound of the alarm whenever
generated automatically once the user motorcycles are notified via text message
alert messages (SMS) when the events that occurred during the invasion or
burglary. This research uses Passive RFID as a second key to show on the
of the entire system. As a prototype, push also needed during this sort of security
13
to point out that if any movement interrupted happened to the motorcycle (W.W.I.
Wan Jusoh, K.A. Mohd Annuar , S.H. Johari, I.M. Saadon, M.H. Harun, 2015).
receiving information, and module used in getting the location of the device.
Sensor for Detecting Alcohol. If the job of the device is to detect the
presence of alcohol in breath, then gas sensors are to be selected. There are
several kinds of sensor technologies that can detect the presence or absence of
detector, Catalytic bead sensor, Hydrogen sensor, Air pollution sensor, Nitrogen
oxide sensor, Oxygen sensor, Ozone monitor, Electrochemical gas sensor, Gas
detector, Hygrometer (Finoit, 2018). The researcher selected the MQ-3 alcohol
concentrations from 0.05 mg/L to 10 mg/L. The sensitive material used for this
14
to alcohol and has a good resistance to disturbances due to smoke, vapor and
gasoline. This module provides both digital and analog outputs. MQ-3 alcohol
Figure 2.2 shows the changing of VRL in the process of putting the sensor
15
Figure 2.3 Graph of MQ-3 Gas Detector
Shown in figure 2.3, the different curves for each gas the MQ-3 can detect.
The ordinate is the resistance ratio of the sensor (Rs/R0), the abscissa is
concentration, R0 means resistance of sensor in clean air. All tests are finished
Shown in Figure 2.4 is the basic test circuit of the sensor. The sensor
voltage (VRL) on load resistance (RL)which is in series with the sensor. The
sensor has light polarity, VC needs DC power. VC and VH could use the same
make the sensor with better performance, suitable RL value is needed: Power of
16
Sensitivity body (Ps): Ps=Vc2×Rs/(Rs+RL)2 and Resistance of sensor (Rs):
photocell that are tuned to listen to infrared light. This sensor is almost always
used for remote control detection - every TV and DVD player has one of these in
the front to listen for the IR signal from the clicker. Inside the remote control is a
matching IR LED, which emits IR pulses to tell the TV to turn on, off or change
17
channels. IR light is not visible to the human eye, which means it takes a little
https://learn.adafruit.com/ir-sensor Adafruit
38 KHz and the peak LED color is 940 nm. The datasheet graph shows from
about 35 KHz to 41 KHz but the sensitivity will drop off so that it wont detect as
well from afar. Likewise, this indicates that an 850 to 1100 nm LEDs can be used
18
Module used for transmitting and receiving. HC-05 is a Bluetooth
module which is designed for wireless communication. This module can be used
The HC-05 has two operating modes, one is the Data mode in which it can
send and receive data from other Bluetooth devices and the other is the AT
Command mode where the default device settings can be changed. The device
can be operated in either of these two modes by using the key pin as shown in
Figure 2.6.
https://components101.com/wireless/hc-05-bluetooth-module Adafruit
sprinkler system in a garden just with a silent call, SIM800L GSM/GPRS module
19
GSM/GPRS module is a miniature GSM modem, which can be integrated into a
At the heart of the module is a SIM800L GSM cellular chip from SimCom.
The operating voltage of the chip is from 3.4V to 4.4V, which makes it an ideal
candidate for direct LiPo battery supply. This makes it a good choice for
All the necessary data pins of SIM800L GSM chip are broken out to a 0.1″
pitch headers. The module includes pins required for communication with a
microcontroller over UART. The module supports baud rate from 1200bps to
module usually comes with a Helical Antenna and solders directly to NET pin on
PCB. The board also has a U.FL connector facility in for keeping the antenna
20
Figure 2.8 SIM800L GSM/GPRS module Sim Socket
Figure 2.8 shows SIM800LT has a SIM socket on the back. Any activated,
2G micro SIM card would work perfectly. Correct direction for inserting SIM card
amount of features into its little frame. Some of them are listed below:
21
● Serial-based AT Command Set
● FL connectors for cell antennae
● Accepts Micro SIM Card
https://lastminuteengineers.com/sim800l-gsm-module-arduino-tutori
al/ Last Minute Engineer
module and is used for navigation. The module simply checks its location on
earth and provides output data which is longitude and latitude of its position.It is
from a family of stand-alone GPS receivers featuring the high performance u-blox
6 positioning engine. These flexible and cost effective receivers offer numerous
connectivity options in a miniature (16 x 12.2 x 2.4 mm) package. The compact
architecture, power and memory options make NEO-6 modules ideal for battery
22
Figure 2.2 shows the pin configuration of NEO-6MV2 GPS Module. The
module has four output pins. The VCC and GND pin is the positive power pin and
ground pin of the module; these pins will be connected to 5 volts and ground of
the supply. The remaining two pins is the RX and TX pin, these pins is used for
communicating to the module from the microprocessor and vice versa. The
● Anti-jamming technology
● UART Interface at the output pins (Can use SPI ,I2C and USB by
● Time-To-First-fix: For Cold Start 32s, For Warm Start 23s, For Hot Start
<1s
● Sensitivity: -160dBm
23
● Operating temperature range: -40ºC TO 85°C
can be either used directly by purchasing from the vendor or can be made at
home using the components, owing to its open source hardware feature. It is
the data memory. The code is stored in the flash program memory, whereas the
data is stored in the data memory. The Atmega328 has 32 KB of flash memory
24
for storing code (of which 0.5 KB is used for the bootloader), 2 KB of SRAM and
pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal
oscillator, a USB connection, a power jack, an ICSP header, and a reset button.
Related Studies
There are different kinds of anti-theft devices in the market and many
types of research about it. In Motorcycle anti-theft system (mats) research, the
25
device uses a vibrator sensor that uses piezoelectric effect to detect vibrations in
the motorcycle when the engine is off to detect if someone is trying to steal a
motorcycle. The vibration sensor will trigger the system to notify the motorcycle
using GPS to get the exact location of the motorcycle by getting the derived
latitude and longitude. The device also requires a strong internet connection to
accurately track motorcycles using GPS module and a wifi module to connect in
a wifi that is in the range of the device, that way it will be easy to track a stolen
anti-tamper feature that alerts you if someone tries to disable or remove the GPS
Tracker and has an engine immobilizer so you can turn off the engine with a text
from your cell phone – perfect for theft prevention. It also has a built-in
shock/motion alarm that will alert you if someone tries to move or roll your
Tracking Capability using GSM and GPS Technologies, the project is geared to
help vehicle owners to become more comfortable and secured with their vehicle
using. GSM and GPS technologies. With the sensor, the owner no longer needs
to constantly check if the vehicle is still in the parking area as when the sensor is
26
triggered, the security alarm is activated and the device will send messages that
can alert the owner. There is likewise no need to place chains because the
device can control the functions of the vehicle. It can automatically turn the
engine off/on and the main switch of the vehicle. With the help of this anti-theft
device, vehicle owners will no longer need to worry when they leave their vehicle
between the vehicle and the owner. When the vehicle gets stolen, the GPS
receiver module will give the reliable location of the vehicle through coordinates
has several GSM Applications in various fields such as the medical field for
detecting body temperature and heartbeat rate. This project uses GPS to get the
exact location of the device, GSM for send and receive SMS message, Solar
Panel to charge the battery and get energy from the sum, vibration sensor to
detect vibrations and impact by using piezoelectric field, RFID to secure the
vehicle by allowing a specific ID to access all the features of the device, and
AMR its function in a wireless ECG using Bluetooth. This project was built on a
mobile phone (Anjali Rathore, Akriti Panwar, Deepika Kumari, Upedra Kumar,
2015).
The entitled project GSM based home security using a hybrid sensor array
is a project to prevent this type of crime. This project works in a hybrid sensor
27
array and GSM to provide security of residential areas at the time of absence of
smart bike, the researcher uses different modules such as accelerometer sensor
the microcontroller and then the buzzer will sound, Microcontroller will also send
a message to the GSM modem then GSM modem will send the message
message. On the Android smartphone, the message will be displayed on the app
controllable and improved safety on motorcycles. This system provides the best
possible level of safety for motorcycle users from hackers or thieves. It has the
sound of the alarm system each time the system is compromised or the
motorcycles will be notified via text message alert messages (SMS) when the
events that occurred during the invasion or burglary. This research uses Passive
RFID as a second key to turn on the motorcycle and also using a microcontroller
push-button also needed this type of security to show that if any movement
28
interrupted happened to the motorcycle (W.W.I. Wan Jusoh, K.A. Mohd Annuar ,
Technology, this study aimed to integrate intrusion and smoke alarm systems and
a notification to users using GSM technology. The module that uses are GSM
Synthesis
Just like the Motorcycle GPS Tracker ( manila gps trackers ), Motorcycle
Anti-theft Alarm and Tracker system with Accident Notifier and Engine Controller
Device using Smartphone also has engine immobilizer that can turn on and off
the motorcycle’s engine with an SMS message but the device has an android
application that is used in sending SMS to turn ON and OFF the engine. The
user does not have to write the message and contact number of the device in
sending a message. Using the application, by just tapping the engine immobilizer
button, it will send the message. This way, it will not consume too much time and
29
In Baburao Kodavati’s study entitled Microcontroller-based Vehicle
Security System with Tracking Capability using GSM and GPS Technologies, the
device uses only GSM and GPS module. The vehicle owner will be more
comfortable and secured with their vehicle because the device uses GSM and
GPS module. The owner will no longer need to go and check the parking lot if
their motorcycle is still there. The owner will just send a message to check if their
vehicle is still parked in the parking area. There is no longer a need to place
chains because the vehicle is already secured. Motorcycle Anti-theft Alarm and
Tracker system with Accident Notifier and Engine Controller Device using
Smartphone is just like this study. Using the application, the user will be able to
check the location of the motorcycle by tapping the location check in the
application to send a message to the motorcycle asking its current location. The
the vehicle is highly secured and completely equipped with a device to secure it.
Zhou Jun, Miao Yubin, Liu Chengliang), this study has a mobile application and
use a device like GSM and GPS, this study can play a role in a medical field for
and Tracker system with Accident Notifier and Engine Controller Device using
Smartphone will be playing a role in the field of a motorcycle for alcohol detector
30
In a project of GSM based home security using a hybrid sensor array, the
researcher used a hybrid sensor to prevent the type of crime in houses. While
Motorcycle Anti-theft Alarm and Tracker system with Accident Notifier and Engine
accidents.
GPS module for the smart bike (Faisal Alfaeru, Aries Boedi Setiawan, Nachrowi
Nachrowi, Rachmat Hidayat S Hidayat S), there are more similarities in using a
information such as SMS when the bicycle is displaced and also sends the
applications created using MIT App Inventor 2. The only difference in the
Motorcycle Anti-theft Alarm and Tracker system with Accident Notifier and Engine
Controller Device using Smartphone is designed into a motorcycle, not bike, and
project is all about a security system for motorcycles using RFID and GSM. In a
Motorcycle Anti-theft Alarm and Tracker system with Accident Notifier and Engine
Controller Device using Smartphone, this project uses different modules. Both
31
In a project entitled Development of Multi-Home Alarm System based on
GSM Technology, this project uses GSM to notify the owner of the device detects
smoke and has a function like a smoke detector that detects smoke or fire to
inform that the owner of the house is in danger. In a Motorcycle Anti-theft Alarm
and Tracker system with Accident Notifier and Engine Controller Device using
Smartphone use GSM to notify the owner of the motorcycle is safe and have a
function like alcohol detector and inform the owner of the motorcycle if alcohol
Conceptual Framework
Alarm and Tracker system with Accident Notifier and Engine Controller Device
32
login in the application. The device will accept it as an input and will analyze it if
the user is asking for a location check, properly wearing a helmet, check alcohol
concentration in breath, identify the speed or the user wants to turn on and off
the engine of the motorcycle. After analyzing the input, the device will control
system with Accident Notifier and Engine Controller Device using Smartphone
using different electronic devices. First, the Arduino will process every
through the Arduino relay and buzzer. Second, the GSM Module, this is used to
send an SMS message to notify the user about the motorcycle location and to
give an emergency alert. Third, the GPS module, this is used to identify the
latitude and longitude of the motorcycle. Fourth, the MQ3 module is used to
measure the angle and speed of the motorcycle. These five electronic devices
33
CHAPTER III
RESEARCH METHODOLOGY
Research Design
methodology was used to ensure the functionality of the system meets the
desired output.
feature is developed separately from the other feature. The prototype, android
https://www.guru99.com/agile-scrum-extreme-testing.html guru99
Predesign Stage
Many factors were considered during the predesign stage, such as the
size of the box of the device, as well as the use of software to develop an android
34
application. Table 3.1 presents the list of hardware components required in the
HARDWARE DESCRIPTION
The brain of the device, it will process every
Arduino Microcontroller information coming from every connected
module.
GSM Module Responsible for receiving and sending sms
requests by user.
GPS Module Responsible for identifying the latitude and
longitude of motorcycle vehicles.
Accelerometer Module Responsible for reading the lean angle and
speed of motorcycle vehicles.
Relay Module 4-Channel Responsible for on and off the engine ignition of
motorcycle vehicles.
MicroSD Card Module Serves as the storage of information of the user
and device.
Piezo Buzzer Responsible to alarm and notify the user.
Design Stage
35
Figure 3.1 Conceptual Diagram
Figure 3.1 shows the Conceptual Diagram. This will be the setup of the
system and the flow of connection and sending of information from the Arduino to
the modules to the user’s phone. The Micro SD Card Reader module will store
every information of the user and the motorcycle. The information about the
motorcycle will be sent through SMS message from the device to the user’s
phone Using the GPS module, the device will be able to identify its current
location and send it to the owner through SMS message using the GSM module.
The device will be able to send a message to the user and also receive a
message from the user. The Arduino will process that message, if the user
message is to check the current location of the vehicle, the device will send the
36
current location of the vehicle, or if the user wants to turn OFF the engine of the
vehicle, the Arduino will send a request to the Arduino relay to turn OFF the
will sense it and send a request to the Arduino to notify the user by sending a
message using the GSM module. The buzzer will be energized if an attempt
occurs. If the device is moved away from its parking area, the device will send a
message to the user and automatically turn off the engine of the motorcycle. The
helmet has an MQ3 module, Bluetooth module, and Battery level indicator. The
battery level indicator serves to know the state of the battery level. The MQ3, it
The Bluetooth module is connected to Arduino Mega to serve as the key to the
motorcycle. If the user has an alcohol breath, it will detect in MQ3 and the
Bluetooth module will not process the engine of the motorcycle. The user needs
to properly wear the helmet and not have an alcohol breath to start the engine of
the motorcycle. It will help the motorcycle riders to drive safely and prevent the
motorcycle accident.
The schematic diagram of the device is shown in figure 3.2. Arduino will
be the brain of the system. The GPS module is connected to the Arduino. It will
define the location of the motorcycle derived from the latitude and longitude. The
accelerometer will monitor the angle and the movement speed of the motorcycle.
This information will be sent to the user using the GSM module. Using the User’s
37
phone, the ignition of the motorcycle can be stopped using an application in its
Android phone. The information will be sent from the phone to the device and the
Arduino will process that information and send it to the Arduino relay to turn off
the ignition.
38
Figure 3.3 Schematic Diagram in Helmet
The schematic diagram of the helmet is shown in figure 3.3, Arduino Nano
is the brain of the device. MQ3 is connected to Arduino Nano, it will detect the
alcohol concentration in breath. The battery level indicator, it will define the state
of charge in the battery. The device has a charging module to charge the battery.
following: Arduino IDE for microcontroller coding and embedding, MIT App
Inventor for making Android application, Proteus ISIS for schematic, Sketchup for
prototype modeling and Adobe Photoshop for user interface designing. Each part
39
MIT App Inventor is an intuitive, visual programming environment that
allows everyone – even children – to build fully functional apps for smartphones
and tablets. Those new to MIT App Inventor can have a simple first app up and
running in less than 30 minutes. And what's more, our blocks-based tool
facilitates the creation of complex, high-impact apps in significantly less time than
hardware and software. Arduino boards are able to read inputs - light on a
activating a motor, turning on an LED, publishing something online. You can tell
https://www.arduino.cc/en/guide/introduction
Proposed Design
The android application will be developed using the MIT App Inventor, the
development of the application will be fast and tested immediately. The design of
40
Figure. Installation Welcome Screen Notification
Figure shown as Installation Welcome Screen, The TrACE app will notify
the user if the accident occurs. As soon as the motorcycle has been in a crush,
41
Figure. Installation Welcome Screen Immobilizer
used as a switch to turn on/off the engine of the vehicle. There are two methods
to turn on/off the engine using TrACE app. First, using SMS, the user sends the
message into the device to send a request to turn on/off the engine. Lastly, Using
Bluetooth.
password. It provides the first line of defense against unauthorized access to the
user device.
42
Figure. Installation Welcome Screen Tracker
Figure shown as Installation Welcome Screen, TrACE app can track the
43
Figure. Installation Welcome Screen Reports
Figure shown as Installation Welcome Screen, TrACE app can receive the
Figure 3.6 shows the entering PIN UI design, After the installation of the
application, the user needs to input the initial pin. After the user input the pin, the
confirmation will pop up. If the user input no, they need to reinput the pin. If yes,
the pin will be saved into a micro SD card. Every time the user closes and
44
reopens the apps, the user needs to input the pin code. It will help to protect the
device.
Figure 3.7 shows the entering Personal Info UI design, After the user input
the initial pin in the installation of an application. This UI design will prompt to
input the user contact number and the device contact number. After the user
input the contact number, the confirmation will pop up. If the user input no, it will
back to input the contact number. If yes, the contact and device number will be
45
Figure 3.8 TrACE Main Screen UI
As shown in Figure 3.8, the TrACE Main Screen labeled as 1 is the screen
to display the status of the user’s motorcycle vehicle. Labeled 2 is the google
map button, this button is designed to locate the exact location of motorcycle
is the Park button, this button is designed to change in park mode. Labeled 4 is
the check location button, it is different in the google map button if the user has
no internet connection, this button is the alternative to know the location of the
terminal, this button is designed to test the device and application. Labeled 6, this
button is the Engine Controller, If the user wants to turn on and off the engine of
off the Bluetooth of your android phone If the color is red, meaning it is off and it
46
will change to color blue if the Bluetooth is on. Lastly, labeled 8 is the settings
button.
Figure 3.9 shows the TrACE settings UI, it consists of seven buttons. Scan
button is to scan the user android device to on the Bluetooth. Change pin button,
is to change the pin of the application. Set the Emergency Personnel button, is to
add the contact number. If the user has an accident using a motorcycle, the
TrACE will notify the Emergency Personnel. The About button is to display the
history of Team Pogi. The Back button is back on the main screen. The Reset
button is back in the default mode of application. Save changes button is to save
47
Figure 3.10 Front View, Top View and Isometric View of the Proposed Design
As shown in Figure 3.10, this is the proposed design of the box, it will
ensure the safety of the device when it is installed on the compartment of the
48
As shown in Figure 3.11, this is the proposed design of the helmet. It will
batteries to have a power supply and it is placed into the battery holder. Battery
level indicator to know the state of the battery. Arduino Nano is the brain of the
CHAPTER IV
developing the prototype. Since the circuit of Motorcycle Anti-theft Alarm and
Tracker system with Accident Notifier and Engine Controller Device using
49
Smartphone would be inserted inside the toolbox of the motorcycle, one of its
considerations is the size it will occupy. As for its function in the helmet, the size
and type of the helmet need to be precise. It needs to have a lot of space to
where the microprocessor, battery and modules will be placed. More importantly,
the study considered the following factors in the design of the Motorcycle
Anti-theft Alarm and Tracker system with Accident Notifier and Engine Controller
and providing penalties therefore, driver and back riders mandated to wear a
Aside from mandating the use of standard helmets, the LTO takes charge
also in several administrative orders that are still in action today. Included is the
Republic Act 10586 or An Act Penalizing Persons Driving under the Influence of
Alcohol, Dangerous Drugs, And Similar Substances, And for Other Purposes.
Towards this end, the state shall penalize the acts of driving under the
wine, and distilled spirits the consumption of which produces intoxication. Breath
analyzer refers to the equipment which can determine the blood alcohol
concentration level of a person through testing his breath. Driving under the
influence of alcohol refers to the act of operating a motor vehicle while the
50
driver's blood alcohol concentration level has, after being subjected to a
some have been discontinued while others are still available. The choice of which
board to use depends on several factors: price, features, availability and ease of
use. Arduino itself is not a specific board type or microcontroller. Rather, Arduino
disadvantages. Choosing the right one for this system is no small feat and some
thought should be given to the one that researcher uses. Although the Arduino
UNO is the most popular board, all boards have excellent support. This means
the researchers are unlikely to fall into device-specific traps that could prevent a
The deciding factor each project will use comes down to two basic things:
hardware and cost. When it comes to physical dimensions the Arduino Nano is
the smallest and is a very portable device. The Arduino Mega is a large Arduino
with plenty of GPIO, its CPU speed is still the same as that found on the UNO
and Nano. All the Arduino boards are presented in Table 4.1.
51
Arduino Uno projects. It’s cheap but you can go limited number of
cheaper as it’s the most cloned Arduino pinouts.
board. It is also fairly easy to use and set
up.
This is the Arduino board to choose if No IoT
you want more pins. Besides the 54 capabilities. A bit
Arduino Mega digital pins and 16 analog pins, it also pricey
has 4 UART terminals. It is also the most
used board for robotics because of its 16
PWM outputs
Technically the same as the Arduino Limited features;
Arduino Nano UNO but smaller and can be mounted no IoT
on a standard breadboard. capabilities;
limited pinouts;
no DC power
jack.
About the same size as the Arduino Limited features;
UNO but has more digital and analog no IoT
Arduino pins. This board comes with a micro capabilities.
Leonardo USB port instead of a USB Type C port.
It also uses only one ATMega
microcontroller which makes it a bit
cheaper than the UNO.
An Intel-powered version of the UNO Limited number
Arduino 101 with added Bluetooth connectivity and of pinouts.
built-in accelerometer and gyroscope.
The smallest Arduino board and Limited features;
technically the same as the Arduino no IoT
Leonardo. Just like the Arduino Nano, capabilities; no
Arduino Micro this board fits on a breadboard. Also DC power jack.
since it uses the same microcontroller as
the Leonardo, it has more digital and
analog pins than the Pro Mini.
This is powered by a 32-bit ARM All pins use 3.3V
microcontroller which makes it almost six which limits the
times as fast and twice the program compatible
Arduino Due memory space as the similarly designed modules and
Arduino Mega. Surprisingly, it’s a bit shields; no IoT
cheaper than the Mega. capabilities.
If the Due is the 32-bit ARM version of All pins use 3.3V
the Mega, then this board is the 32-bit which limits the
Arduino Zero ARM version of the UNO. compatible
modules and
shields; no IoT
capabilities.
52
Containing both a microprocessor and a Limited number
microcontroller, this board can run a of ports; Some
Arduino Yun Linux distro named Linino. But the most reported WiFi
distinctive feature of the Yun is its connectivity
Ethernet and WiFi connectivity. issues. Pricey.
This board is an improved version of the Pricey.
Arduino Tian Yun. The added Bluetooth connectivity
allows for more IoT-based projects.
This board is designed for wearable Can be tricky to
Arduino Lilypad projects. Technically the same as an use as it requires
Arduino UNO some
accessories to
work.
Mechanical Assembly. The ignition system creates the spark that ignites
fuel and air in a petrol engine. The ignition coil increases 12 volts supplied by the
battery to around 20,000 volts. Although older vehicles used a single ignition coil
and a mechanical distributor to send the high voltage to each spark plug, most
vehicles now have a smaller ignition coil for each cylinder of the engine
(GSMechanical, 2020). In this system, the engine will control using TrACE
android application.
system’s circuitry, and how they are connected with each other. Shown in Figure
4.1 and Figure 4.2 is the manner by which all components such as the GSM,
GPS, Accelerometer, Relay Module, Micro SD Card, Piezo Buzzer, Bluetooth and
MQ3, are all interfaced with the microcontroller Arduino Mega and Arduino Nano.
53
Figure 4.1 Interfacing with the Arduino Mega
Figure 4.1 Shows the interfacing with the Arduino. The Bluetooth
Module that is set in master mode and the GSM module which is
accelerometer that will monitor the lean angle of the motorcycle, GPS
module that will get the location of the device, and the relay module that
will control the ignition of the motorcycle will be connected to the arduino
mega
54
Figure 4.2 Interfacing with the Arduino Nano
Figure 4.2 shows the interfacing with the arduino nano. The bluetooth
module that is set to slave mode is responsible for receiving and sending
command to and from the device, IR sensor that will detect if the helmet is
properly worn, MQ3 for measuring blood alcohol concentration, battery level
indicator that will display the status of the battery will be connected to the arduino
nano.
The main controller, particularly Arduino Mega, works with the different
modules for the control and operations of the entire system. The main controller
works with the sensors. This hardware holds the android application to control
For the operation of the system, along with the presented hardware
components, the following software was used: Arduino IDE for microcontroller
coding and embedding and MIT App Inventor for android application user
interface.
User Interface. The following images show the actual android application
55
Figure 4.3 Entering PIN UI
As shown in Figure 4.3, The user needs to input the pin to enter into the
main screen.
As shown in Figure 4.4, After the user enters the correct pin, the TrACE
56
Figure 4.5 TrACE Main Screen UI
As shown in Figure 4.5, when the user inputs the correct pin. The main
As shown in Figure 4.6, when the user wants to change the Personal Info
and Pin. This UI helps the user to change the credential of the user’s device.
57
Figure 4.7 Google Map UI
As shown in Figure 4.7, when the user wants to locate the exact location,
this UI will help the user to know the location of the device.
58
Figure 4.9 Bluetooth Terminal UI
As shown in Figure 4.9, if the user wants to test the device and
application.
As shown in Figure 4.10, the history of Team POGI and creator of the
After developing the prototype, various tests of the system in regards to its
system.
59
Initial Testing. Shown in table 4.2 is the sensitivity of the MQ-3 alcohol
sensor that is being used in the system. Its high sensitivity to alcohol makes it
sipped then tested and rated using the alcohol sensor. The level of concentration
No. Of Wine Gin Beer Gin Beer Gin Wine Wine Beer
Shots
0 24 23 23 25 22 25
1 210 230 250 300 230 216
2 265 209 246 278 230 248
3 271 242 268 292 271 269
4 160 295 240 246 250 260
The researchers tested the accuracy of the MQ-3 Alcohol sensor that
being sipped then simulating its response to alcohol concentration level. To verify
the functionality of the system, the researcher employed the circuit of the sensor
being used. The alcohol level is readable via the AOUT pin. Since it’s a varying
voltage, this pin should be connected to any of the Arduino’s or PIC’s analog pin.
The DOUT pin becomes high when the alcohol level exceeds a threshold
value. Based on the schematic, the threshold value depends on the value of Rp
60
which is the trimmer on the breakout board. It will need to test the device as to
RS/R0 ratio and BAC in mg/L is needed. Given the equation of the line log-log
𝐹
1
𝑙𝑜𝑔( 𝐹 )
0
( )
𝑥
1
𝑙𝑜𝑔( 𝑥 )
𝑥
plot as 𝑓(𝑥) = 𝐹0 𝑥0
0
, where F1, x1 and F0, x0 are two points from the line
on the plot. If the researchers only consider the alcohol line on the plot above,
they can approximate the location of two points: F0 = 1, x0 = 0.4 and F1 = 0.2, x1
= 4. Substituting the points in the equation above, they can now have the
𝑅𝑠 −0.699
relationship of RS/R0 and mg/L, 𝑅0
= 2. 5𝑚𝑔𝐿 .
𝑅𝑠 −1.431
𝑚𝑔𝐿 = (0. 4 𝑅0
) , they need to convert the mg/L in g/dl since it is the most
61
Shown in table 4.3 is the feature testing table. The developers test the
different modules of the system’s functionality, efficiency, and usability. First, the
developers test the Engine Immobilizer using the bluetooth module, after five
trials, the test will be successful. But, In the Engine Immobilizer using the GSM
module, on the first trial, the test will fail because the developers forgot to register
promo load in the sim. After the registration of the promo, the test will be
successful. Second, testing of Check location. In the first and second trials, the
test failed. The developers spent a lot of time waiting to function well with the
GPS Module. That's why, on tracking using an application, the first and second
trials are failed. But, after several hours of waiting, the GPS module functions
62
well, and to check the location is successful. Third, testing of two Bluetooth
modules, the connection of motorcycle device and helmet. The first trial is failed
but the second to fifth trial is successful. Lastly, the accelerometer is functioning
through a survey, according to the functionality of every feature such as its ability
to detect the alcohol level of the rider. The ability of the user in tracking stolen
motorcycles and notifies the user if the user’s motorcycle is stolen or someone is
trying to steal it, its ability to turn on and off the motorcycle’s engine with an SMS
message using an engine immobilizer button, and its anti-theft services that can
CHAPTER V
63
This chapter covers the summary of findings, conclusions, and
Summary
The Motorcycle Anti-theft Alarm and Tracker system with Accident Notifier
motorcycle-theft and drunk driving. The user can also control the ignition, check
and track the location of the vehicle using an application that can be installed in
upon installing the application, it will ask for the user’s information such as user’s
phone number, device number that is inserted in the device, pin to make it only
accessible to the user, and emergency personnel’ number where the system will
send the accident location if an accident occurs. The application will send this
information to the device and will store it in its memory card. Through the
application, the user can check the location and control the ignition of the vehicle.
These commands will be processed by the application and sent to the device
using the bluetooth module and GSM module. If the user is near the vehicle, the
commands will be sent using the bluetooth module else it will be sent using the
GSM module.
The device’s bluetooth module that will be set to slave mode after
receiving the user’s information will only connect to the bluetooth of the user’s
64
phone and will only accept commands from it. The device will also accept
commands that are sent through the GSM module if the sender matched the
cellphone number that the user has provided in the user’s information. Every
command that the user will send will be a random combination of letters and
After the device receives the message using GSM module or bluetooth
module, the arduino mega will process and execute it. Using the relay module,
the system can control the ignition of the vehicle. The relay module will be
connected to the ignition of the motorcycle, this allows the device to turn on and
The accelerometer will monitor the lean angle and vibration of the
motorcycle when it is parked to check if it is safe or not. Once the system detects
a change, it will immediately notify the owner through a SMS message. The user
can monitor the location and the speed of the motorcycle using the GPS module.
Thus the vehicle will be safe and will immediately recover once someone stole it.
Another feature TRACE has is the helmet detection and breathalyzer. the
system will always monitor if the user wore the helmet properly and will always
check the blood alcohol concentration of the driver to prevent driving without
Conclusions
65
Through interview, research, and many trials and testing, the proponents
monitoring the lean angle and the location of the motorcycle and notifying
2. A device that will monitor the location of a stolen vehicle will be a big help
in recovering it. Using the tracking feature of TRACE, there will be a huge
3. Based on the trials and testing, a location and lean angle monitoring
4. According to the evaluation, users finds the android application for trace
easy to use.
has a helmet with alcohol sensor and an IR sensor to detect if the helmet
is properly worn and the wearer is under the influence of alcohol, a GPS
for the response of the system to the owner. Using such technology will
prevent accidents due to drunk driving and motorcycles are safe from any
stealing.
66
Recommendations
1. A more advanced and accurate GPS module that can monitor the device
in any place.
2. A smaller version of the system that will consume small amount energy
and can last a month without even charging regularly to make in more
system.
4. A 3D printed case of the device to make it more durable and to protect the
67
BIBLIOGRAPHY
A. Books
Co., Ltd.
B. Publications
System (MATS).
Anjali Rathore, Akriti Panwar, Deepika Kumari, Upedra Kumar. (2015). GSM for
recentscientific.
68
Vehicle Security System with Tracking Capability using GSM and GPS
Technologies.
C. Electronic References
https://www.google.com/url?sa=t&source=web&rct=j&url=http://www.ijeee.
net/uploadfile/2016/0831/20160831074553244.pdf&ved=2ahUKEwjfmJzO
85PpAhVSFqYKHZ0BDlAQFjANegQIAhAB&usg=AOvVaw0Jy_IwSPn7op
_0IurOQKWM
https://www.google.com/url?sa=t&source=web&rct=j&url=http://jurnal.unm
69
er.ac.id/index.php/sdgs/article/download/1823/1174&ved=2ahUKEwjL8uG
zg5TpAhW1yosBHdmMDYoQFjABegQIBRAB&usg=AOvVaw21jGAQjjiPE
ELbuMHwEyKe
study.com:
https://study.com/academy/lesson/what-is-two-way-communication-definiti
on-systems-examples.html
Finoit. (2018). Top 15 Sensor Types Being Used Most By IoT Application
https://www.finoit.com/blog/top-15-sensor-types-used-iot/
https://gsmechanical.com.au/vehicle-ignition-system/
livingincebuforums:
https://www.livingincebuforums.com/topic/83519-motorcycle-stolen/
Nafize Ishtiaque Hossain, Sakib Reza. (2015, December 5). GSM based home
https://www.researchgate.net/publication/288725626_DESIGN_AND_PER
FORMANCE_EVALUATION_OF_GSM_BASED_HOME_SECURITY_USI
NG_HYBRID_SENSOR_ARRAY
70
Reyes, E. (2017, August 12). Cases of Motornapping / Bikenapping in the
https://ichoose.ph/blogs/cases-motornapping-bikenapping-philippines/
https://www.thedrive.com/reviews/27431/best-car-anti-theft-devices
https://www.sunrom.com/p/alcohol-sensor-module-mq3
http://toyota.custhelp.com/app/answers/detail/a_id/7732/~/what-is-an-engi
ne-immobilizer%3F
manilagpstrackers.ph:
https://manilagpstrackers.ph/fleet-tracking/?gclid=CjwKCAjw36DpBRAYEi
wAmVVDMGbLdtIFBvLEx686pQDSPaLBC8lFQ5y-vX262NS80Xz91nJwd
hYlLxoCLV0QAvD_BwE
W.W.I. Wan Jusoh, K.A. Mohd Annuar , S.H. Johari, I.M. Saadon, M.H. Harun.
(2015, December 3). Motorcycle Security System using GSM and RFID.
https://www.researchgate.net/publication/287922799_Motorcycle_Security
_System_using_GSM_and_RFID
71
Wikipedia. (2019, January 12). App Inventor for Android. Retrieved from
Wikipedia: https://en.wikipedia.org/wiki/App_Inventor_for_Android
https://en.wikipedia.org/wiki/Arduino_IDE
https://en.wikipedia.org/wiki/Anti-theft_system
72
APPENDICES
73
APPENDIX A
Materials Used inMotorcycle Anti-theft Alarm and Tracker system with
Accident Notifier and Engine Controller Device using Smartphone
Acrylic Plastic
2x8 Screw
Spray Paint
74
APPENDIX B
Motorcycle Anti-theft Alarm and Tracker system with
Accident Notifier and Engine Controller Device using Smartphone
Estimated Cost
Hardware Price
Connector 100.00
Switch 3P 12.00
Switch 2P 10.00
Other Materials
75
2x8 Screw 20.00
TOTAL 5078.00
76
APPENDIX C
Program Source Code
#include<SoftwareSerial.h> once:
#define TxD 10 bluetoothSerial.begin(9600);
#define RxD 11 pinMode(A1,INPUT);
float voltage=0; pinMode(IR,INPUT);
int red=7;
int yellow=6; pinMode(red,OUTPUT);
int green1=5; pinMode(yellow,OUTPUT);
int green2=4; pinMode(green1,OUTPUT);
int blue=3; pinMode(green2,OUTPUT);
int IR=9; pinMode(blue,OUTPUT);
float ppmval=0; pinMode(DOUTpin, INPUT);//sets
unsigned char readir; the pin as an input to the arduino
//=========================== Serial.begin(9600);
==========MQ3 start declaration
const int AOUTpin=0;//the AOUT pin }
of the alcohol sensor goes into
analog pin A0 of the arduino void loop() {
const int DOUTpin=8;//the DOUT pin sensorValue =
of the alcohol sensor goes into digital analogRead(sensorPin); // read the
pin D8 of the arduino value from the sensor
int limit; Serial.print("LDR: ");
int value; Serial.println(sensorValue); //prints
int sensorPin = A2; // select the input the values coming from the sensor
pin for LDR on the screen
int sensorValue = 0; // variable to
store the value coming from the MQ3func();
sensor get_voltage();
//=========================== readir=digitalRead(IR);
===========MQ3 end
SoftwareSerial bluetoothSerial(TxD, Serial.print("IR:");
RxD); Serial.print(readir);
Serial.print("\n");
void setup() {
// put your setup code here, to run //if(readir==1){ // ito inedit ko
77
if(sensorValue>70 || ppmval>0.03){ digitalWrite(yellow,HIGH);
digitalWrite(green1,HIGH);
batterylvl(); digitalWrite(green2,HIGH);
bluetoothSerial.print('a'); digitalWrite(blue,HIGH);
} }
else{ else if(voltage<=4.2 && voltage>4){
bluetoothSerial.print('b'); digitalWrite(red,HIGH);
digitalWrite(red,LOW); digitalWrite(yellow,HIGH);
digitalWrite(yellow,LOW); digitalWrite(green1,HIGH);
digitalWrite(green1,LOW); digitalWrite(green2,HIGH);
digitalWrite(green2,LOW); digitalWrite(blue,LOW);
digitalWrite(blue,LOW); }
delay(500); else if(voltage<=4 && voltage>3.8){
} digitalWrite(red,HIGH);
//delay(100); //Original digitalWrite(yellow,HIGH);
delay(1000); //testing digitalWrite(green1,HIGH);
digitalWrite(green2,LOW);
//3:24 digitalWrite(blue,LOW);
//356 = 36 }
//428 = 26 else if(voltage<=3.8 &&
} voltage>3.6){
digitalWrite(red,HIGH);
void get_voltage(){ digitalWrite(yellow,HIGH);
voltage=analogRead(A1); digitalWrite(green1,LOW);
Serial.print("out: "); digitalWrite(green2,LOW);
Serial.print(voltage); digitalWrite(blue,LOW);
Serial.print("\n"); }
else if(voltage<=3.6 &&
voltage=(voltage*6)/1024; voltage>3.4){
Serial.print("voltage out: "); digitalWrite(red,HIGH);
Serial.print(voltage); digitalWrite(yellow,LOW);
Serial.print("\n\n"); digitalWrite(green1,LOW);
digitalWrite(green2,LOW);
//delay(1000); digitalWrite(blue,LOW);
} }
else{
void batterylvl(){ digitalWrite(red,HIGH);
if(voltage>4.2){ digitalWrite(yellow,LOW);
digitalWrite(red,HIGH); digitalWrite(green1,LOW);
78
digitalWrite(green2,LOW); Serial.print("Limit: ");
digitalWrite(blue,LOW); Serial.println(limit);//prints the limit
delay(500); reached as either LOW or HIGH
digitalWrite(red,LOW); (above or underneath)
digitalWrite(yellow,LOW); Serial.print("R0: ");
digitalWrite(green1,LOW); float RS_gas = 0, R0 = 0, sensorV
digitalWrite(green2,LOW); = 0, R2 = 2000, ratio = 0, BAC;;
digitalWrite(blue,LOW); double x;
delay(500); sensorV = (float)value/1024*5.0;
RS_gas = ((5.0 * R2)/sensorV) +
} R2;
} R0 = RS_gas / 60;
Serial.println(R0);
void MQ3func(){
value= R0 = 16000;
analogRead(AOUTpin);//reads the ratio = RS_gas/R0;
analaog value from the alcohol x = 0.4 * ratio;
sensor's AOUT pin BAC = pow(x,-1.431);
limit= digitalRead(DOUTpin);//reads Serial.print("BAC: ");
the digital value from the alcohol Serial.print(BAC*0.001);
sensor's DOUT pin ppmval=BAC*0.001;
Serial.print("Alcohol value: "); Serial.print(" g/DL\n");
Serial.println(value);//prints the delay(1000);
alcohol value }
79
String comkey=""; Serial3.print(kuwet);
int Serial3.print(gps.location.lng(),6);
relay1=7,relay2=22,relay3=6,engine Serial3.println(Speedcheck+bilis);
S=0,setUP=0,setUP2=0; }
String Grsp; else{
char a,back=92,quote=34; Serial3.println("GPS unavailable");
int index=0; }
File myFile; updateSerial();
int enter; Serial3.write(26);
int numFlag=0,pinFlag=0; }
float lati=0.000000, longi=0.000000;
float bilis=0,GPSstatus=0; void SendSMS2(String
String sendernum,String message){
loclink="http://www.google.com/map Serial3.println("AT");
s/place/",kuwet=",",Speedcheck=" updateSerial();
Speed: "; Serial3.println("AT+CMGF=1");
int GPSnoti=1; updateSerial();
void SendSMS(){ String command="AT+CMGS=";
Serial3.println("AT");
updateSerial();
Serial3.println("AT+CMGF=1"); Serial3.println(command+quote+sen
updateSerial(); dernum+quote);
String command="AT+CMGS=";
//Serial3.println("AT+CMGS=\"+6399
53637231\""); //format
Serial3.println(command+quote+own updateSerial();
ercp+quote);
if(GPSnoti==2){
//Serial3.println("AT+CMGS=\"+6399 Serial3.println("GPS is Ready");
53637231\""); //format GPSnoti=3;
updateSerial(); }
else if(GPSstatus==1){
if(GPSnoti==2){ Serial3.print(loclink);
Serial3.println("GPS is Ready"); Serial3.print(gps.location.lat(),6);
GPSnoti=3; Serial3.print(kuwet);
} Serial3.print(gps.location.lng(),6);
else if(GPSstatus==1){ Serial3.println(Speedcheck+bilis);
Serial3.print(loclink); }
Serial3.print(gps.location.lat(),6); else{
80
Serial3.println(message); myFile.print(a);
}
updateSerial(); // close the file:
Serial3.write(26); myFile.close();
} //Serial.println("done.");
} else {
void updateSerial(){ // if the file didn't open, print an
delay(500); error:
while (Serial.available()){ Serial.println("error opening
Serial3.write(Serial.read()); pin.txt");
} }
while (Serial3.available()){ }
Serial.write(Serial3.read());
} void OpenSDep1(){
} myFile = SD.open("epone.txt",
void OpenSDnum(){ FILE_WRITE);
myFile = SD.open("number.txt", if (myFile) {
FILE_WRITE); //Serial.print("Writing to test.txt...");
if (myFile) { //myFile.println("Jomiel pogi");
//Serial.print("Writing to test.txt..."); myFile.print(a);
//myFile.println("Jomiel pogi");
myFile.print(a); // close the file:
myFile.close();
// close the file: //Serial.println("done.");
myFile.close(); } else {
//Serial.println("done."); // if the file didn't open, print an
} else { error:
// if the file didn't open, print an Serial.println("error opening
error: ep1.txt");
Serial.println("error opening }
number.txt"); }
}
} void OpenSDep2(){
void OpenSDpin(){ myFile = SD.open("eptwo.txt",
myFile = SD.open("pin.txt", FILE_WRITE);
FILE_WRITE); if (myFile) {
if (myFile) { //Serial.print("Writing to test.txt...");
//Serial.print("Writing to test.txt..."); //myFile.println("Jomiel pogi");
//myFile.println("Jomiel pogi"); myFile.print(a);
81
myFile.close();
// close the file: //Serial.println("done.");
myFile.close(); } else {
//Serial.println("done."); // if the file didn't open, print an
} else { error:
// if the file didn't open, print an Serial.println("error opening
error: ep4.txt");
Serial.println("error opening }
ep2.txt"); }
}
} void OpenSDep5(){
myFile = SD.open("epfive.txt",
void OpenSDep3(){ FILE_WRITE);
myFile = SD.open("epthree.txt", if (myFile) {
FILE_WRITE); //Serial.print("Writing to test.txt...");
if (myFile) { //myFile.println("Jomiel pogi");
//Serial.print("Writing to test.txt..."); myFile.print(a);
//myFile.println("Jomiel pogi");
myFile.print(a); // close the file:
myFile.close();
// close the file: //Serial.println("done.");
myFile.close(); } else {
//Serial.println("done."); // if the file didn't open, print an
} else { error:
// if the file didn't open, print an Serial.println("error opening
error: ep5.txt");
Serial.println("error opening }
ep3.txt"); }
}
} void setnumber(){
void OpenSDep4(){
myFile = SD.open("epfour.txt", int point=0;
FILE_WRITE); myFile = SD.open("number.txt");
if (myFile) { if (myFile) {
//Serial.print("Writing to test.txt..."); //Serial.print("number.txt:");
//myFile.println("Jomiel pogi");
myFile.print(a); // read from the file until there's
nothing else in it:
// close the file: while (myFile.available()) {
82
//Serial3.write(myFile.read()); }
ownercp+=(char)myFile.read(); myFile.close();
} } else {
// close the file: Serial.println("error opening ep3");
myFile.close(); }
} else { delay(50);
// if the file didn't open, print an
error: myFile = SD.open("epfour.txt");
Serial.println("error opening if (myFile) {
number.txt"); while (myFile.available()) {
} ep4+=(char)myFile.read();
delay(50); }
myFile = SD.open("epone.txt"); myFile.close();
if (myFile) { } else {
while (myFile.available()) { Serial.println("error opening ep4");
}
ep1+=(char)myFile.read(); delay(50);
}
myFile.close(); myFile = SD.open("epfive.txt");
} else { if (myFile) {
Serial.println("error opening ep1"); while (myFile.available()) {
} ep5+=(char)myFile.read();
delay(50); }
myFile.close();
myFile = SD.open("eptwo.txt"); } else {
if (myFile) { Serial.println("error opening ep5");
while (myFile.available()) { }
ep2+=(char)myFile.read(); }
}
myFile.close();
} else { void ReadSD(){
Serial.println("error opening ep2"); myFile = SD.open("number.txt");
} if (myFile) {
delay(50); Serial.print("number.txt:");
83
}
// close the file: //Serial.print(" Latitude: ");
myFile.close(); //Serial.println(gps.location.lat(),6);
} else { //Serial.print(" Longitude: ");
// if the file didn't open, print an
error: //Serial.println(gps.location.lng(),6);
Serial.println("error opening //Serial.print(" Speed MPH: ");
number.txt"); //Serial.println(gps.speed.mph());
} bilis=(gps.speed.mph());
84
Serial.println("EP3:"+ep3);
Serial.println("EP4:"+ep4); //===========================
Serial.println("EP5:"+ep5); ======================DELET
} E
SD.remove("GAWA.txt");
void starten(){ if(SD.exists("GAWA.txt")){
digitalWrite(relay2,LOW); Serial.print("Present");
delay(500); }
digitalWrite(relay1,HIGH); else{
digitalWrite(relay3,HIGH); Serial.print("Absent");
delay(500); }
digitalWrite(relay3,LOW); }
}
void deleteEP(){
void stopen(){ Serial.println("Removing
digitalWrite(relay2,HIGH); epone.txt");
digitalWrite(relay1,LOW); SD.remove("epone.txt");
digitalWrite(relay3,LOW); Serial.println("Done Removing
epone.txt\n");
}
Serial.println("Removing
void createFile(){ eptwo.txt");
SD.remove("eptwo.txt");
/////========================= Serial.println("Done Removing
====================CREATE eptwo.txt\n");
Serial.print("Creating file");
Serial.println("Removing
myFile=SD.open("GAWA.txt",FILE_ epthree.txt");
WRITE); SD.remove("epthree.txt");
myFile.close(); Serial.println("Done Removing
epthree.txt\n");
//===========================
======================CHECK Serial.println("Removing
if(SD.exists("GAWA.txt")){ epfour.txt");
Serial.print("Present"); SD.remove("epfour.txt");
} Serial.println("Done Removing
else{ epfour.txt\n");
Serial.print("Absent");
} Serial.println("Removing
85
epfive.txt"); else{
SD.remove("epfive.txt"); Serial.println("epfive not existing");
Serial.println("Done Removing }
epfive.txt\n");
} }
void checkEP(){
if(SD.exists("epone.txt")){ void setup() {
Serial.println("epone exist"); Serial.begin(9600);
} Serial3.begin(9600);
else{
Serial.println("epone not existing"); // initialize SD
} Card----------------------------------------
Serial.println("Initializing SD
if(SD.exists("eptwo.txt")){ card...");
Serial.println("eptwo exist"); bluetoothSerial.print("Initializing SD
} card...");
else{ bluetoothSerial.begin(9600);
Serial.println("eptwo not existing"); if (!SD.begin(53)) {
} Serial.println("initialization failed!");
bluetoothSerial.print("initialization
if(SD.exists("epthree.txt")){ failed!");
Serial.println("epthree exist"); while (1);
} }
else{ Serial.println("initialization done.");
Serial.println("epthree not bluetoothSerial.println("initialization
existing"); done.");
}
// SD Card Initialization
if(SD.exists("epfour.txt")){ End-------------------------------
Serial.println("epfour exist");
} //Initialize
else{ GSM------------------------------------------
Serial.println("epfour not existing"); --
} Serial.println("Initializing GSM
Module..");
if(SD.exists("epfive.txt")){ bluetoothSerial.println("Initializing
Serial.println("efive exist"); GSM Module..");
}
86
============================
Serial3.println("AT"); =
updateSerial();
Serial3.println("AT+CMGF=1"); //createFile();
updateSerial();
}
Serial3.println("AT+CNMI=1,2,0,0,0")
; void loop() {
updateSerial(); pinFlag=0;
delay(500); numFlag=0;
Serial.println("Initialization Done."); int
bluetoothSerial.println("Initialization epflag=0,a1=0,a2=0,a3=0,a4=0,a5=
Done."); 0,getnum=0,numberC=0,go=0,Dcou
nt=0,kumpara=0;
//GSM end sender="";
initialize-------------------------------------- while(Serial3.available()>0){
--- delay(10);
a=Serial3.read();
//GPS
Initialized------------------------------------- Serial.print(a);
-------
Serial1.begin(9600); bluetoothSerial.print(a);
Serial.println("GPS Start"); if(go==0){
bluetoothSerial.println("GPS Start"); if(a=='+'){
getnum++;
//GPS initialize }
ebd-------------------------------------------- }
----- if(getnum==2){
if(numberC!=13){
pinMode(relay1,OUTPUT); sender+=a;
pinMode(relay2,OUTPUT); numberC++;
pinMode(relay3,OUTPUT); }
digitalWrite(relay2,HIGH); else if(numberC==13){
digitalWrite(relay1,LOW); Serial.println("done getting
digitalWrite(relay3,LOW); number");
displaynumbers(); Serial.println("comparing
number");
if(sender==ownercp){
///test======================== Serial.println("sender: user");
87
go=1; a2=0;
} else
else{ a2=1;
Serial.println("sender }
unknwon"); if(a=='c'){
} if(a3==1)
numberC++; a3=0;
getnum++; else
} a3=1;
} }
if(a=='d'){
if(go==1){ if(a4==1)
if(a=='i'){ a4=0;
displaynumbers(); else
} a4=1;
if(a=='h'){ }
deleteEP(); if(a=='e'){
checkEP(); if(a5==1)
} a5=0;
else
if(a=='g'){ //////// to a5=1;
start and stop engine }
if(engineS==0){
starten();
engineS=1; if(a!='a'&&a!='b'&&a!='c'&&a!='d'&&a!
} ='e'){
else if(engineS==1){ if(a1==1){
stopen(); OpenSDep1();
engineS=0; }
} if(a2==1){
} OpenSDep2();
if(a=='a'){ }
if(a1==1) if(a3==1){
a1=0; OpenSDep3();
else }
a1=1; if(a4==1){
} OpenSDep4();
if(a=='b'){ }
if(a2==1) if(a5==1){
88
OpenSDep5(); Serial.println("\nKey matched");
} Serial.println("deleting old
} number and pin");
if(a=='$'){ SD.remove("number.txt");
numFlag=0; SD.remove("pin.txt");
}
if(a=='@'){ Serial.println("Old number and
ReadSD(); pin deleted");
SendSMS(); SendSMS2(sender,"Deleted");
} setUP=1;
} }
}
if(Dcount==2){ if(setUP==1)
if(a!='.'){ {
Serial.println("Reading Key");
comkey+=a; if(pinFlag==1){
} OpenSDpin();
else{ Serial.print(a);
Dcount++; }
kumpara=1;
} if(numFlag==1){
} if (a!=';'){
if(a=='.'&&Dcount!=1){ OpenSDnum();
Dcount++; Serial.print(a);
} setUP2=1;
if(Dcount==1){ }
Serial.println("Reading Key"); }
Dcount++; if(a==';'){
} pinFlag=1;
numFlag=0;
if(kumpara==1){ Serial.print("\n");
kumpara=0; }
Serial.println("\nComparing if(a=='-'){
Key"); numFlag=1;
Serial.println("key: "+comkey); }
}
if(comkey==key){ }
89
if(setUP2==1){ setUP2=0;
SendSMS2(sender,"Number }
saved. Restart the system"); checkGPS();
setUP=0; }
90
91
92
93
94
95
96
97
98
APPENDIX D
Thesis Topic Abstract Form
99
APPENDIX E
Letters
APPENDIX F
Certificate of Grammarian
APPENDIX G
User’s Evaluation for the Functionality of Motorcycle
Anti-theft Alarm and Tracker system with Accident Notifier and Engine
Controller Device using Smartphone
APPENDIX H
User’s Evaluation for the Efficiency of Motorcycle
Anti-theft Alarm and Tracker system with Accident Notifier and Engine
Controller Device using Smartphone
APPENDIX I
User’s Evaluation for the Usability of Motorcycle
Anti-theft Alarm and Tracker system with Accident Notifier and Engine
Controller Device using Smartphone
APPENDIX J
Demonstration With Users
APPENDIX K
Sample Questionnaire
APPENDIX L
Curriculum Vitae
100
101