Вы находитесь на странице: 1из 31

Improved Car alarm System using IOT

Student(s) Name(s)

 Aya Mohammad Ababneh 2013980019


 Jehan Omar AlAli 2013980028
 Hala anwar abuhantash 2014980007

Supervisor Name

Prof.Hussein Alzoubi

Computer Engineering Department

Hijjawi Faculty for Engineering Technology

Yarmouk University

March 2018
Acknowledgments

We would like to thanks everyone who helped us during our graduation project starting
with our supervisor Prof. Hussein Alzoubi who didn’t keep any information and any
effort and encouraged us to do a great job and to be better each time. Thanks for the
support and kind communication which had a great effect regarding to feel interesting
about what we are working on.

Thanks are extended to our “Computer Engineering Department” for the beneficial
lectures and many thanks for Dr.Osama Alkofahi for providing our group with valuable
information and advices to be better each time. Also we thank the engineers who helped
us during the first stages of our graduation project. Finally, we would like to say many
thanks for our families, thank you for allowing us time away from you to research and
write.

ii
Abstract

Nowadays the internet forms an essential part of our life and we depend on it in all our
works and activities. The revolution of technology has made the “Photon” which is a
low-cost, highly-reliable internet-connected hardware that enable us to connect our
devices and things with the Internet such as TVs, lights, fridges and alarms including cars
alarms. Every car owner wants maximum protection of his car, so our project is about
developing car security system and trying to benefit from the massive evolution in
technology and apply it in the security field by adding a new feature to the car alarm.
This project presents the interface between the car alarm’s package with the Photon, and
we used Webhook integration to connect the Photon with Twilio API to send message to
car’s owner if someone tries to steal his car. So this system sends SMS through internet
and generates sound. This project is result of combing the idea of IoT and car security
system. Finally our aim is to improve the car security system.

iii
Table of Contents

Acknowledgments ......................................................................................... ii
Abstract ......................................................................................................... iii
List of Figures................................................................................................ v
Acronyms ...................................................................................................... vi
Chapter 1 ....................................................................................................... 2
1.1 Introduction.......................................................................................... 3
1.2 Motivation ............................................................................................ 3
1.3 Contribution ......................................................................................... 4
1.4 Literature Review ................................................................................ 4
1.5 The Remaining of this Report ............................................................ 4
Chapter 2 ....................................................................................................... 5
2.1 Idea and principle ................................................................................ 6
2.2 System components.............................................................................. 7
Chapter 3 ..................................................................................................... 11
3.1 Hardware connections and interface ............................................... 12
3.2 webhook and Twilio integrations ..................................................... 16
Chapter 4 ..................................................................................................... 19
4.1 Testing ................................................................................................. 20
Chapter 5 ..................................................................................................... 23
5.1 Conclusions ........................................................................................ 24
5.2 5.2 Future Work................................................................................. 24
References .................................................................................................... 25

iv
List of Figures
Figure 1: car alarm[13]. ................................................................................................................. 7
Figure 2: mercury sensor ............................................................................................................... 8
Figure 3: shock sensor [14] ............................................................................................................ 8
Figure 4: sirens [15]. ..................................................................................................................... 9
Figure 5: car alarm circuit board [16]............................................................................................. 9
Figure 6: Photon microcontroller [8]……………………………….…………………..……… 10
Figure 7: particle app................................................................................................................... 12
Figure 8: log in screen ................................................................................................................. 12
Figure 9: beginning screen ........................................................................................................... 12
Figure 10: selecting photon network ........................................................................................... 13
Figure 11: complete setup process ............................................................................................... 13
Figure 12: wire connection diagram ……………………………….…………………..…….…13
Figure 13: hardware circuit diagram. ....................................................................................... 14
Figure 14: system architecture .................................................................................................... 14
Figure 15: system flow chart ........................................................................................................ 15
Figure 16: particle IDE ................................................................................................................ 16
Figure 17: particle console ........................................................................................................... 16
Figure 18: get a Twilio phone number …………………………….…………………..…….…17
Figure 19: webhook builder. ....................................................................................................... 17
Figure 20: advanced settings ...................................................................................................... 18
Figure 21: HTTP authenticetion ................................................................................................... 18
Figure 22: alarm testing............................................................................................................... 20
Figure 23: webhook testing .......................................................................................................... 21
Figure 24: Twilio testing and response sms .……………………….…………………..……….21
Figure 25: whole system testing .............................................................................................. 22
Figure 26: logs of event on cloud ................................................................................................. 22
Figure 27: messages on the phone ............................................................................................... 22

v
Acronyms

Acronym Stands for


IoT Internet of things
API Application Programming Interface
HTTP Hyper Text Transfer Protocol
URL Uniform resource locator
IDE Integrated Development Environment
SID Serial Identifier

vi
CHAPTER ONE

Introduction

2
Chapter 1

Introduction

In this section we will introduce the idea, the motive and the importance of our project.
We will talk about some details of it; the technology and devices that were used. Also we
will mention related work from the oldest to the newest.

1.1 Introduction
Internet of Things (IoT) applications has entered in every area of life starting from
our homes down to outside community. The potential benefits of Internet of
Things (IoT) are almost limitless. IoT applications are changing the way we work and
live by saving time and resources and opening new opportunities for growth,
innovation and knowledge creation [1]. We have become able to connect our ordinary
devices and things to internet and that enable it to exchange information; now your
fridge can tell you whenever the food items need to be replenished! The main idea of
our project is to have an improved version of car security system that can protect the
user’s car once the thief tries to steal it. This can be implemented using the
combination of photon and car alarm working in synchronization with a Webhook
that connects the photon with Twilio. The photon is installed with the alarm to get
signals from sensors (i.e. motion sensor). Once the signals are generated, the photon
publishes an event and this will trigger the Webhook that acts as a mediator between
photon and Twilio.
In the same time, the signal that received will activate the noise making device such
as siren and flashing light.

1.2 Motivation
The tremindous growth in information technology and internet have effected seviral
aspects in our live whether it bad or good. Due to this evolution, in these days there is
a high level of information theft, espionage and theft of property. Therefore, it
becomes necessary to develop the safety and protection methods. Based on this fact,
we aim to improve the car security system by adding some characteristics to the car
alarm to be able to communicate with car’s owner by using IOT technology to
achieve more security.

3
1.3 Contribution

We used the integration of photon with Twilio API to achieve the main purpose of our
project and this is what makes our project distinctive compared to other projects that used
GSM to send messages. We simply used the idea of sending and receiving messages
through the internet.

1.4 Literature Review


As the car security system is a very important system there is many inventions in this
area. As long as the time passes, we have a lot of improvements in this system every
day. An early version of a car alarm for use as a theft deterrent was invented by an
unknown prisoner from Denver in 1913[2]. This version was manually armed and
triggered when someone tried to crank the engine. A later alarm inspired by an early
version of a remote starter was published in 1916[3]. This version had the car owner
carry a receiver, which would buzz if the car`s ignition system was tampered with.
Another invention in this topic, invented by Robert F. Ayers, he invented a security
and alarm system for cars includes a receiving and transmitter units. The transmitter
unit broadcasts a continuous radio frequency signal received by the receiver unit. The
transmitter includes a cadmium sulfide photocell sensor responsive to access into the
car which will turn the transmitter off and activate a local alarm. The receiver unit
constantly monitors the transmitter signal and will activate an alarm if the transmitted
signal is not present for any reason. [4] After that, many of works have done to
improve security system in the car. In 2012 Visa M. Ibrahim and Asogwa A. Victor
have developed a microcontroller based anti-theft security system using GSM
networks with text message as feedback. In their work, they use the GSM, mobile
phone and electronics circuit. It secures the car against theft where it automatically
demobilizes the car by disconnecting the ignition key supply from the car battery. The
system sends text message to the car owner and at the same time starts up an alarm.
Their purpose of this study is to aid a better security system of cars with the use of
GSM. [5]

1.5 The Remaining of this Report


The rest of project is organized as follows: Chapter 2 has discussed the details of
theoretical background. Chapter 3 has discussed the methodology and hardware, testing,
verification, and Results are discussed in Chapter 4. The concluded with future work in
Chapter 5.

4
CHAPTER TWO

Theoretical
Background

5
Chapter 2

Theoretical Background
In this chapter we will introduce the principle and the idea that our project based on and
explain the component in details.

2.1 Idea and principle


Our project is based on IoT idea where the sensors blend with the environment around us
and make things exchange information without human intervention. This idea facilitated
and helped in many areas in our life.

The term “IoT” refers to the network of physical objects that contain embedded
technology to communicate and sense or interact with the external environment. [1] This
network allows the objects to collect data and stream it online to be gathered and parsed
by certain applications. Because of the enormous amount of data generated by the IOT it
is become important to integrate it with cloud computing to create more usefulness from
the data generated by IoT's and develop smart applications for the users. This IoT and
cloud computing integration is referred to as Cloud of Things. [6]

Connecting the device with the internet and cloud is not enough to build a useful project!
The device must publish to or get the data from a certain application or trigger a service
or a third party API to do something useful and here where the Webhook plays an
essential role.
A Webhook is an HTTP request that occurs when something happens; a simple event-
notification via HTTP. [7]

Webhooks are a simple and flexible way to send data from your devices to other apps and
services around the Internet. Where it bridges the gap between the physical and the
digital world, helping you get your data where you need it to be. [8]

Webhooks can be used to push and/or pipe data. With pushing data no more polling every
couple of minutes needed to find out if there is new information. The Webhook will get
the data at your doorstep as soon as it exists. It's less work, less hassle, and you'll
probably even receive it sooner than if you were asking for it every couple of minutes.
Also piping the data happens when your Webhook not only receives real-time data, but
goes on to do something new and meaningful with it and triggering actions unrelated to
the original event. [7]

Through the Webhook, your device can exchange data with APIs to accomplish lot of
interesting things. You could use a Webhook to save valuable information in a database,
visualize data being read from a sensor, send the latest weather report to your device,
trigger a payment, send a text message, and so much more! [8]

API stands for Application Programming Interface where is a set of routines, protocols,
and tools for building software applications.[9] It acts as an interface between two
different applications so that they can communicate with each other.[01] there are a lot of
APIs that allow you to do some fancy things like sending SMS or make voice calls. For
example with Twilio API you can send SMS, MMS, and make voice calls. [11]

2.2 System components


 Car alarm: Car alarm system is divided into three subsystems; control
subsystem, horn subsystem and sensor sector. Each subsystem can be
representing with one component; a control
unit for control subsystem, at least one type
of sensors for sensor sector and at least one
type of noise-making devices such as siren
for the horn subsystem. From another
respect the alarm system can be partitioned
into three categories; deterrent, immobilizer
and trackers. The deterrents warning or
scaring thieves by making noise or turn-on
Figure 1: car alarm [13]
lights. Immobilizers make it difficult to move a
stolen vehicle, where the trackers make it easy
to find vehicles after it have been stolen. Car alarms have a simple structure,
but they can be complicated in practice where most of them have a radio
receiver constructed with controller to receive signals from sensors in addition
to that many types of sensors and noise-making devices can be used. Sensors
are connected to several parts of the car and they tripped whenever a thief tries
to steal the car. When one of the sensors is triggered, a signal sent to control
unit which is activates the siren or flashing light and scares the thief. As we
mentioned above about the categories of alarm system, we used alarm system
partitioned into deterrent category which is deterrent warning or scaring

7
thieves by making noise or turn-on lights. And there are many types of sensors
some of these types will be discussed below.

Types of sensors:

 Door sensors: this type is simply a switch that installed to car's


doors. When the door is opened, switches sent a signal to control
unit to activate the alarm.[12]
 Movement or motion sensors: this type sends a signal to control
unit when the car is jostled in any way. There many variations of
this type such as mercury sensor which is simply an electrical
switch that opens and closes a circuit when a small amount of the
liquid mercury connects metal electrodes.[12]

Figure 2: mercury sensor

 Microphone sensors: this type detects very low sound level which
allows the control unit to obsarve any irregular sound like breaking
glass wich means a thift in process.
 Shock sensors: Advanced alarm systems depend on shock sensors.
The idea of a shock sensor is if somebody hits your car, the sensor
sends a signal to the microcontroller where it sends a signal to a
horn.

Figure 3: shock sensor [14]


8
In order to effectively stop the theft, the alarm should be able to warn anyone in the
area that is a theft in progress. To achieve that, most cars alarms systems be attached
to one or more of noise-making devices such as siren.
 Siren:
The main purpose of using the sirens is to drive attention to
the stolen vehicle. When it is activated, they will be loud
enough to make it difficult and unpleasant to drive a car
that makes such sound.
The volume of sirens varies from one system to another but
they all work in same principle.

Figure 4: sirens [15]

Some cars alarms response in different way where it uses the existing vehicle
systems such as honking the horn. Sometime the ignition system can be connected
with the car alarm where it becomes difficult to start the
engine of a stolen car.

Finally the most part in the alarm system is the control


subsystem that makes all work. This subsystem includes a
control unit that processes the signals from sensors. Also it
contain a transmitter that arm and disarm the system and a
receiver that provide the control unit with the information
coming from the sensors.
Figure 5: car alarm circuit board [16]

9
 Photon: This device consists of microcontroller on
board, this microcontroller is small, low cost and low
power can just run a single application. This
microcontroller has a set of pins, these pins can be
hooked to sensors or buttons or to light and motors to
listen and act upon the world. These pins have been
directly connected to the headers on the sides of photon,
so we can access them easily. [8]
The photon has two sides where the pins on these sides
labeled by D0 to D7 and A0 to A7, it can also
communicate with other chips by using protocols like
UART, SPI, or wires so it becomes more powerful
device.

Figure 6: Photon microcontroller [8]

The last point about this great photon, that we can connect it with our local Wi-Fi
network, like the way that we connect our computers or smart phones, and it is
programmed to stay in connection to the internet by default. Once it connects to
the Wi-Fi or the internet, it establishes a connection to the particle cloud. [8]

Photon structure is small and has two main buttons, the rest and mode button. The
rest button puts the photon in a hard reset to restart the app that we have
downloaded on the photon. [8] The mode button makes three functions; the first
function is smart configure to connect the photon to Wi-Fi network. There are
steps to do this function and the led indicators let us know if everything is going
well or not. The second function is factory reset, where the photon is
reprogrammed with factory software. The last function is clear the photon
memory of Wi-Fi network.

10
CHAPTER THREE

Methodology

11
Chapter 3

Methodology

In this chapter, we will explain our work in detail and mention every step that we
followed. Also we well talk about the tools and components that were used. We divided
our work to two parts; hardware connections and interface and software where we added
the needed integrations.

3.1 Hardware connections and interface


We started with our interesting photon by setting it up and connecting it with a Wi-Fi
network by following some simple steps. First of all we started by plugging the USB
cable into the computer.

In the next step we connected the photon with the Wi-Fi network through the
smartphone vie particle application that is installed on the phone by creating an
account as appear in figure 8. After we logged in, figure 9 appeared. To add a new
device we pressed the “+” sign that appears at the right top in figure 9.

Figure 7: Particle
app

Figure 8 : log in screen Figure 9: beginning screen

12
Then we followed the instructions to connect to Wi-Fi; first we make sure that the LED
of the photon is blinking blue and that the smartphone is connected to internet then we
pressed on ready button, then we went to Wi-Fi setting in the smartphone and selected the
photon network as appear in figure 10. After that we connected the photon to the
available Wi-Fi network and gave it a name. Finally we got the screen in figure 11 that
indicate the setup process is completed. The first component now is ready to
programming, publish events and receive signals, either analog or digital.

Figure 10: selecting photon network Figure 11: complete setup process

After we completed the setup of the photon we started to know the alarm architecture and
how its component can be connect together. Using the catalog we recognized the wires
and the usage of each one; for example the red and black wires must be connected to the
power supply while the pink one must be connect to the siren and the orange wire must
be connected to break lamp.

Figure12: wire connection diagram

13
After we study the wire connection diagram we determine the wires that we need; the red
wire, black wire and the pink one. The pink wire is the wire that connects with the siren,
that is mean this wire hold the signal when the main unit have an abnormal event. That is
what we need, we connected this to the red wire of siren and took another wire from it
and connected it with the analog pin A0 in the photon. The red wire connected with the
positive polar in the power supply which support the alarm by 12V and the black wire is
connected with the negative polar. After that we connected the shock sensor to the main
unit.

Figure 13: hardware circuit diagram

Now we will explain the communication between these components and


the flow of operations; first of all the shock sensor will receive a signal
depending on its sensitivity which we used it at the medium level, the
signal will reaches the main unit where it sends a signal to the siren
through the pink wire at the same time this signal will reaches the photon at
pin A0. Once the signal reaches the photon it will publish an event to the
particle cloud and this will trigger the webhook integration which we will
talk about it in the next section.

Figure14: system
architecture
14
Figure 15: System flow chart

15
3.2 webhook and Twilio integrations
Now let’s take a look at the software, how we programmed the photon and added the
needed integrations. We used online particle IDE to write the code and program the
photon. After that we used particle console to add the webhook integration.

Figure 16: Particle IDE

Figure 17: Particle console

16
Before creating the webhook, we create a Twilio account to get SID, a secret key for
Twilio API and a phone number which can we send messages from it. In figure 18 our
Twilio account appears. By clicking on the “+” button we got a free number which
appears in the figure bellow.

Figure 18: Get a Twilio phone number

Back to particle console, we clicked on integration button then selected “add integration”
and chose “webhook”. The screen in figure 19 appeared we filled the fields with the
required data such as the name of the event and the URL that the webhook will go to
when the event is published, and then we determined the HTTP request method. In the
URL we must put our Twilio account SID which it appears in the home screen of Twilio
account.

Figure 19: webhook builder

17
In Advanced settings, we added the needed phone numbers and the body of message as
appears in figure 20. In figure 21 we filled the fields with our SID and the secret key of
Twilio API and then we pressed on “Create webhook” button.

Figure 20: advanced settings

Figure 21: HTTP Authentication

Now the code, the webhook file, Twilio account and hardware connection are ready to be
tested and verified, and we will talk about this in the next chapter.

18
CHAPTER FOUR

Testing,
Verification, and
Results
Chapter 4

Testing, Verification, and Results


In this chapter we will introduce our testing process.

4.1 Testing
In the testing process we tested each part of our project separately. We started to test the
alarm so we connected the main unit with 12V power supply as shown in figure 22, and
then tried to affect the shock sensor to make it generate a signal, the siren generate a
noise so the alarm is working properly.

Figure 22: alarm testing

20
After that, we tested the webhook integration if it can reaches the API through the given
URL by pressing the test button in the webhook screen in figure 23.

Figure 23: Webhook testing

According to the arrival of the message at the right bottom corner of the screen in figure
23, the Webhook integration is working properly.

Next we made sure that our country is included in permission region in Twilio account.
In figure 24 we can see the response for the test sms request send by twilio to Jordanian
phone.

Figure 24: Twilio testing and response sms

21
For the photon, we made sure that the LED is breathing cyan; this shows that the photon
is connected to the cloud successfully. Next we tested the integration of whole system.
We took a wire from the pink wire and connect it to pin A0 in the photon and provide
12V to the main unit and the siren as shown in figure 25 below. The siren generated a
sound, an event published and a message sent to the mobile phone as shown in figures
26and 27.

Figure 25: whole system testing

Figure 26: logs of event on cloud

Figure 27: messages on the phone


22
CHAPTER FIVE

Conclusions
&
Future Work

23
Chapter 5

Conclusions & Future Work

In this chapter we will conclude our work and provide suggestion about future work .

5.1 Conclusions
This project aims to improve the car alarm system, increase its security level, prevent and
control cases of theft. We achieved this by using the IoT technology. The implementation
is done using car alarm package, a photon that integrated with Webhook and Twilio API.
A shock sensor generated a signal that triggers the main unit of the alarm to activate the
siren at the same time; it triggers the photon to publish an event to particle cloud. The
Webhook listens to events in the cloud, once it gets an event it will connect to Twilio
API, where it sends an SMS to the car’s owner to draw his attention that there is
something happened to his car. Finally we designed, implement and test our project, and
everything was successful.

5.2 Future Work


The availability of the internet that the photon needs, affects our project, so this issue can
be solved by adding new features to the system, like adding a tracking module. With this
addition, we increase the security and efficiency. The tracking module can be integrated
with our system to track the stolen car when there is no internet network coverage.

24
References
[1] O. Vermesan, P.Friess, Internet of things applications - from research and innovation
to market deployment.River Publishers, 2014.

[2] Prisoner Devises Stolen Automobile Alarm". Popular Mechanics. Hearst


Magazines: 509. April 1913. ISSN 0032-4558.Retrieved 26 March 2013.

[3]"New Automobile Alarm Calls for Help". Popular Science. Bonnier Corporation: 753.
May 1916. ISSN 0161-7370.Retrieved 26 March 2013.

[4] US4924206A - Car security system and method - Google Patents",


Patents.google.com, 2018. [Online]. Available:
https://patents.google.com/patent/US4924206. [Accessed: 04- Mar- 2018].

[5] Visa M. Ibrahim, Asogwa A. Victor “Microcontroller Based Anti-theft Security


System Using GSM Networks with Text Message as Feedback “vol. 2, no.10, pp. 18-22,
2012.

[6] M. Aazam, I. Khan, A. Alsaffar and E. Huh, "Cloud of Things: Integrating Internet of
Things and cloud computing and the issues involved", in Cloud of Things: Integrating
Internet of Things and cloud computing and the issues involved, Islamabad, Pakistan,
2014.

[7] “Web Hooks / FrontPage", Webhooks.pbworks.com, 2018. [Online]. Available:


https://webhooks.pbworks.com/w/page/13385124/FrontPage. [Accessed: 04- Mar- 2018].

[8] "Particle ", Docs.particle.io, 2018. [Online]. Available:


https://docs.particle.io/guide/tools-and-features/webhooks/. [Accessed: 04- Mar- 2018].

[9] Application Programming Interface (API) | Vector Software. [online] Available at:
http://bit.ly/2I3Js5E [Accessed 4 Mar. 2018].

[10] Difference between API Vs. Web Services.. [online] Available at:
http://bit.ly/2FRimxQ [Accessed 4 Mar. 2018].

[11] Twilio Docs REST API. [online] Available at: https://www.twilio.com/docs/api/rest


[Accessed 4 Mar. 2018].

[12] "How Do Car Alarms Work?", Lifewire, 2018. [Online]. Available:


https://www.lifewire.com/how-do-car-alarms-work-534875. [Accessed: 12- Jul- 2017].

[13] " car alarm vehicle system protective security system" . [online] Available at:
https://www.dhgate.com/product/hot-universal-ha-100a-1-way-car-alarm-
vehicle/270035721.html. [Accessed: 3- April- 2012].

25
[14] "shock sensor add on kits for sale" . [online] Available at:

http://www.addshocksensor.com/contact-us.html.[Accessed: Feb-2012]

[15] "Car Alarm Vehicle System Protective Security System" . [online] Available at:
https://www.dhgate.com/product/hot-universal-ha-100a-1-way-car-alarm-
vehicle/270035721.html.[ Accessed: 7-Nov-2014]

[16] "Car Alarm System Pcb Board ,Car Alarm System Product on Alibaba " .[online]
Available at: https://www.alibaba.com/product-detail/car-alarm-system-pcb-board-
for_1877843144.html. [Accessed:15-Mar-2012]

26

Вам также может понравиться