Академический Документы
Профессиональный Документы
Культура Документы
Student(s) Name(s)
Supervisor Name
Prof.Hussein Alzoubi
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
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.
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.
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]
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:
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
Conclusions
&
Future Work
23
Chapter 5
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.
24
References
[1] O. Vermesan, P.Friess, Internet of things applications - from research and innovation
to market deployment.River Publishers, 2014.
[3]"New Automobile Alarm Calls for Help". Popular Science. Bonnier Corporation: 753.
May 1916. ISSN 0161-7370.Retrieved 26 March 2013.
[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.
[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].
[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