SlideShare a Scribd company logo
1 of 66
Download to read offline
1
Electrical Engineering Department
Faculty of Engineering and Technology
The University of Jordan, Amman-Jordan
AUTOMATED CAR PARKING SYSTEM
By
Saeed Mohammed Mustafa (0115258)
Ibraheem Bilal Abu Arja (0115309)
Ahmad Saeed Odetallah (0110714)
Osama Ali Sabri (0114881 )
Supervised by
Dr. Mohammad Hawa
Submitted in partial fulfillment of the requirements of B.Sc. Degree in Electrical
Engineering
December 2015
2
ABSTRACT:
The main objective of our project is to monitor a parking lot using a wireless sensor
network. We use several sensor nodes interconnected to a single sink node. Our sensor
nodes are equipped with ultrasonic sensors and are deployed in the center of the parking
space. The sensor nodes send information to the sink node periodically if its sensor
reading differs from previous value. The sink node is then connected to a gateway (PC in
our case) then uploaded to a server. The server then decides whether or not the parking
space is occupied. Upon receiving the data from the gateway, an administrator will map
the parking lot and send the data using TCP/IP to a smart phone application. Users will
then be able to retrieve the status of the parking lot through their phones viewed through
an application.
3
TABLE OF CONTENTS
1 INTRODUCTION .......................................................................................................6
2 SENSOR NODE SPECIFICATIONS
2.1 Sensors ……………………………………………………………………….……. 9
2.1.1 Image Sensors …………………………………………………………………..9
2.1.2 IR Sensors …………………………………………………………………..…10
2.1.3 Ultrasonic Sensors ………………………………………………………….…11
2.1.4 3 Axis AMR Sensors ………………………………………………………….12
2.2 Microcontroller …………………………………………………………………...13
2.2.1 Choosing The Right MCU………………………………………………….… 13
2.2.2 Types Of Microcontrollers…………………………………………………..…14
2.3 The Communication Link…………………………………………………………15
2.3.1 Bluetooth…………………………………………………………………….…16
2.3.2 ZigBee …………………………………………………………………………17
2.3.3 Infrared………………………………………………………………………....18
2.3.4 ASK/OOK……………………………………………………………………...18
3 DESIGN AND CONSTRUCTION
3.1 System Architecture……………………………………………………...…….…20
3.2 Nodes Operation………………………………………………………………...…22
3.2.1 Sensor Node Schematic……………………………………………………..….24
3.2.2 Sink Node Schematic……………………………………………………….......25
4 THE NETWORK PROTOCOL
4.1 Specifications of TX/RX………………………………….…………………...…26
4.2 Network Operation……………………………………………………………....26
4.3 Communication Between The Nodes………………………………………...…29
4.3.1 The Sensor Node…………………………………………………………...….30
4
4.3.2 The Sink Node…………………………………………………………………31
4.4 Code Specifications………………………………………………………………32
4.4.1 Libraries………………………………………………………………..………32
4.4.2 Fragmentation of The Packets…………………………………………………..34
5 THE SERVER
5.1 What Program to Choose?......................................................................................35
5.1.1 Oracle………………………………………………………………………..…..35
5.1.2 SQL Server……………………………………………………………………....35
5.1.3 Visual Studio………………………………………………………………….....36
5.1.4 MySQL………………………………………………………………………….38
5.2 How The Server Works…………………………………………………………...39
5.2.1 The Database…………………………………………………………………....39
5.2.2 The User Interface……………………………………………………………….41
5.2.3 Client Connections………………………………………………………………46
6 THE CLIENT
6.1 What Operating System to Choose………………………………………………48
6.1.1 iOS……………………………………………………………………………...48
6.1.2 Microsoft Mobile…………………………………………………………….…49
6.1.3 Android Operating System…………………………………………………...…49
6.2 How The Client Works……………………………………………………….…...50
6.2.1 The User Interface……………………………………………………………….50
6.3 Server Connections………………………………………………………………..53
7 FUTURE WORK
7.1 Sensor and Sink Node Enhancements……………………………………………59
7.1.1 Using 3 Axis AMR sensors………………………………………………...…..59
7.1.2 Battery Life Parameter……………………………………………………...…..59
7.1.3 External Antenna…………………………………………………………...…..59
5
7.1.4 Ad-Hoc Network……………………………………………………………..…59
7.1.5 Photovoltaic Cell……………………………………………………………..…60
7.2 Server Enhancements…………………………………………………………..…60
7.2.1 Upgrading The Database………………………………………………………..60
7.2.2 Administrator Monitoring………………………………………………………60
7.2.3 Using SSH Protocol With TCP/IP……………………………………………...60
7.3 Client Enhancements……………………………………………………………...61
7.3.1 Using the GPS device…………………………………………………………..61
7.3.2 Developing Client application for different operating systems……………...…61
7.3.3 Adding Reservation Option………………………………………………….....61
8 FINANCIAL STUDY…………………………...………………………62
9 REVIEW AND DISCUSSION……………………………………..…..63
REFERENCES……………………………………………………………64
6
CHAPTER ONE: INTRODUCTION
Due to a large increase of vehicles nowadays, most drivers find a difficulty in
finding a free parking space in malls, universities, large building,etc.
This encouraged us to develop an automated parking system that provides the drivers
with the status of the parking lot through a smart phone. Several cities such as Dubai
have already built an intelligent parking system. Dubai mall provides drivers with
information about free parking spaces through large monitors installed within the parking
lot as shown in Fig.1.1.
However, the parking lot could be large such as that of Dubai mall; drivers would need to
enter one of the several parking entrances to view the monitor. The area where the
monitor is installed might be fully occupied and drivers would need to drive further
within the parking lot. This causes traffic and it is inconvenient for large parking lots.
Therefore, using an android application to be provided with the status of the parking lot
before entering helps the drivers drive towards the entrance where available parking
spaces are found.
Figure 1.1 Parking System Of Dubai Mall [1]
7
Nowadays, wireless sensor networks (WSN) are used in many application areas.
Due to the extremely low power consumed by the sensor nodes, WSN is useful in many
applications including monitoring physical changes such as sound, pressure, presence of
an obstacle, temperature, etc. WSN applications usually run by a batter power, therefore
is used where AC electricity is not found.
Fig 1.2 Simplified Block Diagram of Project
Sensor Node
Sink Node
PC/Server
Android Application
Sensor NodeSensor Node
8
In chapter two we will study the hardware choices used to build our project
together. We will briefly explain the operation, power consumption, cost, and
disadvantages of each component separately.
In chapter three we will build our system based on the studies we concluded on
chapter two. Here we design and interconnect our components building the sensor
and sink nodes.
Chapter four mainly discusses the protocols used in designing the communication
links. Here we will discuss the methods used in collision detection and error
correction of the transceiver. Also the specifications of the module used are
explained such as the data rate, operating frequency, and duty cycle.
Chapter five will discuss the server in details including what programs chosen to
use for the database and user interface, how the database is built, how the interface
is constructed, and the protocol used to communicate between the client and server
and how to receive from the sink node.
Chapter six will discuss the client in details including what operating system
chosen to use and why that choice was made, and the interface for the android
application, how the code is built for communication with the server.
In chapter seven we will talk about our plans in the future and what we will
improve in the components of our system to make it more advanced and what
features must be added to the system.
In chapter eight we will make a study on University Of Jordan’s parking lots and
how we can implement our project on it. We will talk about the financial and
technical advantages it might offer the university.
9
CHAPTER TWO: SENSOR NODE SPECIFICATIONS
Wireless sensor networks are built up using many different components depending
on many factors such as the speed of operation, the type of objects to be detected,
power consumption, and distance between interconnected nodes.
The architecture of each WSN contains a sensor, a MCU, a battery, and a
transciever as shown in fig 2.1.
We will study each component seperately to make a solid decision on which
hardware is suitable for our project.
Fig 2.1 Sensor node block diagram
2.1 Sensors
Several different sensors could be used to detect the presence of a vehicle. In our project,
the precision of detection as well as power consumption is important. Therefore, we must
choose the correct hardware that provides both specifications.
2.1.1 Image sensors:
Image sensors provide excellent information for recognizing vehicles by images.
CCD sensors work by transferring the charge from one pixel to another until they end up
at the periphery, and are then converted into a voltage to be read out. The charge transfer
is accomplished by applying voltages that form wells of different potentials, so the
10
charges transfer completely from one pixel to the next. Charges typically are shifted
downward to the end of a column, then rightward to the end of a row, where the readout
circuitry is present. The charge to voltage conversion then takes place, since voltage
output is proportional to the charge over the capacitance. [2]
The problem we might face is that it might fail when there isn’t enough ambient light.
Also image sensors require a lot of computation which imposes heavy burden on the
sensor nodes and require large amount of memory.
Figure 2.2 CCD image sensor [3]
2.1.2 IR sensors
The basic idea of IR sensors is sending and infrared light through IR-LEDS, this emitted
light is then reflected back when it hits an object in front of the sensor. The picked up
light is then converted to a voltage to be read using electronic circuits.
Although infrared is cheap ($10 -$20) its narrow beam is not good in measuring distance
to dark objects. Infrared sensors emit infrared light, and therefore the sensors cannot
work accurately outside or even inside if there is direct or indirect sunlight. In outdoor
parking lots it is inefficient to use IR sensors.
11
Figure 2.3 IR sensor [4]
2.1.3 Ultrasonic sensors
Active ultrasonic sensors generate high-frequency sound waves and evaluate the echo
which is received back by the sensor, measuring the time interval between sending the
signal and receiving the echo to determine the distance to an object.
Ultrasonic sensors use sound instead of light for ranging, so ultrasonic sensors (some
people call it sonar) can be used outside in bright sunlight. These sensors are amazingly
accurate, though they may be thrown off by a sound absorbing obstacle, like a sponge.
The only real issue that arises is the "ghost echo" issue. As you can see below, the walls
bounce off in a strange pattern causing a ghost effect. [5]
Figure 2.4 Ultrasonic Sensor
12
2.1.4 3-axis AMR sensor:
The magnetoresistive effect was first described by William Thompson, Lord Kelvin, in
1856. These devices are widely used today for position detection in high-density read
heads for tape and hard-disk drives, sensing vehicular wheel speed and crankshaft
position, and measuring linear and angular position and displacement in the Earth's
magnetic field. Their low cost, high sensitivity, small size, noise immunity, and reliability
give them an advantage over mechanical or other electrical alternatives. Highly adaptable
and easily assembled, AMR sensors are solving a variety of problems in custom
applications. [6]
Since vehicles are usually made of metals, they disturb the magnetic field of surrounding
areas, and therefore magnetic sensors are a good candidate for detecting vehicles.
It is a passive sensor therefore has very low power consumption.
Figure 2.5 3-Axis AMR sensor [6]
13
2.2 Microcontroller
The microcontroller is required to store and control the transmission of the data read by
the sensor. It performs computations and comparisons needed to provide a sufficient
transfer of data. There are a large number of different types of microcontrollers, although
most of them have a lot in common; our decision should be suitable with the operation of
our application.
2.2.1 Choosing the right MCU
There are some considerations that should be kept in mind when choosing the correct
MCU for any application. The main criteria of choice should be regarding some factors
and features listed below.
1. Memory size: It is important to have a sufficient amount of memory when dealing
with monitoring applications. The more memory the MCU stores the better. When
dealing with larger parking lots it is important that we have enough memory to
store the temporary data stored by the sink node.
2. Maximum Frequency: Each MCU has an internal oscillator installed. In most
applications it is required that the duty cycle of the program flow is fast and
therefore higher frequency is needed. Frequency is an important factor in
monitoring applications since fast speed operation might affect the status seen by
the users.
3. Number of Pins: Usually what limits the components and hardware added to our
sensor node is the number of pins. The more pins the MCU has, the more features
we could add to our system.
14
2.2.2 Types of Microcontrollers
1. The Arduino Uno:
It is a microcontroller board based on the ATmega328P. The Arduino Uno has fourteen
digital input/output pins. It uses a 16 MHz crystal oscillator. Arduino is suitable in
networks needing to connect to a server since it has and a USB cable that can serially
transfer the data from the microcontroller to the PC. Also voltage can be fed to
interconnecting components by one of its pins.
2. The Raspberry Pi:
It operates at a frequency of 700 MHz. It has a storage memory 1 GB. It operates at a
power of 4 W. It has excellent specifications for systems that require high data rate and
complex computations.
3. The BeagleBone:
The beaglebone MCU is expensive. It runs at a frequency of 700 MHz. The main
advantage of this type of MCU is its large memory storage. Even in very large parking
lots 4GB is more than enough to store all information on the sensor nodes.
Fig 2.6 Arduino Uno, Raspberry Pi, and Beaglebone ordered from left to right [7]
15
Below is a table that contains the features and specifications that compare all three types
of microcontroller.
Table 2.1 MCU Comparison [7]
2.3 The Communication Link
In wireless sensor networks, there must be a connection or link between the sensor nodes
and the sink node. Although using actual wires for connection provides more security and
no interference between the nodes, it is far more expensive since we need underground
wiring. That is why in WSN wireless communication is used.
The sensor node mainly loses all its power through the transmission process. That is why
we need to choose a low power wireless technology that provides the appropriate data
rate with an acceptable range.
16
Below are some wireless technologies used in WSN; we will chose the link based on our
system requirements.
2.3.1 Bluetooth
Bluetooth is an industrial specification for wireless personal area networks (PANs), also
known as IEEE 802.15. Bluetooth provides a way to connect and exchange information
between devices. It is a radio standard and communications protocol primarily designed
for low power consumption, with a short range.[8]
Bluetooth exchanges data at frequencies varying from 2.4 to 2.485 GHz.
This high frequency limits the range of connecting nodes. The main advantage of the
Bluetooth technology is its low price and low power consumption.
The problem we may face in our project when using bluetooth is that it is used in many
applications such as phones, laptops, and many other portable devices. This may increase
the risk of interference and collision.
Fig 2.7 A Bluetooth Network [8]
17
2.3.2 ZigBee
The ZigBee stack architecture includes a number of layered components including
the IEEE 802.15.4 2003 Medium Access Control (MAC) layer and Physical (PHY) layer
and well as the ZigBee Network (NWK) layer. Each of these provides applications with
its own set of services and capabilities. [9]
The ZigBee Alliance is developing very low-cost, very low power consumption, two-
way, wireless communications standard. Solutions adopting the ZigBee standard will be
embedded in consumer electronics, home and building automation, industrial controls,
PC peripherals, medical sensor applications, toys and games.
ZigBee (IEEE 802.15.4) are mainly used in personal area networks. The main
advantage of ZigBee technology is its capability of interconnecting a large number of
nodes in a single network. Its very low power limits the range to a maximum of 100
meters. Also it operates at low data speed which is inefficient in time sensitive
applications.
Fig 2.8 ZigBee Network [10]
18
2.3.3 Infrared
IR, or infrared, communication is a common, inexpensive, and easy to use wireless
communication technology. IR light is very similar to visible light, except that it has a
slightly longer wavelength.
A common modulation scheme for IR communication is something called 38kHz
modulation. There are very few natural sources that have the regularity of a 38 kHz
signal, so an IR transmitter sending data at that frequency would stand out among the
ambient IR. 38 kHz modulated IR data is the most common, but other frequencies can be
used. [11]
IR transmission occurs at line of sight and any obstacle that cuts through the connection
will highly attenuate or even block our transmission. This makes IR a bad choice in
parking lots since it is crowded with vehicles entering and leaving; this will cut off our
signal.
Fig 2.9 IR Transceiver [11]
2.3.4 ASK/OOK
Amplitude shift keying (ASK) is a type of digital modulation that varies the transmitted
digital signal according to a carrier signal’s amplitude. A special type of ASK used in
many communication systems is the ON-OFF Keying (OOK). If the amplitude of the
digital signal to be sent overcomes a certain threshold value it will transmit the carrier
signal as a voltage ‘1’, otherwise zero voltage is sent.
19
Wireless Transmitter Modules allow your Arduino to wirelessly communicate with other
Arduinos, or with radio frequency (RF) controlled devices that operate in the same
frequency. [12]
Here we will study the ‘’Module MX-05V’’ module. It operates at a frequency of 433
Mhz. This intermediate frequency allows transmission at long ranges around 200 meters.
It has a low data rate which is suitable in our case since not much information is to be
exchanged between the sensor and sink nodes. It has a low transmission power of 10mW.
Fig 2.10 Module MX-05V [12]
20
CHAPTER THREE: DESIGN AND CONSTRUCTION
3.1 System Architecture
Upon studying the hardware and technologies provided in the previous chapter, we set up
a table pointing out the hardware modules connected together to form our WSN.
Each of our choices depended on three important factors: the price, the power
consumption, and the efficiency in working in several environments.
The table shown below shows the specifications of the sensor and sinks nodes used in
this application.
Table 3.1 Specifications of our hardware
Microcontroller Arduino UNO R3
Sensor Ultrasonic sensor (HC-SR04)
RF Transceiver Module MX-05V
Frequency 433 MHz
Data Rate 2 kbps
Antenna Internal or external (optional)
Battery 9 V cell
21
Our parking automation system is composed of multiple sensor nodes, a sink node, a
gateway, and a server. The connection forms a star-shaped network connecting the sensor
nodes to the sink node. The sink node is serially connected to a PC (gateway) via USB
interface and the data is then delivered to the server through the gateway.
This is shown Fig.3.1.
The server determines which parking space is available based on the received information
and provides the availability information for drivers by sending the data to the android
application which can be viewed by the users.
Figure 3.1 Star-shaped network of our communication link
22
3.2 Nodes Operation
Each sensor node has an ultrasonic sensor connected to the microcontroller (Arduino
UNO) as shown in Fig.3.2.
The sensor outputs show significant differences when the parking spot is occupied and
not. The presence of a motor vehicle in a parking spot, therefore, can be detected based
upon changes in the output of the sensor mounted on the sensor node deployed in the
parking spot.
Figure 3.2 Ultrasonic sensor connected to the Arduino board [13]
Each sensor node determines the status of a parking space regardless of the type of sensor
used. The sensor node should read the sensor data at a high rate to tell whether a car is
entering or leaving the parking space.
It is known that high sampling rates causes higher power consumption by the node. A
good solution to this is to only send data when the current reading differs from the
previous one which indicates that the status of the parking space has been changed.
23
Each parking space has a sensor node equipped with an ultrasonic sensor placed
in its center. The sensor nodes are powered by batteries.
The sensor node in a parking space measures the values of the ultrasonic sensor
periodically and wirelessly transmits the sensor values only when they show abrupt
variations. A server receives the data from all sensor nodes via a sink node and a gateway
and determines whether each parking space is occupied based on the received sensor
values and reference values maintained by the server. This approach results in a low duty
cycle of sensor nodes by decreasing computations performed by the sensor nodes and in
turn longer battery life of the sensor nodes.
The sensor node remains in sleep mode during most of the operation time to
conserve battery power and wakes up at a predetermined time interval to read the
ultrasonic sensor data.
Since the parking lot status is not frequently changed, we could set the wake up
time of the node up to a few seconds. We let the ultrasonic take multiple readings and
order them as ascending values and then take the median value as our reading.
We define an integer value to temporary store our reading. Then the median value is
transmitted to the sink node to be compared to a certain threshold by the server to
determine whether the parking space is occupied or not. After wake up, if the occupancy
status of the parking spot remains unchanged, the sensor node does not observe
meaningful changes in the sensor data and as a result does not transmit any data. In other
words, RF transmission, which consumes the most power in the sensor node, occurs only
when noticeable changes in the sensor outputs are detected, and therefore battery life can
be extended.
The server is the destination of all the information transmitted by the sensor
nodes. Though each of the sensor nodes reads the sensor values indicative of the
occupancy status of a related parking space, it does not know whether or not the space is
actually taken.
24
A sensor node simply compares two consecutive sensor data and transmits it the server
when there are changes exceeding the threshold value. It is the sink node that determines
whether or not the corresponding parking space is occupied based upon the measured
data from the sensor node and the initial median values of the ultrasonic sensor, thereby
reducing the computational burden of the sensor nodes.
The server manages the occupancy status of all areas of the parking lot and provides
drivers with the status information. The status information may be provided by tracing
the map drawn by the server and uploaded to the android application to be viewed by the
users.
3.2.1 Sensor Node Schematic
25
3.2.2 Sink Node Schematic
26
CHAPTER FOUR: THE NETWORK PROTOCOL
4.1 Specifications of TX/RX
In determining the communication range and data rate, the RF frequency plays a major
role in a wireless sensor network. In older systems high frequencies was used such as the
2.4 GHZ band. This allows high data rates but in return have a shorter transmission
range. In our project, the data size transmitted by the sensor node is small. We can use
low data transmission frequency because we only transmit when the microcontroller
detects changes in the sensor readings.
This is mainly the reason why we chose to use the MX-05V (RF transceiver) which uses
a frequency of 433 MHz. This module provides a data rate of 4 kbps which is more than
enough to transmit the required data. This frequency also allows us to transmit at a high
range. This makes it possible to cover up the entire parking lot and makes AD-HOC
connections unnecessary in small or medium parking lots.
4.2 Network Operation
We set the sleep time of each sensor node to around 20 seconds which is convenient since
it takes more time for a car to enter and leave the parking space. After wake up, the
sensor node enables it transmission and reads the sensor readings. It compares the current
value to the previous reading. If the readings show no abrupt changes the sensor node
enters sleep mode again since it is unnecessary to send information which is already
stored in the sink node.
If the readings differ (which indicates a change in the parking space status) the
sensor data is transmitted to the sink node along with its ID. The ID value of each sensor
node is important for the sink node to distinguish between the nodes.
We add a certain time delay to ensure that data has been fully transmitted.
27
After transmission is completed, we enable the receiving mode of the sensor node to be
able to receive an acknowledgement from the sink node. The sink node must send an
acknowledgement to the transmitting node to ensure that the data has been sent.
Since the nodes send using the same frequency band there is a chance collision might
occur. To detect collision we used the binary exponential backoff algorithm.
After ‘n’ collisions, each station waits (back off) for a random number of slots chosen
uniformly between 0 and 2n-12n-1: For the first collision, each sender will wait 0 or 1
slot times. After the second collision, the senders will wait anywhere from 0 to 3 slot
times (inclusive). After the third collision, the senders will wait anywhere from 0 to 3 slot
times. After the third collision, the senders will wait uniformly from 0 to 7 slot times, and
so forth.
As the number of retransmission attempts increases, the contention window grows
exponentially.
This goes until ‘n’ reaches the value 16. Then we reset the value of ‘n’ to zero and the
operation goes on.
This is summarized in the flowchart in the following page.
28
Fig.4.1 Flow chart explaining the Binary back off algorithm
29
The sink node should always be set in receive mode and never put to sleep. The
sink node consumes far more power than any of the sensor nodes; therefore it must be
constantly connected to a power supply and not batteries. In our connection the sink node
is connected at the center of the parking lot to ensure reliability of transmission.
After sending the acknowledgement, the sink node serially sends the data to the PC via
USB interface and then is set to receiving mode again.
The decision upon whether or not the parking space is occupied is then decided by the
sink node and sent to the server to be mapped out and send to the application that can be
used by the users to retrieve the parking lot status.
4.3 Communication between the nodes
Here we will describe the protocol developed between the communication of the sensor
and sink nodes.
It is important to set a protocol that involves error and collision detection. This reduces
the risk of obtaining wrong status information or even the loss of the entire data.
Acknowledgements are also a must to ensure correct transmission and reception between
the nodes. In the following two sections we developed flowcharts explaining the coding
and protocols used in both the sensor and sink node.
30
4.3.1 The Sensor Node
Below is the flowchart explaining the protocol developed in the sensor node.
31
4.3.2 The Sink Node
Below is the flowchart developed for the protocol used in the sink node.
32
4.4 Code Specifications
Here we will discuss the libraries used while implementing our code. We will also talk
about the problems we faced while developing our code and how we came with solutions
that made our code work properly.
4.4.1 Libraries
We used two different types of libraries throughout conducting our code.
The first library we used was the virtualwire library. VirtualWire is an Arduino library
that provides features to send short messages, without addressing, retransmit or
acknowledgment, a bit like UDP over wireless, using ASK (amplitude shift keying).It
Supports a number of inexpensive radio transmitters and receivers. All that is required is
to transmit data, receive data and a PTT transmitter enable.
This library is compatible with all RF modules. It gives us complexity to choose which
data rate we transmit our data, but we should keep in mind that increasing the data rate
would decrease the range of transmission. The ASK receiver must be synchronized with
the transmitter through a preamble.
We can transmit messages up to 27 bytes. Each message is transmitted as a 36 bit training
preamble consisting of 0-1 bit pairs, a 12 bit start symbol 38H, a one byte type of
message length count (4-30), message bytes whose maximum reaches 27 bytes, and a two
byte FCS. [14]
The transmission and reception process uses the interrupt of Timer1. That is why
we avoided using this timer for other applications.
The FCS ‘checksum’ drops the packet if an error occurs during transmission.
The limitations of this library are that it only sends character types of messages. When we
needed to transmit an integer value we used to convert it to an array of characters, then
the value is retrieved at the receiver by reconverting the array of characters back to an
integer.
33
The second library we used is the ‘Lowpower’ library.
The lowpower library was mainly used to develop an extended time delay using the
watchdog timer to set the nodes to sleeping mode after transmission and reception of the
ACK.
The Arduino Uno contains four timers including timer0, timer1, timer2, and the
watchdog timer. Timer0 and timer 2 have maximum delay time in milliseconds. We must
use loops in order to increase the time delay to 20 seconds which causes large amount of
interrupts in a small interval of time; this may cause the Arduino to malfunction.
Timer1’s time delay reaches up to 4.1 seconds, but it is already reserved by the
virtualwire library. Therefore, we chose to use the watchdog timer whose pre-scale value
could reach up to 8 seconds. We used this timer twice by using the maximum value of
pre-scale to reach 16 seconds, then we used a lower pre-scale whose value is 4 seconds.
The 16 seconds added up with the 4 seconds gives us our required 20 seconds to keep the
nodes in sleeping mode.
This library supports all sleeping modes in the Arduino (Idle, ADC reduction mode,
power save, power down, standby, and extended standby).
The sleeping mode that we used was the power down type. The power down sleeping
mode guarantees to set the ADC and the brownout detector to sleeping mode which
consume the most power by the Arduino.
The limitations we faced using this library is that when entering sleeping mode it
pauses the program time of flow that is needed to determine the time needed to send an
alive message every 4-4.5 hours. As a solution to this, we defined a counter which is
incremented when the whole program overflows. Then we could determine the time it
took to flow throughout the program and during the sleeping mode; this computes the
time needed to send an alive message.
34
4.4.2 Fragmentation of the Packets
We used three different types of packets, the sensor data packet, the alive message, and
the acknowledgment message.
The sensor data packet consists of 13 bytes. The first byte is reserved for the packet type.
Bits 5 to 8 are reserved for the ID of the parking space, bits 8 to11 are reserved for the
sensor data reading and the last 4 bits are for the serial number of the packet.
The fragmentation of the sensor data packet is shown below.
1 4 4 4
The alive message sent also consists of 13 bytes. The fragmentation of this packet is
shown below.
1 4 4 4
The acknowledgment message sent from the sink node to the sensor nodes consist of only
8 bytes. The fragmentation of the packet is shown below.
ID of the parking space Serial Number of PKT
4 4
Packet type ID of parking space Sensor data Serial number of pkt
Packet type ID of parking space All ones Serial number of pkt
35
CHAPTER FIVE: THE SERVER
In this chapter we will discuss the role of the server.
We use the server for receiving data from the sink node and arranging that data into
groups of tables and studying that data to allow the administrator to have an overview of
the system, in addition to all that has the duty of sending that data to the client.
5.1 What program to choose?
Before talking about our choices of what program to use for the server we will talk
briefly about all the programs we studied about before making our choice.
For the sever we needed a program that can deal with data and make a database in
addition to that it should have an easy to deal with interface so that the administrator can
control the system , by considering these specifications we were left with the following to
choose from(Oracle, MYSQL, SQL Server, Visual Studio).
5.1.1 Oracle
An Oracle database is a collection of data treated as a unit. The purpose of a
database is to store and retrieve related information. A database server is the key to
solving the problems of information management. In general, a server reliably manages a
large amount of data in a multiuser environment so that many users can concurrently
access the same data. All this is accomplished while delivering high performance. A
database server also prevents unauthorized access and provides efficient solutions for
failure recovery.
Oracle Database is the first database designed for enterprise grid computing, the most
flexible and cost effective way to manage information and applications. Enterprise grid
computing creates large pools of industry-standard, modular storage and servers. With
this architecture, each new system can be rapidly provisioned from the pool of
components. There is no need for peak workloads, because capacity can be easily added
or reallocated from the resource pools as needed. [15]
5.1.2 SQL Server
SQL Server is a relational database management system (RDBMS) from Microsoft that's
designed for the enterprise environment. SQL Server runs on T-SQL (Transact -SQL), a
set of programming extensions from Sybase and Microsoft that add several features to
standard SQL, including transaction control, exception and error handling, row
processing, and declared variables.[16]
Due to the high price of the program and since our database is very small we considered
not using it.
36
Our choice was with using visual studio for the interface and MYSQL for the database
and linking them together.
5.1.3 Visual Studio
“Microsoft Visual Studio is an integrated development environment (IDE)
from Microsoft. It is used to develop computer programs for Microsoft Windows, as well
as web sites, web applications and web services. Visual Studio uses Microsoft software
development platforms such as Windows API, Windows Forms, Windows Presentation
Foundation, Windows Store and Microsoft Silverlight. It can produce both native
code and managed code.
Visual Studio includes a code editor supporting IntelliSense (the code
completion component) as well as code refactoring. The integrated debugger works both
as a source-level debugger and a machine-level debugger. Other built-in tools include a
forms designer for building GUI applications, web designer, class designer, and database
schema designer. It accepts plug-ins that enhance the functionality at almost every
level—including adding support for source-control systems (like Subversion) and adding
new toolsets like editors and visual designers for domain-specific languages or toolsets
for other aspects of the software development lifecycle (like the Team Foundation
Server client: Team Explorer).
Visual Studio supports different programming languages and allows the code editor and
debugger to support (to varying degrees) nearly any programming language, provided a
language-specific service exists. Built-in languages include C, C++
and C++/CLI (via Visual C++), VB.NET (via Visual Basic .NET), C# (via Visual C#),
and F# (as of Visual Studio 2010). Support for other languages such as M, Python,
and Ruby among others is available via language services installed separately. It also
supports XML/XSLT, HTML/XHTML, JavaScript and CSS. Java (and J#) were
supported in the past.
Before Visual Sudio 2015, Commercial versions of Visual Studio were available for free
to students via Microsoft's DreamSpark program, when only commercial versions
supported plugins. Starting with Visual Studio 2015, Microsoft provides "Community"
editions of its Visual Studio at no cost to any one, where Community edition supports
installing plugins.”[17]
37
We choose Visual Studio because it is easy to build, and can be linked to a lot of database
programs, in addition to that is has a lot of variety in choosing what language you want to
program with including : C++, C# ,visual basic ,java, Python.
Before saying why we choose C# we will talk briefly about it
“C# syntax is highly expressive, yet it is also simple and easy to learn. The curly-brace
syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java.
Developers who know any of these languages are typically able to begin to work
productively in C# within a very short time. C# syntax simplifies many of the
complexities of C++ and provides powerful features such as nullable value types,
enumerations, delegates, lambda expressions and direct memory access, which are not
found in Java. C# supports generic methods and types, which provide increased type
safety and performance, and iterators, which enable implementers of collection classes to
define custom iteration behaviors that are simple to use by client code. Language-
Integrated Query (LINQ) expressions make the strongly-typed query a first-class
language construct.
As an object-oriented language, C# supports the concepts of encapsulation, inheritance,
and polymorphism. All variables and methods, including the Main method, the
application's entry point, are encapsulated within class definitions. A class may inherit
directly from one parent class, but it may implement any number of interfaces. Methods
that override virtual methods in a parent class require the override keyword as a way to
avoid accidental redefinition. In C#, a struck is like a lightweight class; it is a stack-
allocated type that can implement interfaces but does not support inheritance.”[18]
We choose C# as a language to program because it is easy to learn and professional
language to use.
To learn C# we watched the following tutorial[19]
38
Fig 5.3 Visual Studio program
5.1.4 MySQL
MySQL, the most popular Open Source SQL database management system, is developed,
distributed, and supported by Oracle Corporation. MySQL Server was originally
developed to handle large databases much faster than existing solutions and has been
successfully used in highly demanding production environments for several years.
Although under constant development, MySQL Server today offers a rich and useful set
of functions. Its connectivity, speed, and security make MySQL Server highly suited for
accessing databases on the Internet. [20]
MySQL deals with database in simple easy to use tools, and can be easily linked with
visual studio, and is an open source program for the previous reasons we choose it for
database.
Screenshot Of MySQL Connection
39
5.2 How the server works
The server’s objective is to have a database stored in it all the information the user
or administrator needs, also it must be able to receive from the sink node updated
information about the parking spots, after collecting all data needed it connects to the
client and sends information about parking spots using a connecting protocol which we
will talk about later.
Studying all these duties for the server we divided this section into four parts:
(The Database, The user interface, Client connections, Sink node connections).
In our project we took the University of Jordan as an example for our parking
system.
5.2.1 The Database
To have all information ready for the user to view or edit we created a database
using MYSQL having the following tables: (Buildings, Floors, Users, and Parking
Spots).
Figure 5.6 Users Table
The Users table has all the information about users that can access the information and
including: (Username, Password, and Email).
This table is very important and will be used in both client connection and user interface
as we will explain in the next two sections.
In the University of Jordan there are 4 parking areas: (East Parking Consisting of
one floor and 100 Parking Spots, North Parking Consisting of one floor and 100
Parking Spots, South Parking Consisting of one floor and 100 Parking Spots, West
Parking Consisting of two floor and 160 Parking Spots).
40
In our database the second table is for the buildings, in that table you can
find information for the location of that building and how many floors that building
has.
Figure 5.7 Buildings Table
In our database the third table is for the Floors, in that table you can find
information for which building that floor belongs to and the area of that floor and
how many parking spots that parking has.
Figure 5.8 Floors Table
In our database the fourth table is for the parking spots, in that table you
can find information about what floor and what building it belongs and whither it is
empty or not also it gives information about when it was last empty and when it was
last occupied.
41
Figure 5.9 Parking Spots Table
To help learning how to build a database using MySQL we watched the following tutorial
[21]
5.2.2 The user interface
The user interface is an easy to deal with attractive program the user or administrator can
use so he can view information about the parking system or edit or add information.
After creating the database we linked it to the interface so it would be easy for users to
edit or view information.
At the begging the user is asked to type in his username and password, if the username
and password belongs to the table at the database the user is allowed to sign in see figure
5.10 and flow chart on figure 5.11
Figure 5.10 Signing in interface
42
Figure 5.11 Flow chart of user interface
43
If the user enters a valid username and password; the program automatically checks if the
user is an administrator or not.
If a normal user signs in he is allowed only to view what parking spots are empty in each
building without editing or adding any new information see figure 5.12
Figure 5.12 Building and floor choosing
Figure 5.13What parking spots are empty
In figure 5.13 red box indicates occupied parking spots while green box indicates
empty parking spot.
44
If an administrator signs in he is allowed to view and edit and add information see figure
5.14
Figure 5.14 Choosing What to View or Edit
After the user chooses one of the options shown in figure 5.14, he is then allowed to edit
the tables linked to that choice.
See figures 5.15-5.17
Figure 5.15 Parking spots interface
45
Here the user can add parking spots or view or delete unneeded parking spots.
Figure 5.16: Username interface
Here the admin can add new users how can only view information on the parking system
Figure 5.17 Floor interface
Here the admin can add new floors to a specific building.
46
5.2.3 Client connections
In this section we will talk briefly about the connection between the client and the
server in chapter five we will explain the connection in details.
After the client starts the connection with the server he sends him one of the
following messages: Sign/username/password or Reg/username/password or
Ref/Building number/floor number.
If the message starts with Sign it means the user is signing in with a existing user
so the server searches the database for that user if it is found the server send a Accepted
message else it sends a Denied message, if it starts with Reg the server adds the username
and password to the database and then send a Accepted message, if the message starts
with Ref it means the user is already signed in and asks for updated information for
parking spots for a specific building and floor.
After the client receives an Accepted message it sends a message asking for
parking spots for a specific building and floor. See figure 5.18 flow chart describing
client connection.
47
48
CHAPTER SIX: THE CLIENT
The client in our project is an android application that has an easy to deal with
attractive interface so the user can easily find where and what parking spots are empty,
the client duty is to connect with the server and ask for specific information for parking
spots in certain buildings and floors, after it receives the information it displays it using
the interface for the user.
6.1 What operating system to choose
Since the main objective of the our project is to allow the client to check for
empty parking spots easily and anywhere he wants, so we decided to use the mobile
phone for the client.
For mobile phones the three main operating systems widely known are Android IOS and
Microsoft.
6.1.1 IOS (iPhone operating system)
iOS is a mobile operating system developed by Apple. It was originally named the
iPhone OS, but was renamed to the iOS in June, 2009. The iOS currently runs on
the iPhone, iPodtouch, and iPad.
Like modern desktop operating systems, iOS uses a graphical user interface, or GUI.
However, since it is a mobile operating system, iOS is designed around touchscreeninput,
rather than a keyboard and mouse. For example, applications, or "apps," can be opened
by a single tap, rather than a double-click. Different screens can be viewed by swiping
your finger across the screen, rather than clicking on open windows.
Since iOS is designed to be simple and easy to use, it does not include several features
found in a traditional operating system. For example, you cannot
manage files andfolders like you can in Mac OS X or Windows. You also have limited
access to iOS system settings. Instead of modifying application preferences from within
each program, most settings need to be adjusted within the Settings app. Additionally,
while you can run multiple programs at once, you can only view one open program at a
time.
[22]
49
Because IOS is not the most spread operating system for mobile phones and since
it is so complicated we chosen not to start or project but in the future we might work on
it. ‘Wiki’
Figure 6.1 IOS operating system [23]
6.1.2 Microsoft mobile
“Microsoft Mobile is a multinational mobile phone and mobile computing device
manufacturing company headquartered in Espoo, Finland, and a wholly owned subsidiary
of Microsoft. It is a legal body that oversees and legally represents the activities in the
design, development, manufacture and distribution of mobile phones, smartphones, tablet
computers, related accessories and services.
Microsoft Mobile was established following the acquisition of Nokia's Devices and
Services division by Microsoft, which was completed in April 2014.
Microsoft Mobile got the right to sell mobile phones under the Nokia brand name as part
of a 10-year licensing agreement, as long as those phones are based on the S30+ platform
which comprises feature phones. Future "Lumia" smartphones fell out of this license and
couldn't be released bearing the Nokia brand In October 2014, it was announced that
future Lumia devices would carry the Microsoft name and logo instead of "Nokia"”[24]
Since Microsoft is not widely spread we have chosen not to work with it.
6.1.3 Android operating system
Android OS is a Linux-based platform for mobile phones. Android was released under
the Apache v2 open source license. Android was developed by Google and the Open
Handset Alliance (OHA), a coalition of hardware, software and telecommunications
companies. More than 30 companies were involved in the OHA, including Qualcomm,
Broadcom, HTC, Intel, Samsung, Motorola, Sprint, Texas Instruments and Japanese
wireless carriers KDDI and NTT DoCoMo. [25]
50
Figure 6.2 Android Studio
Our choice was to use the android since it is the most used operating system in the world
in addition it is an open source language so it is easy to learn.
6.2 How the client works
The client is an android application that is connected to the server, to fully explain how
the client works we will divide this chapter into two parts (User interface, Server
connection).
6.2.1 The User Interface
The interface must be clear and easy for the user to understand.
At the beginning when the user starts the application opens the login screen see figure 6.4
Figure 6.4 Login screen
If the user chooses to register a new user a registration screen opens see figure 6.5
51
Figure 6.5: Login screen
If the client is an existing user he types his username and password and presses on
the sign in button, if he is a new user he presses the registration button then types his
username and password and press the register button, after that he is sent to the building
choosing screen see figure 6.6
Figure 6.6 Building choosing screen
After choosing what building and on new screen choosing what floor and pressing the
display button the floor maps shows up showing what parking spots are empty or not, see
figure 6.7.
52
Figure 6.7 Floor map
See figure 6.8 with flow chart explaining the user interface
Figure 6.8: User Interface flow chart
53
6.3 Server Connections
To connect the server with client we need a communication technology either
wired or wireless, since the main idea of our project is to get the clients life easier, so we
decided that we need a wireless technology, also the wireless technology must work on
far distance for the user to view empty parking spots from their homes, for the previous
reasons we choose TCP/IP protocol.
"The Internet protocol suite is the computer networking model and set of
communications protocols used on the Internet and similar computer networks. It is
commonly known as TCP/IP, because its most important protocols, the Transmission
Control Protocol (TCP) and the Internet Protocol (IP) were the first networking protocols
defined in this standard. It is occasionally known as the DoD model, because the
development of the networking model was funded by DARPA, an agency of the United
States Department of Defense.
TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication
language or protocol of the Internet. It can also be used as a communications protocol in
a private network (either an intranet or an extranet). When you are set up with direct
access to the Internet, your computer is provided with a copy of the TCP/IP program just
as every other computer that you may send messages to or get information from also has
a copy of TCP/IP. [26]
When using TCP/IP protocol we need to set an IP address and port for the client
and server to communicate within, for the client we use a local IP which changes as the
client change, while the IP address for the server is a global static IP address any client
can reach when connected to the internet.
For our project we used a local IP address for both client and server but in future
work we will use a static IP.
To make a tcp ip connection we used a library called tcpclient[27], which has a couple of
commands: run to open the socket with ip address and port number of the server and
wait for message to be received, send message to send message to server, stop client
command to close socket, receive message command to use the received message as a
string, see figure 6.9 explaining how the library works
54
Figure 6.9 TCP client library
55
For the connection to start the Client opens a socket using the run command, after
the connection is established the Client enters his user name and password if he is already
registered user and registers if he is new user, after entering the user name and password
and submitting them using the buttons explained in the user interface section, a message
saying "Reg/username/password" or "Sign/username/password", is sent to the client
using the send message command, where the "/" is used to make it easy for the server to
split the message into three parts the first one to know if the user is signing in as an old
user or registering a new user, the second part to know what the username is and the third
one to know what the password is.
After the server receive the login messages he checks his database if the information is
valid or not and if they are it sends an "Accepted" message else it send a "Denied"
message.
If the client receives using the receive message command a "Denied" message the
program displays a textbox for the user noting that the user name or password not valid,
If an "Accepted" message is received the layout of the program changes to allow the user
to choose which building he wants,
After choosing which building the user has to choose what floor he is looking for and
after he presses the button for the floor a message of "Build/building number/floor
number" is sent for the server using the send message command as we said before "/" is
used to split the message into three parts first part for the server to know that where are
asking for what parking spots are empty in a specific building, second for letting the
server know what building we have chosen and the third one to ask for a certain floor.
Now if the user wants to update his information on a certain floor he send a message of
"Ref/Building number/Floor number" using send message command and the server
response to that message with the updated information for that building and floor.
A message is received from the server using the message received command as the
following, “Floor number/Sensor1 x axis place Sensor1 y axis place available or not /
Sensor2 x axis place Sensor2 y axis place available or not and so on until all parking
spots location and availability are sent. After that the program splits it into an array of
strings using split on (‘/’) where the first string in the array represents the floor number
and the second has all information about the first sensor and the third has all information
about the second sensor and so on, after that we split each sensor on (“ ”) and save on a
new string array, which will divide it into three parts first part it x location second is y
location third is available or not.
After that we use a command that takes the map as background and place each sensor on
top of it using the coordinates sent by the server and the color of the box will be green if
empty and red if occupied see figure 6.10 for explaining on how we draw images.
56
Fig 6.10 Drawing the Image command
See figure 6.11 to explain how we connect with the server.
57
Fig 6.11 Client Connection to the Server
58
To help us see the connection of the TCP/IP at each side we used a program called
Hercules, which is a program that acts like a server or client for a specific port which
helps us connect without needing a real server and test our server without needing a real
client, see figure 6.9
Figure 6.9: Hercules program
59
CHAPTER SEVEN: FUTURE WORK
In this chapter we will talk about our future work, and the additional features we
can add to the system to make it more advanced.
This chapter is divided into four parts, Sensor and sinks nodes enhancements, Server
enhancements, Client enhancements, and overall system enhancements.
7.1 Sensor and sink nodes enhancements
When using a wireless sensor node the most important issue to be considered is
the power consumption and battery life of the sensor node; also it’s important to keep in
mind the range of transmission between the nodes. In this section we will provide
solutions for these issues.
7.1.1 Using three axis AMR sensor
Since the three axis AMR sensor is a passive element it has very low power
consumption; this feature will extend the life of the battery which will make the system
more reliable. In addition to this very important feature, the three axis AMR sensor can
detect metallic vehicles very accurately, since it only detects metallic objects it will not
respond to any human interference on top of the sensor which is a problem we faced
using ultra sonic sensors. Since it is a three axis sensor it will only respond to large
objects extending in three dimensions.
7.1.2 Battery life parameter
We can’t detect that the battery has fully drained out until the sink node notices
that it didn’t receive anything from the dead sensor for five hours which will cause
misbehavior in the system. To solve this problem we will add an extra parameter to the
packet sent from the sensor node to the sink node containing information about the
battery status this will help the sink node know that the battery of that sensor is low. This
will help the supervisor to know when to exchange the battery; also it will give the sink
node the ability to control the sleeping duration of the sensor node by making it inversely
proportional to the battery life which will increase the battery life as it gets low.
7.1.3 External Antenna
In large parking lots, the main concern would be able to transmit our data over
large ranges since the sensor nodes might be further away from the sink node. In future
works adding an external might be necessary for the sensor nodes to extend its
transmission range over the entire parking lot.
7.1.4 Ad-Hoc Network
As the number of parking spaces increase within a parking lot, there would be an
increase in number of interconnected nodes within the network. It is therefore more
efficient to connect our network as an Ad-Hoc network to ensure reliability and stability
of our system. This also reduces the power as the transmission range would decrease
when sending data through neighboring nodes. Another advantage in using Ad-Hoc
network is that it reduces collision between the nodes since it transmits at shorter ranges.
60
7.1.5 Photovoltaic Cell
PV cells absorb sunlight energy and stores it as an electrical power. In outdoor
parking lots, the sunlight in the morning would store electrical power that can be used
throughout the rest of the day. The sensor nodes will then operate at free energy, which
makes it unnecessary to exchange the batteries for a long time. This reduces the ongoing
cost of our system since less maintenance and batteries would be needed.
7.2 Server enhancements
The objective of the server is to act as a connection node between the sink node
and the client but that is not the only objective also it should give information about the
system, to make the server more efficient many enhancements must be made on it.
7.2.1 Upgrading the database
For the server to be able to give information about the system it should have a large
database including everything about the server, in our project the database consisted of
four tables as described in chapter five.
In the user table we will add columns for credit card number for online parking spots
reservation, add information that state wither the user is a active user or not, user’s credit
and his rating for our parking system.
In the building table we will add wither the building is closed or not and wither it has
special parking lots or not for example for handicapped people.
In the parking spot table we will add information about each parking spot wither it is
special or not and wither it is covered or not and wither it can be reserved or not.
7.2.2 Administrator monitoring
A good feature to be added to the system is to give the administrator the ability to
monitor the system from his office.
The administrator will be able to know how many clients are connected to the system,
and how frequently each parking spot is occupied, also it will give him information on
what parking spots get reserved the most, and what sensors run out of batteries so he can
exchange them.
7.2.3 Using SSH protocol with TCP/IP
Since we are planning to make it possible for the client to reserve parking spots our
connection should be secure so that the credit card credentials don’t get stolen, since
TCP/IP protocol doesn’t provide this security we should use another protocol which is
known as SSH.
“Secure Shell (SSH) Protocol is a protocol for secure network communications designed
to be relatively simple and inexpensive to implement. The initial version, SSH1, focused
on providing a secure remote logon facility to replace Telnet and other remote logon
schemes that provided no security” [28]
to implement the SSH protocol on server using C# language we can use the help of a
library called renci. [29]
61
7.3 Client enhancements
In the client side there are many features to be added to make the client life easier and
since the client is the most important person in the system the enhancements to be made
must make the program easier to use and more efficient.
7.3.1 Using the GPS device
We can use the GPS device on the smart mobile phone in many ways.
To let the client know what building is closer to him we need to know his location and by
comparing each building location with his location we can tell the client which building
he should head to.
We must know how far the client is when reserving a parking spot to calculate how much
time he needs to reach the parking spot he reserved.
7.3.2 Developing client application for different operating systems
Our ambition is to reach as many people as we can and when we are only using one
operating system we will not reach everybody, so our future plane is develop client
application for both ios and Microsoft mobile because they are the most used after
android.
7.3.3 Adding reservation option
In the future we are planning to add an option for clients to reserve a parking spot before
coming to the parking building by paying extra charges; the payment method will be
using credit cards that will be saved in the database.
62
CHAPTER EIGHT: FINANCIAL STUDY
We will study the analysis of financially implementing our system in the University of
Jordan (JU).
In JU there are four parking lots and each parking lot has around 100 parking spaces, this
gives us a total of 400 parking spaces. We will assume that parking lot operates 16 hours
a day and that the number of vehicles differs from one time to another. The monitoring of
the parking lot can be divided into morning, noon, afternoon, and evening. During the
morning there the parking lot would be most likely fully occupied. If we assume that the
reservation of a parking space would cast 25 cents, and that no cars leave or enter during
this period this would give an income of 0.25*400= 100JD if all spaces have been
reserved . During noon the parking lots would be less crowded, assuming that half of the
parking lot has been reserved this gives an income of 50JD. In afternoon we will reduce
the income assuming that only one fourth of the parking lot has been reserved, this gives
an income of 25JD. Assuming that at night no reservations are made this gives a total net
income of 175JD daily.
This gives a total net income of 5250JD monthly and 63,000JD yearly.
Now we need to write down the cost of our project to calculate the total profit.
ATmega328-microcontroller costs around 11.28JD per one unit, when buying larger
quantities the price would be reduced to 4.3 JD per unit. The MX-05V model’s price is
3.6 for small quantities, for larger quantities the price would be 1.89 JD.
The HC-SR04 ultrasonic sensor costs 4.3 JD per single unit and 0.61 when buying larger
quantities. This gives an overall cost of 400*(4.3+1.89+.61) = 2720 JD for the
components bought. We also assume a yearly maintenance cost of 2000 JDs.
This gives a total yearly profit of around 63000-(2720+2000) = 58,280 JDs.
63
CHAPTER NINE: REVIEW AND DISCUSSION
An automated parking system using wireless sensor networks was proposed. The
hardware components used were briefly described and were chosen upon certain studies.
The communication link protocol was developed to ensure maximum performance with
reduced possibility of collision between the nodes.
Moreover, the sensor nodes and sink nodes were interconnected forming a star network
topology. In our system it is the sink node that decides whether or not the parking space
is occupied. This reduces burden on the sensor nodes and lowers its power consumption.
After computing the status of the parking lot in the sink node, it is serially transmitted to
the PC to be stored within tables in the database. Then the data is mapped out and sent to
the android application to be viewed by the users to retrieve the status of the parking lot.
Due to a large increase of vehicles in Amman, drivers find a difficulty in finding a
free parking space in overcrowded areas. Our project simplifies and makes it easier for
drivers to save time finding a parking space. Also it financially benefits governmental or
private sectors that implement this project through reservations of parking spaces.
64
REFERENCES
[1] Parking Guidance System, 2009
http://www.rsiconcepts.com/parking-guidance-system.php
[2] E.-J.P. Manoury, et al., "A 36x48 mm2 48M-pixel CCD imager for professional DSC
applications," in Electron Devices Meeting, 2008. IEDM 2008. IEEE International, pp. 1-
4, 2008. Available at http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4796668
[3] Nikon D60, Autofocus System, 12 June 2008.
[4] IKALOGIC S.A.S, Infra-Red Proximity Sensor at https://www.ikalogic.com/infra-
red-proximity-sensor-part-1/
[5] Ultrasonic Sensors, Their working and its embedded application, 25th
of March 2014
[6] J.E. Lenz et al. 1992. "A Highly Sensitive Magneto resistive Sensor," Proc Solid State
Sensors and Actuator Workshop.
[7] Arduino Uno vs Raspberry Pi vs Beaglebone, Author, Brandon, May 3rd
, 2013
http://blog.mcmelectronics.com/post/Arduino-Uno-Raspberry-Pi-and-BeagleBone-
Black#.VoVpnPl97IU
[8] RFID Centre, Wireless & Mobile Based Hardware & Software, Global wireless
standards 2003.
[9] ZigBee Specification , ZigBee Document 053474r06, Version 1.0 , December 14th
,
2004.
[10] Silicon Labs, EmberZNet PRO ZigBee Protocol Stack Software , 2015.
https://www.silabs.com/products/wireless/zigbee/Pages/zigbee-software.aspx
[11] Sparkfun, IR communication at https://learn.sparkfun.com/tutorials/ir-
communication
[12] Hobby Components, 433 MHZ WIRELESS MODULES MX-FS-05V at
http://hobbycomponents.com/wireless/168-433mhz-wireless-modules-mx-fs-03v-mx-05
[13] Electrical Engineering, How To Wire Up Ultrasonic Transducer, December
12th
,2013 at http://electronics.stackexchange.com/questions/93458/how-to-wire-up-
ultrasonic-transducer
[14] Arudino, Virtual Wire, author , Mike Mc Cauley , March 22nd
, 2013
65
[15] Introduction to the Oracle Database, Oracle Database Online Documenatation, 10g
release 2 , 2015
[16] TechTarget, SQL server Definition, Relational database management system guide:
RDBMS, January 2006
[17] Wikipedia, 2015, https://en.wikipedia.org/wiki/Microsoft_Visual_Studio
[18] Introduction to the C# Language and the .NET Framework, 2015
https://msdn.microsoft.com/en-us/library/z1zx9t92.aspx
[19] DebaterOfMath C# TCP tutorial
https://www.youtube.com/watch?v=uXFso7xSSWk
[20] MySQL Reference Manual, Overview of the MySQL Database Management System,
2015 at http://dev.mysql.com/doc/refman/5.7/en/what-is.html
[21] ProgrammingKnowledge, tutorials C# Local Database (SQL server) +SQL Database
Tutorial
[22] TechTerms, Software Terms: iOS Definition, October 22nd
, 2011 at
http://techterms.com/definition/ios
[23] Wikipedia, 2015.
https://en.wikipedia.org/wiki/IOS
[24] Wikipedia, 2015
https://en.wikipedia.org/wiki/Microsoft_Mobile
[25] Android OS definition , author, Margaret Rouse
http://searchenterpriselinux.techtarget.com/definition/Android
[26] TCP/IP (Transmission Control Protocol/Internet Protocol) definition
[27] Myandroidsolutions Tutorial, 2012
http://www.myandroidsolutions.com/2012/07/20/android-tcp-connection-tutorial/
[28] Cisco, Protocol Basic: Secure Shell Protocol, volume 12 no.4,author William
Stallings, January 2006.
[29] Code Beta, Renci SSH for .NET, February 13th
, 2015
http://codebeta.com/post/renci-ssh-for-net
66

More Related Content

What's hot

GSM Based Device Controlling and Fault Detection
GSM Based Device Controlling and Fault DetectionGSM Based Device Controlling and Fault Detection
GSM Based Device Controlling and Fault DetectionIJCERT
 
An enhanced method for human life rescue system
An enhanced method for human life rescue systemAn enhanced method for human life rescue system
An enhanced method for human life rescue systemeSAT Journals
 
Ieeepro techno solutions ieee embedded project - low power wireless sensor...
Ieeepro techno solutions   ieee embedded project  - low power wireless sensor...Ieeepro techno solutions   ieee embedded project  - low power wireless sensor...
Ieeepro techno solutions ieee embedded project - low power wireless sensor...srinivasanece7
 
GSM BASED e-NOTICE BOARD final year project report
GSM BASED e-NOTICE BOARD final year project reportGSM BASED e-NOTICE BOARD final year project report
GSM BASED e-NOTICE BOARD final year project reportVenkatesh Agnihotri
 
IRJET- Automatic License Issuing System
IRJET-  	  Automatic License Issuing SystemIRJET-  	  Automatic License Issuing System
IRJET- Automatic License Issuing SystemIRJET Journal
 
Ieeepro techno solutions ieee embedded project intelligent wireless street l...
Ieeepro techno solutions  ieee embedded project intelligent wireless street l...Ieeepro techno solutions  ieee embedded project intelligent wireless street l...
Ieeepro techno solutions ieee embedded project intelligent wireless street l...srinivasanece7
 
Intelligent wireless video monitoring system using computer111111
Intelligent wireless video monitoring system using computer111111Intelligent wireless video monitoring system using computer111111
Intelligent wireless video monitoring system using computer111111venkatesh deekonda
 
IRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter ReadingIRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter ReadingIRJET Journal
 
Object collision avoidance with train using android
Object collision avoidance with train using androidObject collision avoidance with train using android
Object collision avoidance with train using androideSAT Publishing House
 
IRJET - Bridge Monitoring System using IoT
IRJET -  	  Bridge Monitoring System using IoTIRJET -  	  Bridge Monitoring System using IoT
IRJET - Bridge Monitoring System using IoTIRJET Journal
 
Ieeepro techno solutions ieee embedded project - multi channel remote contr...
Ieeepro techno solutions   ieee embedded project - multi channel remote contr...Ieeepro techno solutions   ieee embedded project - multi channel remote contr...
Ieeepro techno solutions ieee embedded project - multi channel remote contr...srinivasanece7
 
IRJET - IoT-based Monitoring of Induction Motor Performance
IRJET - IoT-based Monitoring of Induction Motor PerformanceIRJET - IoT-based Monitoring of Induction Motor Performance
IRJET - IoT-based Monitoring of Induction Motor PerformanceIRJET Journal
 
Major Project Synopsis Report on IoT based DC Motor Through a Web-site
Major Project Synopsis Report on IoT based DC Motor Through a Web-siteMajor Project Synopsis Report on IoT based DC Motor Through a Web-site
Major Project Synopsis Report on IoT based DC Motor Through a Web-siteUtkarsh Chaubey
 
Auto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsAuto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsMadhav Reddy Chintapalli
 
IRJET- Railway Track Crack and Obstacle Detection using Arduino
IRJET-  	  Railway Track Crack and Obstacle Detection using ArduinoIRJET-  	  Railway Track Crack and Obstacle Detection using Arduino
IRJET- Railway Track Crack and Obstacle Detection using ArduinoIRJET Journal
 
Ieeepro techno solutions ieee 2014 embedded prokect emb base paper 43
Ieeepro techno solutions  ieee 2014 embedded prokect emb base paper 43Ieeepro techno solutions  ieee 2014 embedded prokect emb base paper 43
Ieeepro techno solutions ieee 2014 embedded prokect emb base paper 43srinivasanece7
 
Internet of Things: Energy Efficient Public Sensing
Internet of Things: Energy Efficient Public SensingInternet of Things: Energy Efficient Public Sensing
Internet of Things: Energy Efficient Public SensingRashed Miraj
 

What's hot (18)

GSM Based Device Controlling and Fault Detection
GSM Based Device Controlling and Fault DetectionGSM Based Device Controlling and Fault Detection
GSM Based Device Controlling and Fault Detection
 
An enhanced method for human life rescue system
An enhanced method for human life rescue systemAn enhanced method for human life rescue system
An enhanced method for human life rescue system
 
Ieeepro techno solutions ieee embedded project - low power wireless sensor...
Ieeepro techno solutions   ieee embedded project  - low power wireless sensor...Ieeepro techno solutions   ieee embedded project  - low power wireless sensor...
Ieeepro techno solutions ieee embedded project - low power wireless sensor...
 
GSM BASED e-NOTICE BOARD final year project report
GSM BASED e-NOTICE BOARD final year project reportGSM BASED e-NOTICE BOARD final year project report
GSM BASED e-NOTICE BOARD final year project report
 
IRJET- Automatic License Issuing System
IRJET-  	  Automatic License Issuing SystemIRJET-  	  Automatic License Issuing System
IRJET- Automatic License Issuing System
 
Ieeepro techno solutions ieee embedded project intelligent wireless street l...
Ieeepro techno solutions  ieee embedded project intelligent wireless street l...Ieeepro techno solutions  ieee embedded project intelligent wireless street l...
Ieeepro techno solutions ieee embedded project intelligent wireless street l...
 
Intelligent wireless video monitoring system using computer111111
Intelligent wireless video monitoring system using computer111111Intelligent wireless video monitoring system using computer111111
Intelligent wireless video monitoring system using computer111111
 
IRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter ReadingIRJET- Automatic Mseb Meter Reading
IRJET- Automatic Mseb Meter Reading
 
Object collision avoidance with train using android
Object collision avoidance with train using androidObject collision avoidance with train using android
Object collision avoidance with train using android
 
IRJET - Bridge Monitoring System using IoT
IRJET -  	  Bridge Monitoring System using IoTIRJET -  	  Bridge Monitoring System using IoT
IRJET - Bridge Monitoring System using IoT
 
Ieeepro techno solutions ieee embedded project - multi channel remote contr...
Ieeepro techno solutions   ieee embedded project - multi channel remote contr...Ieeepro techno solutions   ieee embedded project - multi channel remote contr...
Ieeepro techno solutions ieee embedded project - multi channel remote contr...
 
IRJET - IoT-based Monitoring of Induction Motor Performance
IRJET - IoT-based Monitoring of Induction Motor PerformanceIRJET - IoT-based Monitoring of Induction Motor Performance
IRJET - IoT-based Monitoring of Induction Motor Performance
 
Major Project Synopsis Report on IoT based DC Motor Through a Web-site
Major Project Synopsis Report on IoT based DC Motor Through a Web-siteMajor Project Synopsis Report on IoT based DC Motor Through a Web-site
Major Project Synopsis Report on IoT based DC Motor Through a Web-site
 
Auto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsAuto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between Stations
 
IRJET- Railway Track Crack and Obstacle Detection using Arduino
IRJET-  	  Railway Track Crack and Obstacle Detection using ArduinoIRJET-  	  Railway Track Crack and Obstacle Detection using Arduino
IRJET- Railway Track Crack and Obstacle Detection using Arduino
 
Ieeepro techno solutions ieee 2014 embedded prokect emb base paper 43
Ieeepro techno solutions  ieee 2014 embedded prokect emb base paper 43Ieeepro techno solutions  ieee 2014 embedded prokect emb base paper 43
Ieeepro techno solutions ieee 2014 embedded prokect emb base paper 43
 
Internet of Things: Energy Efficient Public Sensing
Internet of Things: Energy Efficient Public SensingInternet of Things: Energy Efficient Public Sensing
Internet of Things: Energy Efficient Public Sensing
 
273 279
273 279273 279
273 279
 

Viewers also liked

Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma joséJosé Jarma
 
Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma joséJosé Jarma
 
Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma joséJosé Jarma
 
Glosario ilustrado
Glosario ilustradoGlosario ilustrado
Glosario ilustradodairanac
 
Master of Lighting Design
Master of Lighting DesignMaster of Lighting Design
Master of Lighting DesignLuaras Morina
 
20161004 mapk dna_ref_standardslides
20161004 mapk dna_ref_standardslides20161004 mapk dna_ref_standardslides
20161004 mapk dna_ref_standardslidesMaki Ogawa
 
Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma joséJosé Jarma
 
BOLSA DE VALORES DE COLOMBIA
BOLSA DE VALORES DE COLOMBIA BOLSA DE VALORES DE COLOMBIA
BOLSA DE VALORES DE COLOMBIA Paola Giraldo
 
Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...
Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...
Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...Enrico Giansanti
 
LA BOLSA DE VALORES DE COLOMBIA
LA BOLSA DE VALORES DE COLOMBIALA BOLSA DE VALORES DE COLOMBIA
LA BOLSA DE VALORES DE COLOMBIAPaola Giraldo
 
Bachelor of Architectural Technology and Construction Management
Bachelor of Architectural Technology and Construction ManagementBachelor of Architectural Technology and Construction Management
Bachelor of Architectural Technology and Construction ManagementLuaras Morina
 

Viewers also liked (15)

Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma josé
 
Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma josé
 
Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma josé
 
ICT in H2020
ICT  in  H2020ICT  in  H2020
ICT in H2020
 
Benchmarking
BenchmarkingBenchmarking
Benchmarking
 
998-isvc16
998-isvc16998-isvc16
998-isvc16
 
Glosario ilustrado
Glosario ilustradoGlosario ilustrado
Glosario ilustrado
 
Master of Lighting Design
Master of Lighting DesignMaster of Lighting Design
Master of Lighting Design
 
Week6 - Newsletter
Week6 - NewsletterWeek6 - Newsletter
Week6 - Newsletter
 
20161004 mapk dna_ref_standardslides
20161004 mapk dna_ref_standardslides20161004 mapk dna_ref_standardslides
20161004 mapk dna_ref_standardslides
 
Power point de energías jarma josé
Power point de energías   jarma joséPower point de energías   jarma josé
Power point de energías jarma josé
 
BOLSA DE VALORES DE COLOMBIA
BOLSA DE VALORES DE COLOMBIA BOLSA DE VALORES DE COLOMBIA
BOLSA DE VALORES DE COLOMBIA
 
Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...
Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...
Dallo Storytelling al Visual Storytelling con l'evoluzione dei Social Network...
 
LA BOLSA DE VALORES DE COLOMBIA
LA BOLSA DE VALORES DE COLOMBIALA BOLSA DE VALORES DE COLOMBIA
LA BOLSA DE VALORES DE COLOMBIA
 
Bachelor of Architectural Technology and Construction Management
Bachelor of Architectural Technology and Construction ManagementBachelor of Architectural Technology and Construction Management
Bachelor of Architectural Technology and Construction Management
 

Similar to Project-FINAL

A proposed model for traffic signal preemption using global positioning syste...
A proposed model for traffic signal preemption using global positioning syste...A proposed model for traffic signal preemption using global positioning syste...
A proposed model for traffic signal preemption using global positioning syste...csandit
 
A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...
A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...
A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...cscpconf
 
Introduction of Wireless Sensor Network
Introduction of Wireless Sensor NetworkIntroduction of Wireless Sensor Network
Introduction of Wireless Sensor NetworkMuhammad Kaife Uddin
 
A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...
A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...
A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...IJCNCJournal
 
Design of a Wireless Sensor Network from an Energy Management Perspective
Design of a Wireless Sensor Network from an Energy Management PerspectiveDesign of a Wireless Sensor Network from an Energy Management Perspective
Design of a Wireless Sensor Network from an Energy Management Perspective?? ?
 
Embedded system for traffic light control
Embedded system for traffic light controlEmbedded system for traffic light control
Embedded system for traffic light controlMadhu Prasad
 
Energy efficient platform designed for sdma applications in mobile wireless ...
Energy efficient platform designed for sdma applications in mobile  wireless ...Energy efficient platform designed for sdma applications in mobile  wireless ...
Energy efficient platform designed for sdma applications in mobile wireless ...marwaeng
 
Train control system using can protocol
Train control system using can protocolTrain control system using can protocol
Train control system using can protocolIRJET Journal
 
A Wireless Sensor Network ( Wsn )
A Wireless Sensor Network ( Wsn )A Wireless Sensor Network ( Wsn )
A Wireless Sensor Network ( Wsn )Joanna Paulsen
 
MOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERS
MOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERSMOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERS
MOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERSIRJET Journal
 
Wireless Sensor Networks Are Defined As The Distribution...
Wireless Sensor Networks Are Defined As The Distribution...Wireless Sensor Networks Are Defined As The Distribution...
Wireless Sensor Networks Are Defined As The Distribution...Amy Alexander
 
Real Time Vehicle Tracking System
Real Time Vehicle Tracking SystemReal Time Vehicle Tracking System
Real Time Vehicle Tracking SystemDiLip ChauDhary
 
Maze solving quad_rotor
Maze solving quad_rotorMaze solving quad_rotor
Maze solving quad_rotornguyendattdh
 
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...IRJET Journal
 
Design of self powered embedded wireless smart camera using multimodal video ...
Design of self powered embedded wireless smart camera using multimodal video ...Design of self powered embedded wireless smart camera using multimodal video ...
Design of self powered embedded wireless smart camera using multimodal video ...eSAT Publishing House
 
Wireless sensor networks software architecture
Wireless sensor networks software architectureWireless sensor networks software architecture
Wireless sensor networks software architectureAdeel Javaid
 
Ijater 03 06
Ijater 03 06Ijater 03 06
Ijater 03 06nandhu458
 
Comparison of Routing protocols in Wireless Sensor Networks: A Detailed Survey
Comparison of Routing protocols in Wireless Sensor Networks: A Detailed SurveyComparison of Routing protocols in Wireless Sensor Networks: A Detailed Survey
Comparison of Routing protocols in Wireless Sensor Networks: A Detailed Surveytheijes
 

Similar to Project-FINAL (20)

A proposed model for traffic signal preemption using global positioning syste...
A proposed model for traffic signal preemption using global positioning syste...A proposed model for traffic signal preemption using global positioning syste...
A proposed model for traffic signal preemption using global positioning syste...
 
A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...
A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...
A PROPOSED MODEL FOR TRAFFIC SIGNAL PREEMPTION USING GLOBAL POSITIONING SYSTE...
 
Introduction of Wireless Sensor Network
Introduction of Wireless Sensor NetworkIntroduction of Wireless Sensor Network
Introduction of Wireless Sensor Network
 
A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...
A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...
A New Programming Model to Simulate Wireless Sensor Networks : Finding The Be...
 
Design of a Wireless Sensor Network from an Energy Management Perspective
Design of a Wireless Sensor Network from an Energy Management PerspectiveDesign of a Wireless Sensor Network from an Energy Management Perspective
Design of a Wireless Sensor Network from an Energy Management Perspective
 
Embedded system for traffic light control
Embedded system for traffic light controlEmbedded system for traffic light control
Embedded system for traffic light control
 
Energy aware routing for wireless sensor networks
Energy aware routing for wireless sensor networksEnergy aware routing for wireless sensor networks
Energy aware routing for wireless sensor networks
 
Energy efficient platform designed for sdma applications in mobile wireless ...
Energy efficient platform designed for sdma applications in mobile  wireless ...Energy efficient platform designed for sdma applications in mobile  wireless ...
Energy efficient platform designed for sdma applications in mobile wireless ...
 
Train control system using can protocol
Train control system using can protocolTrain control system using can protocol
Train control system using can protocol
 
A Wireless Sensor Network ( Wsn )
A Wireless Sensor Network ( Wsn )A Wireless Sensor Network ( Wsn )
A Wireless Sensor Network ( Wsn )
 
Obstacle avoiding robot.doc
Obstacle avoiding robot.docObstacle avoiding robot.doc
Obstacle avoiding robot.doc
 
MOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERS
MOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERSMOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERS
MOBILE ROBOTIC ARM WITH APP INTERFACE USING MICROCONTROLLERS
 
Wireless Sensor Networks Are Defined As The Distribution...
Wireless Sensor Networks Are Defined As The Distribution...Wireless Sensor Networks Are Defined As The Distribution...
Wireless Sensor Networks Are Defined As The Distribution...
 
Real Time Vehicle Tracking System
Real Time Vehicle Tracking SystemReal Time Vehicle Tracking System
Real Time Vehicle Tracking System
 
Maze solving quad_rotor
Maze solving quad_rotorMaze solving quad_rotor
Maze solving quad_rotor
 
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
 
Design of self powered embedded wireless smart camera using multimodal video ...
Design of self powered embedded wireless smart camera using multimodal video ...Design of self powered embedded wireless smart camera using multimodal video ...
Design of self powered embedded wireless smart camera using multimodal video ...
 
Wireless sensor networks software architecture
Wireless sensor networks software architectureWireless sensor networks software architecture
Wireless sensor networks software architecture
 
Ijater 03 06
Ijater 03 06Ijater 03 06
Ijater 03 06
 
Comparison of Routing protocols in Wireless Sensor Networks: A Detailed Survey
Comparison of Routing protocols in Wireless Sensor Networks: A Detailed SurveyComparison of Routing protocols in Wireless Sensor Networks: A Detailed Survey
Comparison of Routing protocols in Wireless Sensor Networks: A Detailed Survey
 

Project-FINAL

  • 1. 1 Electrical Engineering Department Faculty of Engineering and Technology The University of Jordan, Amman-Jordan AUTOMATED CAR PARKING SYSTEM By Saeed Mohammed Mustafa (0115258) Ibraheem Bilal Abu Arja (0115309) Ahmad Saeed Odetallah (0110714) Osama Ali Sabri (0114881 ) Supervised by Dr. Mohammad Hawa Submitted in partial fulfillment of the requirements of B.Sc. Degree in Electrical Engineering December 2015
  • 2. 2 ABSTRACT: The main objective of our project is to monitor a parking lot using a wireless sensor network. We use several sensor nodes interconnected to a single sink node. Our sensor nodes are equipped with ultrasonic sensors and are deployed in the center of the parking space. The sensor nodes send information to the sink node periodically if its sensor reading differs from previous value. The sink node is then connected to a gateway (PC in our case) then uploaded to a server. The server then decides whether or not the parking space is occupied. Upon receiving the data from the gateway, an administrator will map the parking lot and send the data using TCP/IP to a smart phone application. Users will then be able to retrieve the status of the parking lot through their phones viewed through an application.
  • 3. 3 TABLE OF CONTENTS 1 INTRODUCTION .......................................................................................................6 2 SENSOR NODE SPECIFICATIONS 2.1 Sensors ……………………………………………………………………….……. 9 2.1.1 Image Sensors …………………………………………………………………..9 2.1.2 IR Sensors …………………………………………………………………..…10 2.1.3 Ultrasonic Sensors ………………………………………………………….…11 2.1.4 3 Axis AMR Sensors ………………………………………………………….12 2.2 Microcontroller …………………………………………………………………...13 2.2.1 Choosing The Right MCU………………………………………………….… 13 2.2.2 Types Of Microcontrollers…………………………………………………..…14 2.3 The Communication Link…………………………………………………………15 2.3.1 Bluetooth…………………………………………………………………….…16 2.3.2 ZigBee …………………………………………………………………………17 2.3.3 Infrared………………………………………………………………………....18 2.3.4 ASK/OOK……………………………………………………………………...18 3 DESIGN AND CONSTRUCTION 3.1 System Architecture……………………………………………………...…….…20 3.2 Nodes Operation………………………………………………………………...…22 3.2.1 Sensor Node Schematic……………………………………………………..….24 3.2.2 Sink Node Schematic……………………………………………………….......25 4 THE NETWORK PROTOCOL 4.1 Specifications of TX/RX………………………………….…………………...…26 4.2 Network Operation……………………………………………………………....26 4.3 Communication Between The Nodes………………………………………...…29 4.3.1 The Sensor Node…………………………………………………………...….30
  • 4. 4 4.3.2 The Sink Node…………………………………………………………………31 4.4 Code Specifications………………………………………………………………32 4.4.1 Libraries………………………………………………………………..………32 4.4.2 Fragmentation of The Packets…………………………………………………..34 5 THE SERVER 5.1 What Program to Choose?......................................................................................35 5.1.1 Oracle………………………………………………………………………..…..35 5.1.2 SQL Server……………………………………………………………………....35 5.1.3 Visual Studio………………………………………………………………….....36 5.1.4 MySQL………………………………………………………………………….38 5.2 How The Server Works…………………………………………………………...39 5.2.1 The Database…………………………………………………………………....39 5.2.2 The User Interface……………………………………………………………….41 5.2.3 Client Connections………………………………………………………………46 6 THE CLIENT 6.1 What Operating System to Choose………………………………………………48 6.1.1 iOS……………………………………………………………………………...48 6.1.2 Microsoft Mobile…………………………………………………………….…49 6.1.3 Android Operating System…………………………………………………...…49 6.2 How The Client Works……………………………………………………….…...50 6.2.1 The User Interface……………………………………………………………….50 6.3 Server Connections………………………………………………………………..53 7 FUTURE WORK 7.1 Sensor and Sink Node Enhancements……………………………………………59 7.1.1 Using 3 Axis AMR sensors………………………………………………...…..59 7.1.2 Battery Life Parameter……………………………………………………...…..59 7.1.3 External Antenna…………………………………………………………...…..59
  • 5. 5 7.1.4 Ad-Hoc Network……………………………………………………………..…59 7.1.5 Photovoltaic Cell……………………………………………………………..…60 7.2 Server Enhancements…………………………………………………………..…60 7.2.1 Upgrading The Database………………………………………………………..60 7.2.2 Administrator Monitoring………………………………………………………60 7.2.3 Using SSH Protocol With TCP/IP……………………………………………...60 7.3 Client Enhancements……………………………………………………………...61 7.3.1 Using the GPS device…………………………………………………………..61 7.3.2 Developing Client application for different operating systems……………...…61 7.3.3 Adding Reservation Option………………………………………………….....61 8 FINANCIAL STUDY…………………………...………………………62 9 REVIEW AND DISCUSSION……………………………………..…..63 REFERENCES……………………………………………………………64
  • 6. 6 CHAPTER ONE: INTRODUCTION Due to a large increase of vehicles nowadays, most drivers find a difficulty in finding a free parking space in malls, universities, large building,etc. This encouraged us to develop an automated parking system that provides the drivers with the status of the parking lot through a smart phone. Several cities such as Dubai have already built an intelligent parking system. Dubai mall provides drivers with information about free parking spaces through large monitors installed within the parking lot as shown in Fig.1.1. However, the parking lot could be large such as that of Dubai mall; drivers would need to enter one of the several parking entrances to view the monitor. The area where the monitor is installed might be fully occupied and drivers would need to drive further within the parking lot. This causes traffic and it is inconvenient for large parking lots. Therefore, using an android application to be provided with the status of the parking lot before entering helps the drivers drive towards the entrance where available parking spaces are found. Figure 1.1 Parking System Of Dubai Mall [1]
  • 7. 7 Nowadays, wireless sensor networks (WSN) are used in many application areas. Due to the extremely low power consumed by the sensor nodes, WSN is useful in many applications including monitoring physical changes such as sound, pressure, presence of an obstacle, temperature, etc. WSN applications usually run by a batter power, therefore is used where AC electricity is not found. Fig 1.2 Simplified Block Diagram of Project Sensor Node Sink Node PC/Server Android Application Sensor NodeSensor Node
  • 8. 8 In chapter two we will study the hardware choices used to build our project together. We will briefly explain the operation, power consumption, cost, and disadvantages of each component separately. In chapter three we will build our system based on the studies we concluded on chapter two. Here we design and interconnect our components building the sensor and sink nodes. Chapter four mainly discusses the protocols used in designing the communication links. Here we will discuss the methods used in collision detection and error correction of the transceiver. Also the specifications of the module used are explained such as the data rate, operating frequency, and duty cycle. Chapter five will discuss the server in details including what programs chosen to use for the database and user interface, how the database is built, how the interface is constructed, and the protocol used to communicate between the client and server and how to receive from the sink node. Chapter six will discuss the client in details including what operating system chosen to use and why that choice was made, and the interface for the android application, how the code is built for communication with the server. In chapter seven we will talk about our plans in the future and what we will improve in the components of our system to make it more advanced and what features must be added to the system. In chapter eight we will make a study on University Of Jordan’s parking lots and how we can implement our project on it. We will talk about the financial and technical advantages it might offer the university.
  • 9. 9 CHAPTER TWO: SENSOR NODE SPECIFICATIONS Wireless sensor networks are built up using many different components depending on many factors such as the speed of operation, the type of objects to be detected, power consumption, and distance between interconnected nodes. The architecture of each WSN contains a sensor, a MCU, a battery, and a transciever as shown in fig 2.1. We will study each component seperately to make a solid decision on which hardware is suitable for our project. Fig 2.1 Sensor node block diagram 2.1 Sensors Several different sensors could be used to detect the presence of a vehicle. In our project, the precision of detection as well as power consumption is important. Therefore, we must choose the correct hardware that provides both specifications. 2.1.1 Image sensors: Image sensors provide excellent information for recognizing vehicles by images. CCD sensors work by transferring the charge from one pixel to another until they end up at the periphery, and are then converted into a voltage to be read out. The charge transfer is accomplished by applying voltages that form wells of different potentials, so the
  • 10. 10 charges transfer completely from one pixel to the next. Charges typically are shifted downward to the end of a column, then rightward to the end of a row, where the readout circuitry is present. The charge to voltage conversion then takes place, since voltage output is proportional to the charge over the capacitance. [2] The problem we might face is that it might fail when there isn’t enough ambient light. Also image sensors require a lot of computation which imposes heavy burden on the sensor nodes and require large amount of memory. Figure 2.2 CCD image sensor [3] 2.1.2 IR sensors The basic idea of IR sensors is sending and infrared light through IR-LEDS, this emitted light is then reflected back when it hits an object in front of the sensor. The picked up light is then converted to a voltage to be read using electronic circuits. Although infrared is cheap ($10 -$20) its narrow beam is not good in measuring distance to dark objects. Infrared sensors emit infrared light, and therefore the sensors cannot work accurately outside or even inside if there is direct or indirect sunlight. In outdoor parking lots it is inefficient to use IR sensors.
  • 11. 11 Figure 2.3 IR sensor [4] 2.1.3 Ultrasonic sensors Active ultrasonic sensors generate high-frequency sound waves and evaluate the echo which is received back by the sensor, measuring the time interval between sending the signal and receiving the echo to determine the distance to an object. Ultrasonic sensors use sound instead of light for ranging, so ultrasonic sensors (some people call it sonar) can be used outside in bright sunlight. These sensors are amazingly accurate, though they may be thrown off by a sound absorbing obstacle, like a sponge. The only real issue that arises is the "ghost echo" issue. As you can see below, the walls bounce off in a strange pattern causing a ghost effect. [5] Figure 2.4 Ultrasonic Sensor
  • 12. 12 2.1.4 3-axis AMR sensor: The magnetoresistive effect was first described by William Thompson, Lord Kelvin, in 1856. These devices are widely used today for position detection in high-density read heads for tape and hard-disk drives, sensing vehicular wheel speed and crankshaft position, and measuring linear and angular position and displacement in the Earth's magnetic field. Their low cost, high sensitivity, small size, noise immunity, and reliability give them an advantage over mechanical or other electrical alternatives. Highly adaptable and easily assembled, AMR sensors are solving a variety of problems in custom applications. [6] Since vehicles are usually made of metals, they disturb the magnetic field of surrounding areas, and therefore magnetic sensors are a good candidate for detecting vehicles. It is a passive sensor therefore has very low power consumption. Figure 2.5 3-Axis AMR sensor [6]
  • 13. 13 2.2 Microcontroller The microcontroller is required to store and control the transmission of the data read by the sensor. It performs computations and comparisons needed to provide a sufficient transfer of data. There are a large number of different types of microcontrollers, although most of them have a lot in common; our decision should be suitable with the operation of our application. 2.2.1 Choosing the right MCU There are some considerations that should be kept in mind when choosing the correct MCU for any application. The main criteria of choice should be regarding some factors and features listed below. 1. Memory size: It is important to have a sufficient amount of memory when dealing with monitoring applications. The more memory the MCU stores the better. When dealing with larger parking lots it is important that we have enough memory to store the temporary data stored by the sink node. 2. Maximum Frequency: Each MCU has an internal oscillator installed. In most applications it is required that the duty cycle of the program flow is fast and therefore higher frequency is needed. Frequency is an important factor in monitoring applications since fast speed operation might affect the status seen by the users. 3. Number of Pins: Usually what limits the components and hardware added to our sensor node is the number of pins. The more pins the MCU has, the more features we could add to our system.
  • 14. 14 2.2.2 Types of Microcontrollers 1. The Arduino Uno: It is a microcontroller board based on the ATmega328P. The Arduino Uno has fourteen digital input/output pins. It uses a 16 MHz crystal oscillator. Arduino is suitable in networks needing to connect to a server since it has and a USB cable that can serially transfer the data from the microcontroller to the PC. Also voltage can be fed to interconnecting components by one of its pins. 2. The Raspberry Pi: It operates at a frequency of 700 MHz. It has a storage memory 1 GB. It operates at a power of 4 W. It has excellent specifications for systems that require high data rate and complex computations. 3. The BeagleBone: The beaglebone MCU is expensive. It runs at a frequency of 700 MHz. The main advantage of this type of MCU is its large memory storage. Even in very large parking lots 4GB is more than enough to store all information on the sensor nodes. Fig 2.6 Arduino Uno, Raspberry Pi, and Beaglebone ordered from left to right [7]
  • 15. 15 Below is a table that contains the features and specifications that compare all three types of microcontroller. Table 2.1 MCU Comparison [7] 2.3 The Communication Link In wireless sensor networks, there must be a connection or link between the sensor nodes and the sink node. Although using actual wires for connection provides more security and no interference between the nodes, it is far more expensive since we need underground wiring. That is why in WSN wireless communication is used. The sensor node mainly loses all its power through the transmission process. That is why we need to choose a low power wireless technology that provides the appropriate data rate with an acceptable range.
  • 16. 16 Below are some wireless technologies used in WSN; we will chose the link based on our system requirements. 2.3.1 Bluetooth Bluetooth is an industrial specification for wireless personal area networks (PANs), also known as IEEE 802.15. Bluetooth provides a way to connect and exchange information between devices. It is a radio standard and communications protocol primarily designed for low power consumption, with a short range.[8] Bluetooth exchanges data at frequencies varying from 2.4 to 2.485 GHz. This high frequency limits the range of connecting nodes. The main advantage of the Bluetooth technology is its low price and low power consumption. The problem we may face in our project when using bluetooth is that it is used in many applications such as phones, laptops, and many other portable devices. This may increase the risk of interference and collision. Fig 2.7 A Bluetooth Network [8]
  • 17. 17 2.3.2 ZigBee The ZigBee stack architecture includes a number of layered components including the IEEE 802.15.4 2003 Medium Access Control (MAC) layer and Physical (PHY) layer and well as the ZigBee Network (NWK) layer. Each of these provides applications with its own set of services and capabilities. [9] The ZigBee Alliance is developing very low-cost, very low power consumption, two- way, wireless communications standard. Solutions adopting the ZigBee standard will be embedded in consumer electronics, home and building automation, industrial controls, PC peripherals, medical sensor applications, toys and games. ZigBee (IEEE 802.15.4) are mainly used in personal area networks. The main advantage of ZigBee technology is its capability of interconnecting a large number of nodes in a single network. Its very low power limits the range to a maximum of 100 meters. Also it operates at low data speed which is inefficient in time sensitive applications. Fig 2.8 ZigBee Network [10]
  • 18. 18 2.3.3 Infrared IR, or infrared, communication is a common, inexpensive, and easy to use wireless communication technology. IR light is very similar to visible light, except that it has a slightly longer wavelength. A common modulation scheme for IR communication is something called 38kHz modulation. There are very few natural sources that have the regularity of a 38 kHz signal, so an IR transmitter sending data at that frequency would stand out among the ambient IR. 38 kHz modulated IR data is the most common, but other frequencies can be used. [11] IR transmission occurs at line of sight and any obstacle that cuts through the connection will highly attenuate or even block our transmission. This makes IR a bad choice in parking lots since it is crowded with vehicles entering and leaving; this will cut off our signal. Fig 2.9 IR Transceiver [11] 2.3.4 ASK/OOK Amplitude shift keying (ASK) is a type of digital modulation that varies the transmitted digital signal according to a carrier signal’s amplitude. A special type of ASK used in many communication systems is the ON-OFF Keying (OOK). If the amplitude of the digital signal to be sent overcomes a certain threshold value it will transmit the carrier signal as a voltage ‘1’, otherwise zero voltage is sent.
  • 19. 19 Wireless Transmitter Modules allow your Arduino to wirelessly communicate with other Arduinos, or with radio frequency (RF) controlled devices that operate in the same frequency. [12] Here we will study the ‘’Module MX-05V’’ module. It operates at a frequency of 433 Mhz. This intermediate frequency allows transmission at long ranges around 200 meters. It has a low data rate which is suitable in our case since not much information is to be exchanged between the sensor and sink nodes. It has a low transmission power of 10mW. Fig 2.10 Module MX-05V [12]
  • 20. 20 CHAPTER THREE: DESIGN AND CONSTRUCTION 3.1 System Architecture Upon studying the hardware and technologies provided in the previous chapter, we set up a table pointing out the hardware modules connected together to form our WSN. Each of our choices depended on three important factors: the price, the power consumption, and the efficiency in working in several environments. The table shown below shows the specifications of the sensor and sinks nodes used in this application. Table 3.1 Specifications of our hardware Microcontroller Arduino UNO R3 Sensor Ultrasonic sensor (HC-SR04) RF Transceiver Module MX-05V Frequency 433 MHz Data Rate 2 kbps Antenna Internal or external (optional) Battery 9 V cell
  • 21. 21 Our parking automation system is composed of multiple sensor nodes, a sink node, a gateway, and a server. The connection forms a star-shaped network connecting the sensor nodes to the sink node. The sink node is serially connected to a PC (gateway) via USB interface and the data is then delivered to the server through the gateway. This is shown Fig.3.1. The server determines which parking space is available based on the received information and provides the availability information for drivers by sending the data to the android application which can be viewed by the users. Figure 3.1 Star-shaped network of our communication link
  • 22. 22 3.2 Nodes Operation Each sensor node has an ultrasonic sensor connected to the microcontroller (Arduino UNO) as shown in Fig.3.2. The sensor outputs show significant differences when the parking spot is occupied and not. The presence of a motor vehicle in a parking spot, therefore, can be detected based upon changes in the output of the sensor mounted on the sensor node deployed in the parking spot. Figure 3.2 Ultrasonic sensor connected to the Arduino board [13] Each sensor node determines the status of a parking space regardless of the type of sensor used. The sensor node should read the sensor data at a high rate to tell whether a car is entering or leaving the parking space. It is known that high sampling rates causes higher power consumption by the node. A good solution to this is to only send data when the current reading differs from the previous one which indicates that the status of the parking space has been changed.
  • 23. 23 Each parking space has a sensor node equipped with an ultrasonic sensor placed in its center. The sensor nodes are powered by batteries. The sensor node in a parking space measures the values of the ultrasonic sensor periodically and wirelessly transmits the sensor values only when they show abrupt variations. A server receives the data from all sensor nodes via a sink node and a gateway and determines whether each parking space is occupied based on the received sensor values and reference values maintained by the server. This approach results in a low duty cycle of sensor nodes by decreasing computations performed by the sensor nodes and in turn longer battery life of the sensor nodes. The sensor node remains in sleep mode during most of the operation time to conserve battery power and wakes up at a predetermined time interval to read the ultrasonic sensor data. Since the parking lot status is not frequently changed, we could set the wake up time of the node up to a few seconds. We let the ultrasonic take multiple readings and order them as ascending values and then take the median value as our reading. We define an integer value to temporary store our reading. Then the median value is transmitted to the sink node to be compared to a certain threshold by the server to determine whether the parking space is occupied or not. After wake up, if the occupancy status of the parking spot remains unchanged, the sensor node does not observe meaningful changes in the sensor data and as a result does not transmit any data. In other words, RF transmission, which consumes the most power in the sensor node, occurs only when noticeable changes in the sensor outputs are detected, and therefore battery life can be extended. The server is the destination of all the information transmitted by the sensor nodes. Though each of the sensor nodes reads the sensor values indicative of the occupancy status of a related parking space, it does not know whether or not the space is actually taken.
  • 24. 24 A sensor node simply compares two consecutive sensor data and transmits it the server when there are changes exceeding the threshold value. It is the sink node that determines whether or not the corresponding parking space is occupied based upon the measured data from the sensor node and the initial median values of the ultrasonic sensor, thereby reducing the computational burden of the sensor nodes. The server manages the occupancy status of all areas of the parking lot and provides drivers with the status information. The status information may be provided by tracing the map drawn by the server and uploaded to the android application to be viewed by the users. 3.2.1 Sensor Node Schematic
  • 25. 25 3.2.2 Sink Node Schematic
  • 26. 26 CHAPTER FOUR: THE NETWORK PROTOCOL 4.1 Specifications of TX/RX In determining the communication range and data rate, the RF frequency plays a major role in a wireless sensor network. In older systems high frequencies was used such as the 2.4 GHZ band. This allows high data rates but in return have a shorter transmission range. In our project, the data size transmitted by the sensor node is small. We can use low data transmission frequency because we only transmit when the microcontroller detects changes in the sensor readings. This is mainly the reason why we chose to use the MX-05V (RF transceiver) which uses a frequency of 433 MHz. This module provides a data rate of 4 kbps which is more than enough to transmit the required data. This frequency also allows us to transmit at a high range. This makes it possible to cover up the entire parking lot and makes AD-HOC connections unnecessary in small or medium parking lots. 4.2 Network Operation We set the sleep time of each sensor node to around 20 seconds which is convenient since it takes more time for a car to enter and leave the parking space. After wake up, the sensor node enables it transmission and reads the sensor readings. It compares the current value to the previous reading. If the readings show no abrupt changes the sensor node enters sleep mode again since it is unnecessary to send information which is already stored in the sink node. If the readings differ (which indicates a change in the parking space status) the sensor data is transmitted to the sink node along with its ID. The ID value of each sensor node is important for the sink node to distinguish between the nodes. We add a certain time delay to ensure that data has been fully transmitted.
  • 27. 27 After transmission is completed, we enable the receiving mode of the sensor node to be able to receive an acknowledgement from the sink node. The sink node must send an acknowledgement to the transmitting node to ensure that the data has been sent. Since the nodes send using the same frequency band there is a chance collision might occur. To detect collision we used the binary exponential backoff algorithm. After ‘n’ collisions, each station waits (back off) for a random number of slots chosen uniformly between 0 and 2n-12n-1: For the first collision, each sender will wait 0 or 1 slot times. After the second collision, the senders will wait anywhere from 0 to 3 slot times (inclusive). After the third collision, the senders will wait anywhere from 0 to 3 slot times. After the third collision, the senders will wait uniformly from 0 to 7 slot times, and so forth. As the number of retransmission attempts increases, the contention window grows exponentially. This goes until ‘n’ reaches the value 16. Then we reset the value of ‘n’ to zero and the operation goes on. This is summarized in the flowchart in the following page.
  • 28. 28 Fig.4.1 Flow chart explaining the Binary back off algorithm
  • 29. 29 The sink node should always be set in receive mode and never put to sleep. The sink node consumes far more power than any of the sensor nodes; therefore it must be constantly connected to a power supply and not batteries. In our connection the sink node is connected at the center of the parking lot to ensure reliability of transmission. After sending the acknowledgement, the sink node serially sends the data to the PC via USB interface and then is set to receiving mode again. The decision upon whether or not the parking space is occupied is then decided by the sink node and sent to the server to be mapped out and send to the application that can be used by the users to retrieve the parking lot status. 4.3 Communication between the nodes Here we will describe the protocol developed between the communication of the sensor and sink nodes. It is important to set a protocol that involves error and collision detection. This reduces the risk of obtaining wrong status information or even the loss of the entire data. Acknowledgements are also a must to ensure correct transmission and reception between the nodes. In the following two sections we developed flowcharts explaining the coding and protocols used in both the sensor and sink node.
  • 30. 30 4.3.1 The Sensor Node Below is the flowchart explaining the protocol developed in the sensor node.
  • 31. 31 4.3.2 The Sink Node Below is the flowchart developed for the protocol used in the sink node.
  • 32. 32 4.4 Code Specifications Here we will discuss the libraries used while implementing our code. We will also talk about the problems we faced while developing our code and how we came with solutions that made our code work properly. 4.4.1 Libraries We used two different types of libraries throughout conducting our code. The first library we used was the virtualwire library. VirtualWire is an Arduino library that provides features to send short messages, without addressing, retransmit or acknowledgment, a bit like UDP over wireless, using ASK (amplitude shift keying).It Supports a number of inexpensive radio transmitters and receivers. All that is required is to transmit data, receive data and a PTT transmitter enable. This library is compatible with all RF modules. It gives us complexity to choose which data rate we transmit our data, but we should keep in mind that increasing the data rate would decrease the range of transmission. The ASK receiver must be synchronized with the transmitter through a preamble. We can transmit messages up to 27 bytes. Each message is transmitted as a 36 bit training preamble consisting of 0-1 bit pairs, a 12 bit start symbol 38H, a one byte type of message length count (4-30), message bytes whose maximum reaches 27 bytes, and a two byte FCS. [14] The transmission and reception process uses the interrupt of Timer1. That is why we avoided using this timer for other applications. The FCS ‘checksum’ drops the packet if an error occurs during transmission. The limitations of this library are that it only sends character types of messages. When we needed to transmit an integer value we used to convert it to an array of characters, then the value is retrieved at the receiver by reconverting the array of characters back to an integer.
  • 33. 33 The second library we used is the ‘Lowpower’ library. The lowpower library was mainly used to develop an extended time delay using the watchdog timer to set the nodes to sleeping mode after transmission and reception of the ACK. The Arduino Uno contains four timers including timer0, timer1, timer2, and the watchdog timer. Timer0 and timer 2 have maximum delay time in milliseconds. We must use loops in order to increase the time delay to 20 seconds which causes large amount of interrupts in a small interval of time; this may cause the Arduino to malfunction. Timer1’s time delay reaches up to 4.1 seconds, but it is already reserved by the virtualwire library. Therefore, we chose to use the watchdog timer whose pre-scale value could reach up to 8 seconds. We used this timer twice by using the maximum value of pre-scale to reach 16 seconds, then we used a lower pre-scale whose value is 4 seconds. The 16 seconds added up with the 4 seconds gives us our required 20 seconds to keep the nodes in sleeping mode. This library supports all sleeping modes in the Arduino (Idle, ADC reduction mode, power save, power down, standby, and extended standby). The sleeping mode that we used was the power down type. The power down sleeping mode guarantees to set the ADC and the brownout detector to sleeping mode which consume the most power by the Arduino. The limitations we faced using this library is that when entering sleeping mode it pauses the program time of flow that is needed to determine the time needed to send an alive message every 4-4.5 hours. As a solution to this, we defined a counter which is incremented when the whole program overflows. Then we could determine the time it took to flow throughout the program and during the sleeping mode; this computes the time needed to send an alive message.
  • 34. 34 4.4.2 Fragmentation of the Packets We used three different types of packets, the sensor data packet, the alive message, and the acknowledgment message. The sensor data packet consists of 13 bytes. The first byte is reserved for the packet type. Bits 5 to 8 are reserved for the ID of the parking space, bits 8 to11 are reserved for the sensor data reading and the last 4 bits are for the serial number of the packet. The fragmentation of the sensor data packet is shown below. 1 4 4 4 The alive message sent also consists of 13 bytes. The fragmentation of this packet is shown below. 1 4 4 4 The acknowledgment message sent from the sink node to the sensor nodes consist of only 8 bytes. The fragmentation of the packet is shown below. ID of the parking space Serial Number of PKT 4 4 Packet type ID of parking space Sensor data Serial number of pkt Packet type ID of parking space All ones Serial number of pkt
  • 35. 35 CHAPTER FIVE: THE SERVER In this chapter we will discuss the role of the server. We use the server for receiving data from the sink node and arranging that data into groups of tables and studying that data to allow the administrator to have an overview of the system, in addition to all that has the duty of sending that data to the client. 5.1 What program to choose? Before talking about our choices of what program to use for the server we will talk briefly about all the programs we studied about before making our choice. For the sever we needed a program that can deal with data and make a database in addition to that it should have an easy to deal with interface so that the administrator can control the system , by considering these specifications we were left with the following to choose from(Oracle, MYSQL, SQL Server, Visual Studio). 5.1.1 Oracle An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. A database server is the key to solving the problems of information management. In general, a server reliably manages a large amount of data in a multiuser environment so that many users can concurrently access the same data. All this is accomplished while delivering high performance. A database server also prevents unauthorized access and provides efficient solutions for failure recovery. Oracle Database is the first database designed for enterprise grid computing, the most flexible and cost effective way to manage information and applications. Enterprise grid computing creates large pools of industry-standard, modular storage and servers. With this architecture, each new system can be rapidly provisioned from the pool of components. There is no need for peak workloads, because capacity can be easily added or reallocated from the resource pools as needed. [15] 5.1.2 SQL Server SQL Server is a relational database management system (RDBMS) from Microsoft that's designed for the enterprise environment. SQL Server runs on T-SQL (Transact -SQL), a set of programming extensions from Sybase and Microsoft that add several features to standard SQL, including transaction control, exception and error handling, row processing, and declared variables.[16] Due to the high price of the program and since our database is very small we considered not using it.
  • 36. 36 Our choice was with using visual studio for the interface and MYSQL for the database and linking them together. 5.1.3 Visual Studio “Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, class designer, and database schema designer. It accepts plug-ins that enhance the functionality at almost every level—including adding support for source-control systems (like Subversion) and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software development lifecycle (like the Team Foundation Server client: Team Explorer). Visual Studio supports different programming languages and allows the code editor and debugger to support (to varying degrees) nearly any programming language, provided a language-specific service exists. Built-in languages include C, C++ and C++/CLI (via Visual C++), VB.NET (via Visual Basic .NET), C# (via Visual C#), and F# (as of Visual Studio 2010). Support for other languages such as M, Python, and Ruby among others is available via language services installed separately. It also supports XML/XSLT, HTML/XHTML, JavaScript and CSS. Java (and J#) were supported in the past. Before Visual Sudio 2015, Commercial versions of Visual Studio were available for free to students via Microsoft's DreamSpark program, when only commercial versions supported plugins. Starting with Visual Studio 2015, Microsoft provides "Community" editions of its Visual Studio at no cost to any one, where Community edition supports installing plugins.”[17]
  • 37. 37 We choose Visual Studio because it is easy to build, and can be linked to a lot of database programs, in addition to that is has a lot of variety in choosing what language you want to program with including : C++, C# ,visual basic ,java, Python. Before saying why we choose C# we will talk briefly about it “C# syntax is highly expressive, yet it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin to work productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ and provides powerful features such as nullable value types, enumerations, delegates, lambda expressions and direct memory access, which are not found in Java. C# supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code. Language- Integrated Query (LINQ) expressions make the strongly-typed query a first-class language construct. As an object-oriented language, C# supports the concepts of encapsulation, inheritance, and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struck is like a lightweight class; it is a stack- allocated type that can implement interfaces but does not support inheritance.”[18] We choose C# as a language to program because it is easy to learn and professional language to use. To learn C# we watched the following tutorial[19]
  • 38. 38 Fig 5.3 Visual Studio program 5.1.4 MySQL MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation. MySQL Server was originally developed to handle large databases much faster than existing solutions and has been successfully used in highly demanding production environments for several years. Although under constant development, MySQL Server today offers a rich and useful set of functions. Its connectivity, speed, and security make MySQL Server highly suited for accessing databases on the Internet. [20] MySQL deals with database in simple easy to use tools, and can be easily linked with visual studio, and is an open source program for the previous reasons we choose it for database. Screenshot Of MySQL Connection
  • 39. 39 5.2 How the server works The server’s objective is to have a database stored in it all the information the user or administrator needs, also it must be able to receive from the sink node updated information about the parking spots, after collecting all data needed it connects to the client and sends information about parking spots using a connecting protocol which we will talk about later. Studying all these duties for the server we divided this section into four parts: (The Database, The user interface, Client connections, Sink node connections). In our project we took the University of Jordan as an example for our parking system. 5.2.1 The Database To have all information ready for the user to view or edit we created a database using MYSQL having the following tables: (Buildings, Floors, Users, and Parking Spots). Figure 5.6 Users Table The Users table has all the information about users that can access the information and including: (Username, Password, and Email). This table is very important and will be used in both client connection and user interface as we will explain in the next two sections. In the University of Jordan there are 4 parking areas: (East Parking Consisting of one floor and 100 Parking Spots, North Parking Consisting of one floor and 100 Parking Spots, South Parking Consisting of one floor and 100 Parking Spots, West Parking Consisting of two floor and 160 Parking Spots).
  • 40. 40 In our database the second table is for the buildings, in that table you can find information for the location of that building and how many floors that building has. Figure 5.7 Buildings Table In our database the third table is for the Floors, in that table you can find information for which building that floor belongs to and the area of that floor and how many parking spots that parking has. Figure 5.8 Floors Table In our database the fourth table is for the parking spots, in that table you can find information about what floor and what building it belongs and whither it is empty or not also it gives information about when it was last empty and when it was last occupied.
  • 41. 41 Figure 5.9 Parking Spots Table To help learning how to build a database using MySQL we watched the following tutorial [21] 5.2.2 The user interface The user interface is an easy to deal with attractive program the user or administrator can use so he can view information about the parking system or edit or add information. After creating the database we linked it to the interface so it would be easy for users to edit or view information. At the begging the user is asked to type in his username and password, if the username and password belongs to the table at the database the user is allowed to sign in see figure 5.10 and flow chart on figure 5.11 Figure 5.10 Signing in interface
  • 42. 42 Figure 5.11 Flow chart of user interface
  • 43. 43 If the user enters a valid username and password; the program automatically checks if the user is an administrator or not. If a normal user signs in he is allowed only to view what parking spots are empty in each building without editing or adding any new information see figure 5.12 Figure 5.12 Building and floor choosing Figure 5.13What parking spots are empty In figure 5.13 red box indicates occupied parking spots while green box indicates empty parking spot.
  • 44. 44 If an administrator signs in he is allowed to view and edit and add information see figure 5.14 Figure 5.14 Choosing What to View or Edit After the user chooses one of the options shown in figure 5.14, he is then allowed to edit the tables linked to that choice. See figures 5.15-5.17 Figure 5.15 Parking spots interface
  • 45. 45 Here the user can add parking spots or view or delete unneeded parking spots. Figure 5.16: Username interface Here the admin can add new users how can only view information on the parking system Figure 5.17 Floor interface Here the admin can add new floors to a specific building.
  • 46. 46 5.2.3 Client connections In this section we will talk briefly about the connection between the client and the server in chapter five we will explain the connection in details. After the client starts the connection with the server he sends him one of the following messages: Sign/username/password or Reg/username/password or Ref/Building number/floor number. If the message starts with Sign it means the user is signing in with a existing user so the server searches the database for that user if it is found the server send a Accepted message else it sends a Denied message, if it starts with Reg the server adds the username and password to the database and then send a Accepted message, if the message starts with Ref it means the user is already signed in and asks for updated information for parking spots for a specific building and floor. After the client receives an Accepted message it sends a message asking for parking spots for a specific building and floor. See figure 5.18 flow chart describing client connection.
  • 47. 47
  • 48. 48 CHAPTER SIX: THE CLIENT The client in our project is an android application that has an easy to deal with attractive interface so the user can easily find where and what parking spots are empty, the client duty is to connect with the server and ask for specific information for parking spots in certain buildings and floors, after it receives the information it displays it using the interface for the user. 6.1 What operating system to choose Since the main objective of the our project is to allow the client to check for empty parking spots easily and anywhere he wants, so we decided to use the mobile phone for the client. For mobile phones the three main operating systems widely known are Android IOS and Microsoft. 6.1.1 IOS (iPhone operating system) iOS is a mobile operating system developed by Apple. It was originally named the iPhone OS, but was renamed to the iOS in June, 2009. The iOS currently runs on the iPhone, iPodtouch, and iPad. Like modern desktop operating systems, iOS uses a graphical user interface, or GUI. However, since it is a mobile operating system, iOS is designed around touchscreeninput, rather than a keyboard and mouse. For example, applications, or "apps," can be opened by a single tap, rather than a double-click. Different screens can be viewed by swiping your finger across the screen, rather than clicking on open windows. Since iOS is designed to be simple and easy to use, it does not include several features found in a traditional operating system. For example, you cannot manage files andfolders like you can in Mac OS X or Windows. You also have limited access to iOS system settings. Instead of modifying application preferences from within each program, most settings need to be adjusted within the Settings app. Additionally, while you can run multiple programs at once, you can only view one open program at a time. [22]
  • 49. 49 Because IOS is not the most spread operating system for mobile phones and since it is so complicated we chosen not to start or project but in the future we might work on it. ‘Wiki’ Figure 6.1 IOS operating system [23] 6.1.2 Microsoft mobile “Microsoft Mobile is a multinational mobile phone and mobile computing device manufacturing company headquartered in Espoo, Finland, and a wholly owned subsidiary of Microsoft. It is a legal body that oversees and legally represents the activities in the design, development, manufacture and distribution of mobile phones, smartphones, tablet computers, related accessories and services. Microsoft Mobile was established following the acquisition of Nokia's Devices and Services division by Microsoft, which was completed in April 2014. Microsoft Mobile got the right to sell mobile phones under the Nokia brand name as part of a 10-year licensing agreement, as long as those phones are based on the S30+ platform which comprises feature phones. Future "Lumia" smartphones fell out of this license and couldn't be released bearing the Nokia brand In October 2014, it was announced that future Lumia devices would carry the Microsoft name and logo instead of "Nokia"”[24] Since Microsoft is not widely spread we have chosen not to work with it. 6.1.3 Android operating system Android OS is a Linux-based platform for mobile phones. Android was released under the Apache v2 open source license. Android was developed by Google and the Open Handset Alliance (OHA), a coalition of hardware, software and telecommunications companies. More than 30 companies were involved in the OHA, including Qualcomm, Broadcom, HTC, Intel, Samsung, Motorola, Sprint, Texas Instruments and Japanese wireless carriers KDDI and NTT DoCoMo. [25]
  • 50. 50 Figure 6.2 Android Studio Our choice was to use the android since it is the most used operating system in the world in addition it is an open source language so it is easy to learn. 6.2 How the client works The client is an android application that is connected to the server, to fully explain how the client works we will divide this chapter into two parts (User interface, Server connection). 6.2.1 The User Interface The interface must be clear and easy for the user to understand. At the beginning when the user starts the application opens the login screen see figure 6.4 Figure 6.4 Login screen If the user chooses to register a new user a registration screen opens see figure 6.5
  • 51. 51 Figure 6.5: Login screen If the client is an existing user he types his username and password and presses on the sign in button, if he is a new user he presses the registration button then types his username and password and press the register button, after that he is sent to the building choosing screen see figure 6.6 Figure 6.6 Building choosing screen After choosing what building and on new screen choosing what floor and pressing the display button the floor maps shows up showing what parking spots are empty or not, see figure 6.7.
  • 52. 52 Figure 6.7 Floor map See figure 6.8 with flow chart explaining the user interface Figure 6.8: User Interface flow chart
  • 53. 53 6.3 Server Connections To connect the server with client we need a communication technology either wired or wireless, since the main idea of our project is to get the clients life easier, so we decided that we need a wireless technology, also the wireless technology must work on far distance for the user to view empty parking spots from their homes, for the previous reasons we choose TCP/IP protocol. "The Internet protocol suite is the computer networking model and set of communications protocols used on the Internet and similar computer networks. It is commonly known as TCP/IP, because its most important protocols, the Transmission Control Protocol (TCP) and the Internet Protocol (IP) were the first networking protocols defined in this standard. It is occasionally known as the DoD model, because the development of the networking model was funded by DARPA, an agency of the United States Department of Defense. TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication language or protocol of the Internet. It can also be used as a communications protocol in a private network (either an intranet or an extranet). When you are set up with direct access to the Internet, your computer is provided with a copy of the TCP/IP program just as every other computer that you may send messages to or get information from also has a copy of TCP/IP. [26] When using TCP/IP protocol we need to set an IP address and port for the client and server to communicate within, for the client we use a local IP which changes as the client change, while the IP address for the server is a global static IP address any client can reach when connected to the internet. For our project we used a local IP address for both client and server but in future work we will use a static IP. To make a tcp ip connection we used a library called tcpclient[27], which has a couple of commands: run to open the socket with ip address and port number of the server and wait for message to be received, send message to send message to server, stop client command to close socket, receive message command to use the received message as a string, see figure 6.9 explaining how the library works
  • 54. 54 Figure 6.9 TCP client library
  • 55. 55 For the connection to start the Client opens a socket using the run command, after the connection is established the Client enters his user name and password if he is already registered user and registers if he is new user, after entering the user name and password and submitting them using the buttons explained in the user interface section, a message saying "Reg/username/password" or "Sign/username/password", is sent to the client using the send message command, where the "/" is used to make it easy for the server to split the message into three parts the first one to know if the user is signing in as an old user or registering a new user, the second part to know what the username is and the third one to know what the password is. After the server receive the login messages he checks his database if the information is valid or not and if they are it sends an "Accepted" message else it send a "Denied" message. If the client receives using the receive message command a "Denied" message the program displays a textbox for the user noting that the user name or password not valid, If an "Accepted" message is received the layout of the program changes to allow the user to choose which building he wants, After choosing which building the user has to choose what floor he is looking for and after he presses the button for the floor a message of "Build/building number/floor number" is sent for the server using the send message command as we said before "/" is used to split the message into three parts first part for the server to know that where are asking for what parking spots are empty in a specific building, second for letting the server know what building we have chosen and the third one to ask for a certain floor. Now if the user wants to update his information on a certain floor he send a message of "Ref/Building number/Floor number" using send message command and the server response to that message with the updated information for that building and floor. A message is received from the server using the message received command as the following, “Floor number/Sensor1 x axis place Sensor1 y axis place available or not / Sensor2 x axis place Sensor2 y axis place available or not and so on until all parking spots location and availability are sent. After that the program splits it into an array of strings using split on (‘/’) where the first string in the array represents the floor number and the second has all information about the first sensor and the third has all information about the second sensor and so on, after that we split each sensor on (“ ”) and save on a new string array, which will divide it into three parts first part it x location second is y location third is available or not. After that we use a command that takes the map as background and place each sensor on top of it using the coordinates sent by the server and the color of the box will be green if empty and red if occupied see figure 6.10 for explaining on how we draw images.
  • 56. 56 Fig 6.10 Drawing the Image command See figure 6.11 to explain how we connect with the server.
  • 57. 57 Fig 6.11 Client Connection to the Server
  • 58. 58 To help us see the connection of the TCP/IP at each side we used a program called Hercules, which is a program that acts like a server or client for a specific port which helps us connect without needing a real server and test our server without needing a real client, see figure 6.9 Figure 6.9: Hercules program
  • 59. 59 CHAPTER SEVEN: FUTURE WORK In this chapter we will talk about our future work, and the additional features we can add to the system to make it more advanced. This chapter is divided into four parts, Sensor and sinks nodes enhancements, Server enhancements, Client enhancements, and overall system enhancements. 7.1 Sensor and sink nodes enhancements When using a wireless sensor node the most important issue to be considered is the power consumption and battery life of the sensor node; also it’s important to keep in mind the range of transmission between the nodes. In this section we will provide solutions for these issues. 7.1.1 Using three axis AMR sensor Since the three axis AMR sensor is a passive element it has very low power consumption; this feature will extend the life of the battery which will make the system more reliable. In addition to this very important feature, the three axis AMR sensor can detect metallic vehicles very accurately, since it only detects metallic objects it will not respond to any human interference on top of the sensor which is a problem we faced using ultra sonic sensors. Since it is a three axis sensor it will only respond to large objects extending in three dimensions. 7.1.2 Battery life parameter We can’t detect that the battery has fully drained out until the sink node notices that it didn’t receive anything from the dead sensor for five hours which will cause misbehavior in the system. To solve this problem we will add an extra parameter to the packet sent from the sensor node to the sink node containing information about the battery status this will help the sink node know that the battery of that sensor is low. This will help the supervisor to know when to exchange the battery; also it will give the sink node the ability to control the sleeping duration of the sensor node by making it inversely proportional to the battery life which will increase the battery life as it gets low. 7.1.3 External Antenna In large parking lots, the main concern would be able to transmit our data over large ranges since the sensor nodes might be further away from the sink node. In future works adding an external might be necessary for the sensor nodes to extend its transmission range over the entire parking lot. 7.1.4 Ad-Hoc Network As the number of parking spaces increase within a parking lot, there would be an increase in number of interconnected nodes within the network. It is therefore more efficient to connect our network as an Ad-Hoc network to ensure reliability and stability of our system. This also reduces the power as the transmission range would decrease when sending data through neighboring nodes. Another advantage in using Ad-Hoc network is that it reduces collision between the nodes since it transmits at shorter ranges.
  • 60. 60 7.1.5 Photovoltaic Cell PV cells absorb sunlight energy and stores it as an electrical power. In outdoor parking lots, the sunlight in the morning would store electrical power that can be used throughout the rest of the day. The sensor nodes will then operate at free energy, which makes it unnecessary to exchange the batteries for a long time. This reduces the ongoing cost of our system since less maintenance and batteries would be needed. 7.2 Server enhancements The objective of the server is to act as a connection node between the sink node and the client but that is not the only objective also it should give information about the system, to make the server more efficient many enhancements must be made on it. 7.2.1 Upgrading the database For the server to be able to give information about the system it should have a large database including everything about the server, in our project the database consisted of four tables as described in chapter five. In the user table we will add columns for credit card number for online parking spots reservation, add information that state wither the user is a active user or not, user’s credit and his rating for our parking system. In the building table we will add wither the building is closed or not and wither it has special parking lots or not for example for handicapped people. In the parking spot table we will add information about each parking spot wither it is special or not and wither it is covered or not and wither it can be reserved or not. 7.2.2 Administrator monitoring A good feature to be added to the system is to give the administrator the ability to monitor the system from his office. The administrator will be able to know how many clients are connected to the system, and how frequently each parking spot is occupied, also it will give him information on what parking spots get reserved the most, and what sensors run out of batteries so he can exchange them. 7.2.3 Using SSH protocol with TCP/IP Since we are planning to make it possible for the client to reserve parking spots our connection should be secure so that the credit card credentials don’t get stolen, since TCP/IP protocol doesn’t provide this security we should use another protocol which is known as SSH. “Secure Shell (SSH) Protocol is a protocol for secure network communications designed to be relatively simple and inexpensive to implement. The initial version, SSH1, focused on providing a secure remote logon facility to replace Telnet and other remote logon schemes that provided no security” [28] to implement the SSH protocol on server using C# language we can use the help of a library called renci. [29]
  • 61. 61 7.3 Client enhancements In the client side there are many features to be added to make the client life easier and since the client is the most important person in the system the enhancements to be made must make the program easier to use and more efficient. 7.3.1 Using the GPS device We can use the GPS device on the smart mobile phone in many ways. To let the client know what building is closer to him we need to know his location and by comparing each building location with his location we can tell the client which building he should head to. We must know how far the client is when reserving a parking spot to calculate how much time he needs to reach the parking spot he reserved. 7.3.2 Developing client application for different operating systems Our ambition is to reach as many people as we can and when we are only using one operating system we will not reach everybody, so our future plane is develop client application for both ios and Microsoft mobile because they are the most used after android. 7.3.3 Adding reservation option In the future we are planning to add an option for clients to reserve a parking spot before coming to the parking building by paying extra charges; the payment method will be using credit cards that will be saved in the database.
  • 62. 62 CHAPTER EIGHT: FINANCIAL STUDY We will study the analysis of financially implementing our system in the University of Jordan (JU). In JU there are four parking lots and each parking lot has around 100 parking spaces, this gives us a total of 400 parking spaces. We will assume that parking lot operates 16 hours a day and that the number of vehicles differs from one time to another. The monitoring of the parking lot can be divided into morning, noon, afternoon, and evening. During the morning there the parking lot would be most likely fully occupied. If we assume that the reservation of a parking space would cast 25 cents, and that no cars leave or enter during this period this would give an income of 0.25*400= 100JD if all spaces have been reserved . During noon the parking lots would be less crowded, assuming that half of the parking lot has been reserved this gives an income of 50JD. In afternoon we will reduce the income assuming that only one fourth of the parking lot has been reserved, this gives an income of 25JD. Assuming that at night no reservations are made this gives a total net income of 175JD daily. This gives a total net income of 5250JD monthly and 63,000JD yearly. Now we need to write down the cost of our project to calculate the total profit. ATmega328-microcontroller costs around 11.28JD per one unit, when buying larger quantities the price would be reduced to 4.3 JD per unit. The MX-05V model’s price is 3.6 for small quantities, for larger quantities the price would be 1.89 JD. The HC-SR04 ultrasonic sensor costs 4.3 JD per single unit and 0.61 when buying larger quantities. This gives an overall cost of 400*(4.3+1.89+.61) = 2720 JD for the components bought. We also assume a yearly maintenance cost of 2000 JDs. This gives a total yearly profit of around 63000-(2720+2000) = 58,280 JDs.
  • 63. 63 CHAPTER NINE: REVIEW AND DISCUSSION An automated parking system using wireless sensor networks was proposed. The hardware components used were briefly described and were chosen upon certain studies. The communication link protocol was developed to ensure maximum performance with reduced possibility of collision between the nodes. Moreover, the sensor nodes and sink nodes were interconnected forming a star network topology. In our system it is the sink node that decides whether or not the parking space is occupied. This reduces burden on the sensor nodes and lowers its power consumption. After computing the status of the parking lot in the sink node, it is serially transmitted to the PC to be stored within tables in the database. Then the data is mapped out and sent to the android application to be viewed by the users to retrieve the status of the parking lot. Due to a large increase of vehicles in Amman, drivers find a difficulty in finding a free parking space in overcrowded areas. Our project simplifies and makes it easier for drivers to save time finding a parking space. Also it financially benefits governmental or private sectors that implement this project through reservations of parking spaces.
  • 64. 64 REFERENCES [1] Parking Guidance System, 2009 http://www.rsiconcepts.com/parking-guidance-system.php [2] E.-J.P. Manoury, et al., "A 36x48 mm2 48M-pixel CCD imager for professional DSC applications," in Electron Devices Meeting, 2008. IEDM 2008. IEEE International, pp. 1- 4, 2008. Available at http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4796668 [3] Nikon D60, Autofocus System, 12 June 2008. [4] IKALOGIC S.A.S, Infra-Red Proximity Sensor at https://www.ikalogic.com/infra- red-proximity-sensor-part-1/ [5] Ultrasonic Sensors, Their working and its embedded application, 25th of March 2014 [6] J.E. Lenz et al. 1992. "A Highly Sensitive Magneto resistive Sensor," Proc Solid State Sensors and Actuator Workshop. [7] Arduino Uno vs Raspberry Pi vs Beaglebone, Author, Brandon, May 3rd , 2013 http://blog.mcmelectronics.com/post/Arduino-Uno-Raspberry-Pi-and-BeagleBone- Black#.VoVpnPl97IU [8] RFID Centre, Wireless & Mobile Based Hardware & Software, Global wireless standards 2003. [9] ZigBee Specification , ZigBee Document 053474r06, Version 1.0 , December 14th , 2004. [10] Silicon Labs, EmberZNet PRO ZigBee Protocol Stack Software , 2015. https://www.silabs.com/products/wireless/zigbee/Pages/zigbee-software.aspx [11] Sparkfun, IR communication at https://learn.sparkfun.com/tutorials/ir- communication [12] Hobby Components, 433 MHZ WIRELESS MODULES MX-FS-05V at http://hobbycomponents.com/wireless/168-433mhz-wireless-modules-mx-fs-03v-mx-05 [13] Electrical Engineering, How To Wire Up Ultrasonic Transducer, December 12th ,2013 at http://electronics.stackexchange.com/questions/93458/how-to-wire-up- ultrasonic-transducer [14] Arudino, Virtual Wire, author , Mike Mc Cauley , March 22nd , 2013
  • 65. 65 [15] Introduction to the Oracle Database, Oracle Database Online Documenatation, 10g release 2 , 2015 [16] TechTarget, SQL server Definition, Relational database management system guide: RDBMS, January 2006 [17] Wikipedia, 2015, https://en.wikipedia.org/wiki/Microsoft_Visual_Studio [18] Introduction to the C# Language and the .NET Framework, 2015 https://msdn.microsoft.com/en-us/library/z1zx9t92.aspx [19] DebaterOfMath C# TCP tutorial https://www.youtube.com/watch?v=uXFso7xSSWk [20] MySQL Reference Manual, Overview of the MySQL Database Management System, 2015 at http://dev.mysql.com/doc/refman/5.7/en/what-is.html [21] ProgrammingKnowledge, tutorials C# Local Database (SQL server) +SQL Database Tutorial [22] TechTerms, Software Terms: iOS Definition, October 22nd , 2011 at http://techterms.com/definition/ios [23] Wikipedia, 2015. https://en.wikipedia.org/wiki/IOS [24] Wikipedia, 2015 https://en.wikipedia.org/wiki/Microsoft_Mobile [25] Android OS definition , author, Margaret Rouse http://searchenterpriselinux.techtarget.com/definition/Android [26] TCP/IP (Transmission Control Protocol/Internet Protocol) definition [27] Myandroidsolutions Tutorial, 2012 http://www.myandroidsolutions.com/2012/07/20/android-tcp-connection-tutorial/ [28] Cisco, Protocol Basic: Secure Shell Protocol, volume 12 no.4,author William Stallings, January 2006. [29] Code Beta, Renci SSH for .NET, February 13th , 2015 http://codebeta.com/post/renci-ssh-for-net
  • 66. 66