You are on page 1of 62

University Of Science and Technology

Faculty of Engineering

Department of Computer and Electronic

Systems Engineering

Automatic Car Parking System


A dissertation Submitted in Partial Fulfillment of the Requirement for
the B.Sc. (Honors) Degree in Computer and Electronic System
Engineering

Submitted by:

Tahir Hussain Hassan Mirghani

Supervised by:

Dr. Awadallah Tayfor

April 2018

1
2
‫اآليـــــة‬

‫ﭧﭨ‬

‫ﭽﭶ ﭷ ﭸ ﭹ ﭺ ﭻ ﭼ ﭽ ﭾ ﭿ‬

‫ﮀﮁﮂ ﮃﮄ ﮅﮆﮇﭼ‬
‫صدق اهلل العظيم‬
‫لقمان‪٤١ :‬‬

‫‪I‬‬
‫إىل كن األعصاء يف حياتي كن مو إيتم بي وزعاني‬

‫إىل مو عطفًا غمسني وحهانًا كاى عونا لي يف شق طسيقي‬

‫أمي‬

‫إىل الري شزعين يف احلياة وضقاني مو حبٌ وحهانٌ‬

‫أبي‬

‫إىل كن صديق خممص وويف عشت معًم أيام الدزاضة‬

‫إىل كن أضتاذ قادني إىل الدزب املهري وأوصمين إىل غاية العمم‬

‫اىل الدكتوزة ‪ :‬فتحية حطو مريغين‬

‫زمحة اهلل تغشاك ومجعها اهلل بك يف أعمى اجلهاى‬

‫‪II‬‬
‫الشكر والعرفان‬
‫اتقدم بالشكر أجزله وبالعرفان كله إلى اساتذتي الذين لم يبخلوا‬

‫علينا بالمعلومات واخص بالشكر الدكتور ‪:‬‬

‫عوض اهلل طيفور‬


‫الذي تكرم باإلشراف على هذا العمل ولوال توجيهاته لما خرج بهذه‬

‫الصورة ‪،،‬‬

‫والشكر لكل من ساهم ونصحنا إلتمام هذا البحث ‪،،،‬‬

‫‪III‬‬
Abstract

The objective of this project is to implement the automatic car parking by


controlling the entry and exit of cars and to know the status of the parking
before entering. The project consists of sensors , a controller, motors to enter
and exit, and other actuator to know the authorized persons .
This system helps to reduce the problems of parking in large cities, crowded
markets, and malls.

IV
‫المستخلص‬

‫انهذف يٍ هذا انًشزوع هى تنفيذ يىاقف انسياراث األوتىياتيكيت يٍ خالل انتحكى في دخىل وخزوج‬
‫انسياراث ويعزفت حانت يىاقف انسياراث قبم انذخىل‪ .‬يتكىٌ انًشزوع يٍ حساساث‪ ،‬و وحذة تحكى‪،‬‬
‫يىتىراث نهذخىل وانخزوج‪ ،‬و يعزف نهتعزف عهى األشخاص انًخىنيٍ نهى بانذخىل‪.‬‬
‫يساعذ هذا اننظاو عهى انحذ يٍ يشاكم يىاقف انسياراث في انًذٌ انكبيزة واألسىاق انًزدحًت ويزاكز‬
‫انتسىق‪.‬‬

‫‪V‬‬
Table of Contents
‫االيت‬ I
‫االهذاء‬ II
ٌ‫انشكز وانعزفا‬ III
Abstract IV
‫انًستخهض‬ V
Table of Contents VI
List of Figures VIII
Table of Abbreviations IX
Chapter One : Introduction
1.1 Background 1
1.2 Problem Statements 2
1.3 Objective 2
1.4 Methodology 2
1.5 Layout 3
Chapter Two : Theoretical Background
2.1 Introduction 4
2.2 Automatic Car Parking System History 4
2.3 Microcontroller 6
2.3.1 Application Of Microcontroller 7
2.3.2 Types Of Microcontroller 8
2.4 Sensors 9
2.5 Electronic motors 11
Chapter Three : System Hardware and Software
3.1 System Description 13
3.2 System Hardware 14
3.2.1 Arduino 14
3.2.2 RFID 15
3.2.3 RFID Tag 16

VI
3.2.4 Servo Motor 16
3.2.5 Ultrasonic 17
3.2.6 Liquid Crystal Display 16x2 18
3.3 System Software 19
3.3.1 Flow Chart 20
3.3.2 Program Code 23
3.3.3 System Simulation 35
Chapter Four : System Implementation and Testing
4.1 Introduction 36
4.2 System Implementation 36
4.3 System Testing 38
4.3.1 case 1 38
4.3.2 case 2 39
4.3.3 case 3 40
4.3.4 case 4 41
Chapter Five : Conclusions and Recommendation
5.1 Conclusion 42
5.2 Recommendation 42
References 43
Appendices

VII
List of Figures
Figure (3.1) Component Block Diagram 13
Figure (3.2) Arduino UNO 14
Figure (3.3) RFID 15
Figure (3.4) RFID Card 16
Figure (3.5) Servo Motor 17
Figure (3.6) Ultrasonic 18
Figure (3.7) LCD 19
Figure (3.8) Simulation 35
Figure (4.1) System Implementation 37
Figure (4.2) Case 1 38
Figure (4.3) Case 2 39
Figure (4.4) Case 3 40
Figure (4.5) Case 4 41

VIII
Table of Abbreviations
AC Alternating current
℃ Celsius
CMOS Complementary Metal Oxide Semiconductor
dB Deutsche Bahn
DC Direct current
FIFO Frist In First Out
GHz Giga Hertz
GIS Geographic information system
GND Ground
GNU General Public License

I2C Inter Integrated Circuit

ICSP In circuit serial programming

IDE integrated development environment

IIHS Insurance Institute for Highway Safety

IMU Inertial Measurement Unit

INT Interrupt
I/O input/output
ISM Industrial Scientific and Medical
KB Killo byte
TCP Transmission Control Protocol
TV Television
LCD liquid crystal display
LED Light Emitting Diode

mA Milli Ampere

Mbps Megabits Per Second

MCU Marvel Cinematic Universe


MEMS Micro Electro Mechanical Systems
MHz Mega Hertz

IX
Mm Millimeter
MPU Midi Processing Unit
mW Milli Watt
NMEA National Marine Electronics association
UARTs Universal Asynchronous Receiver Transmitters
UDP User Datagram Protocol
USB Universal Serial Bus
PANs personal area networks
PC Personal Computer
PIO Programmable Input/output

PWM Pulse Width Modulation


RF Radio Frequency
RS Register select
R.U.R Rossum's Universal Robots
RW Read/Write
SCL serial clock
SDA synchronize all data
SIM Subscriber Identity Module
SROM Static Random Access Memory
SPP Serial Port Protocol
UHF Using Short Wavelength
US United States of America
USB Universal Serial Bus
V Voltage

X
CHAPTER ONE
INTRODUCTION

1
CHAPTER ONE

INTRODUCTION

1.1 Background

Parking system, techniques and equipment used to help the


challenge for all drivers say amateurs or the experts. As the number
of vehicles on the road are increasing tremendously from thousands to
millions, the traffic problems are bound to exist. Almost all major
cities are facing the parking problems, insufficient parking space
cause traffic jams, air pollution, health hazard etc. The price for
parking expansion is extremely high. Automatic parking is a parking
system that utilizes various technologies to efficiently manage the
parking . In the near future the demand for the intelligent parking
service will increase because the rapid growth in the automotive
industries.

The automatic management of parking lots by accurate


monitoring and providing service to customers and administrators is
provided by such emerging services. A cost effective solution to this
service can provided by RFID that consists of radar and tag placed in
area of interest or in existing parking lots expensive cabling and are
capable of adjusting with the cheap and easily available sensors. An

1
automatic car parking system is a solution to this ordeal. This
vehicular technology has been implementation using many other
systems but a cost effective, simple and accurate solution will greatly
appreciated. This project explains in detail.

1.2 Problem Statement

Searching for an available parking has been very difficult this days
because there is a few spaces to parking, because of that this will
waist the driver time and may not even found one.

1.3 Objectives
 To reduce man power.
 To getting high efficiency with sensitive.
 To reducing the material cost.
 To design and implement automatic parking system.

1.4 Methodology

This project includes two parts: hardware and software. The


hardware phase designs and develops an automatic parking system
which is controlled by (Arduino Uno) microcontroller. The software is
written using Arduino-1.6.5.

The insufficient parking space and traffic jams reduced by


taking the advantage of RFID , ultrasonic sensors and
microcontrollers. When the car come to the parking and when the car

2
be close enough to RFID transmission it will make the RFID card
circuit turn on and sends the card information to RFID receiver then
send the number to microcontroller to check the number of the free
space for car parking . If there are free space it will send a text
message to the LCD with the number of free space to park the car, at
the same time the microcontroller sends signal to servo motor to open
the barrier, then the driver will go to the empty spot to park the car .
When the car be above the parking spot it will intercept with the
sensor which it makes these parking spot unavailable . This loop will
do until the parking being full. If the car come and the parking is full
this message will appear on LCD “sorry no more space”.

1.5 Layout

This project consists of Five chapters, Chapter One gives an


introduction to the work. Chapter Two presents theoretical and
background. Chapter Three presents system hardware and system
software. Chapter Four presents system implementation and testing.
Finally Chapter Five gives an conclusion and recommendation.

3
CHAPTER TWO
THEORITICAL
BACKGROUND AND
LETRITURE REVIEW

4
CHAPTER TWO

THEORITICAL BACKGROUND AND


LETRITURE REVIEW
2.1 Introduction

Automatic car parking system is an integrated system to organize cars


in public parks. The system will be used for every slot in park. The
motivation of this project is to help drivers. And make the payment
way easier. Our projects consist of two sides, the first one is the main
unit, and this unit will be located in every spot in the parking lot.
These units will be connected with our second, the coordinator. So
every coordinator will control the information from and to the units
connected with it.

2.2 Automatic Car Parking System History

Over the years, the number of parking-system-related technologies


has increased. Car parking systems have been around almost since the
time cars were invented. In any era where there has been a significant
amount of traffic, there have been car-parking systems (Melsen 2013).
Car parking systems were first developed in the early 20th century in
response to the need for storage space for vehicles. (Melsen 2013)
Indeed, the using of automatic parking systems dated back to the
1920s, as automated parking systems appeared in U.S. cities such as

4
Los Angeles, Chicago, New York, and Cincinnati. In addition, one of
the Kent automatic parking garages in New York is an art deco
landmark that was converted into luxury condominiums in 1983. A
system that is prevalent all over Japan is the “Ferris-wheel,” or
“paternoster system”, which — was created by the Westinghouse
Corporation in 1923 and built in 1932 on Chicago‟s Monroe Street.
In the past two decades, the concept of intelligence in terms of smart
parking systems became more popular in the most vibrant cities,
especially in malls and shopping centres. (Melsen 2013) In the mid-
80s, the systems used for parking relied mainly on the traditional
method of pushing a button in the device next to the checkpoint to get
a parking ticket and on exiting, the driver must pay before inserting
their ticket in order for the barrier to rise. This was the method used to
determine how many cars came in and out the system each day, and it
was used to count the number of vacant spaces available. It began by
utilizing different methods such as sensors or barriers to be able to
know the status of parking lots. All these methods developed
dramatically further until recently the term „smart city vision‟
emerged.

5
2.3 Microcontroller

A microcontroller is an integrated chip that is often part of an


embedded system. The microcontroller includes a CPU, RAM, ROM,
I/O ports, and timers like a standard computer, but because they are
designed to execute only a single specific task to control a single
system, they are much smaller and simplified so that they can include
all the functions required on a single chip.

A microcontroller differs from a microprocessor, which is a general


purpose chip that is used to create a multi-function computer or device
and requires multiple chips to handle various tasks. A microcontroller
is meant to be more self-contained and independent, and functions as
a tiny, dedicated computer.

The great advantage of microcontrollers, as opposed to using larger


microprocessors, is that the parts-count and design costs of the item
being controlled can
be kept to a minimum. They are typically designed using CMOS
(complementary metal
oxide semiconductor) technology, an efficient fabrication technique
that uses less power
and is more immune to power spikes than other techniques.

6
2.3.1 Application Of Microcontroller

Microcontrollers are typically used where processing power isn't so


important. Although some of you out there might find a microwave
oven controlled by a UNIX system an attractive idea, controlling a
microwave oven is easily accomplished with the smallest of
microcontrollers. On the other hand, if he or she putting together a
cruise missile to solve the problem of his or her neighbor's dog
barking at 3 in the morning, he or she will probably need to use
processors with a bit more computing power. Embedded processors
and microcontrollers are used extensively in robotics. In this
application, many specific tasks might be distributed among a large
number of controllers in one system. Communications between each
controller and a central, possibly more powerful controller (or
micro/mini/mainframe) would enable information to be processed by
the central computer, or to be passed around to other controllers in the
system (Barr, 1997).

A special application that microcontrollers are well suited for is data


logging. Stick one of these chips out in the middle of a corn field or
up in a balloon, and monitor and record environmental parameters
(temperature, humidity, rain, etc). Small size, low power
consumption, and flexibility make these devices ideal for unattended
data monitoring and recording.

7
2.3.2 Types Of Microcontroller

There are several microcontroller architectures and vendors including:

- ARM core processors (Many vendors).


ARM Cortex-M cores are specifically targeted towards
microcontroller applications.
- Atmel AVR (8-bit), AVR32 (32 bit), and AT91SAM (32-bit).
- Cypress Semiconductor's M8C Core used in their PSoC
(Programmable System-on-Chip).
- Free scale Cold Fire (32-bit) and S08 (8-bit).
- Free scale 68HC11 (8-bit).
- Intel 8051.
- Infineon: 8-bit XC800, 16-bit XE166, 32-bit XMC4000 (ARM
based Cortex M4F), 32-bit TRICOR and, 32-bit Aurix TRICOR
Bit microcontrollers.
- MIPS.
- Microchip Technology PIC, (8-bit PIC16, PIC18, 16-bit
dsPIC33/PIC24), (32-bit PIC32).
- NXP Semiconductors LPC1000, LPC2000, LPC4000 (32-bit),
LPC900, LPC700 (8-bit).
- Parallax Propeller.
- PowerPC ISE.
- Rabbit 2000 (8-bit).

8
- Renesas Electronics: RL 78 16-bit MCU; RX 32-bit MCU;
Super H; V850 32-bit MCU; H8; R8C 16-bit MCU.
- Silicon Laboratories Pipelined 8-bit 8051 Microcontrollers and
mixed-signal ARM-based 32-bit microcontrollers.
- STMicroelectronics STM8 (8-bit), ST10 (16-bit) and STM32
(32-bit).

2.4 Sensors
Sensors and sensor systems are vital to our awareness of our
surroundings and provide safety, security, and surveillance, as well as
enable monitoring of our health and environment. A transformative
advance in the field of sensor technology has been the development of
smart sensor systems. The definition of a smart sensor may vary, but
typically at a minimum a smart sensor is the combination of a sensing
element with processing capabilities provided by a microprocessor.
That is, smart sensors are basic sensing elements with embedded
intelligence. The sensor signal is fed to the microprocessor, which
processes the data and provides an informative output to an external
user. A more expansive view of a smart sensor system, which is used
in this article, a complete self-contained sensor system that includes
the capabilities for logging, processing with a model of sensor
response and other data, self-contained power, and an ability to
transmit or display informative data to an outside user. The

9
fundamental idea of a smart sensor is that the integration of silicon
microprocessors with sensor technology can not only provide
interpretive power and customized outputs, but also significantly
improve sensor system performance and capabilities.

The smart sensor possesses several functional layers: signal detection


from discrete sensing elements, signal processing, data validation and
interpretation, and signal transmission and display. Multiple sensors
can be included in a single smart sensor system whose operating
properties, such as bias voltage or temperature, can be set by the
microprocessor. The sensor elements interface to signal control and
conditioning stages that will provide both excitation and signal data
logging and conditioning. The data acquisition layer will convert the
signal from analog to digital and acquire additional parameters of
interest to provide compensation when needed for thermal drift, long
term drift, etc. The embedded intelligence will continuously monitor
the discrete sensor elements, validate the engineering data being
provided, and periodically verify sensor calibration and health. The
processed data becomes information and can then be transmitted to
external users. The user can choose the complexity of the data
transmitted: from a single reading to a complete download of the
sensor system‟s parameters.

10
2.5 Electronic Motor
Electronic motors are essentially inverse generators: a current through
coils of wire causes some mechanical device to rotate. The core
principle underlying motors is electromagnetic induction. By
Ampere's law, the current induces magnetic field, which can interact
with another magnetic field to produce force, and that force can cause
mechanical motion. A motor is basically generator run backwards
(using current to produce motion rather than motion to produce
current), and in fact the modern era of practical motors was initiated
by accident when one DC generator was accidentally connected to
another in 1873, producing motion and leading Zenobe Gramme to
realize that his generators could also be used as motors. The first AC
motors(synchronous and then induction) were invented by Tesla in the
1880s.Electric motors are estimated to now consume over 25% U.S.
electricity use (though some estimates are even higher, to up to 50%,
and over 20%of U.S. total primary energy). While large electric
motors can be extremely efficient at converting electrical energy to
kinetic energy (_ > 90%), those efficiencies are only achieved when
motors are well-matched to their loads. Actual efficiencies in normal
usage practice in the U.S. are substantially sub-optimal (motors are
oversized for the loads they drive). Small electric motors are also
inherently less efficient (more like 50%). Motor design and, even

11
more importantly, motor choice and use practices are an important
area of potential energy conservation. This reading is a (very brief)
introduction to four most basic types of electric motors:
 Brushed DC
 Brushless DC
 Synchronous AC
 Induction

12
CHAPTER THREE
SYSTEM HARDWARE
AND SOFTWARE

13
CHAPTER THREE

SYSTEM HARDWARE AND SOFTWARE

3.1 System Description


Most automatic parking systems contains a processing element (a
microprocessor or microcontroller), sensors, actuators, and display
screen and in modern Automatic Parking Systems may include
devices to be linked to the network. This system is built using the
following hardware as shown in Figure 3.1

Figure 3.1 Block Diagram

13
3.2 System Hardware
3.2.1 Arduino

Board based on the at mega 32 (datasheet) .it has 14 digital input


output pins (of which 6 can be used as PWM outputs) 6 analog inputs
,a 16 MHz ceramic resonator a USB connection a power jack an ICSP
header and a reset button it contains everything needed to support the
microcontroller simply connect it to a computer with a USB cable or it
with a ac to dc adapter or battery to get started as shown in Figure 3.2

Figure3.2 arduino UNO

14
3.2.2 Radio Frequency Identification (RFID)

RDM630 125KHz card mini-module is designed for reading code


from 125KHz card compatible read-only tags and read/write card . It
can be applied in office/home security, personal identification, access
control, anti-forgery, interactive toy and production control systems
etc .RDM630 Series non contact RFID module, use the advanced RF
receiving circuit and embedded MCU design, combing with high
efficient decoding algorithm, to finish the data receive of EM4100 and
all the compatible cards. This is a very popular RFID card read
module for arduino users, it can read 125K EM4100 series RFID card.
This module is easy to use, serial port connect to arduino MCU after
power up, when RFID car enter into card reading range, this module
will send the card number to arduino by UART .as shown in Figure
3.3

Figure 3.3 RFID

15
3.2.3 Radio Frequency Identification RFID Tag

The EM 4100 125 kHz RFID Card is one of the most popular models
in the proposed range of read-only proximity cards, i.e. not offering
the possibility to store data.It has been designed in a standard format
so it can be easily slipped into your card holder or wallet. Compatible
with the RFID 125 kHz Module for Arduino, Raspberry Pi, Intel
Galileo and Waspmote, it has a unique identifier. As shown in Figure
3.4

Figure 3.4 RFID Card

3.2.4 Servo Motor

A Servo is a small device that has an output shaft. This shaft can be
positioned to specific angular positions by sending the servo a coded
signal. As long as the coded signal exists on the input line, the servo
will maintain the angular position of the shaft. As the coded signal
changes, the angular position of the shaft changes. In practice, servos

16
are used in radio-controlled airplanes to position control surfaces like
the elevators and rudders. They are also in radio-controlled cars,
puppets, and of course, robots. Servos are extremely useful in
robotics. The motors are small, as shown in Figure 3.5, the motor have
a built in control circuitry, and are extremely powerful for their size. It
draws power proportional to the mechanical load. A lightly loaded
servo, therefore, doesn't consume much energy.

Figure 3.5 Servo Motor

3.2.5 Ultrasonic

Ultrasonic Range Sensor use to calculate distances from objects.


Ultrasonic Range Sensor it's an IC that works by sending an
ultrasound pulse at around 40KHz. It then waits and listens for the
pulse to echo back, calculating the time taken in microseconds you
can trigger a pulse as fast as 20 times a second and it can determine
objects up to 3 meters away and as nears 3cm. it needs a 5V power
supply to run. Ultrasonic Range Sensor have only 4 pins to Power,
Ground, Trigger and Echo. See Figure 3.6

17
Figure 3.6 Ultrasonic

3.2.6 Liquid Crystal Display 16x2

Liquid Crystal Display (LCD) screen is an electronic display module


and find a wide range of applications. A 16x2 LCD display is very
basic module and very commonly used in various devices and circuits.
These modules are preferred over seven segments and other multi
segment LEDs. The reasons being: LCDs are economical; easily
programmable; have no limitation of displaying special and even
custom characters (unlike in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are
2 such lines. In this LCD, each character displayed in 5x8-pixel
matrix. This LCD has two registers namely, Command and Data as
shown in Figure 3.7

18
Figure 3.7 LCD 16x2 pin description

3.3 System Software

For system software the microcontroller Arduino used to create debug and boot the code,
The code written with C++ programming language compiler for the arduino, It is
seamless and easy to write, build and debug application C++ language, The system
software is containing three parts, which are the program programming code, flow chart,
simulatation.

19
3.3.1 Flow Chart

Start

Configure I/O ports

Configure LCD

Initialize LCD

Configure Servo

Read RFID

No If RFID
High

Yes

Check Distance

20
X

No If
Print A/V distance
<10

Yes

Print N/A

Check Distance1

No If
Print A/V
distance1
<10

Yes
Print N/A

Check Distance2

Yes

No If
Print A/V distance2
<10

Yes

Print N/A

21
X

Check RFID

No If
seriel1

Yes

Print user1

No If
seriel2

Yes

Print user2

No If
seriel3

Yes

Print user3

22
3.3.2 Program CODE

#include <SoftwareSerial.h>

#include "RDM6300.h"

#include <LiquidCrystal.h>

#include <Servo.h>

SoftwareSerial rdm_serial(0, 1);

RDM6300<SoftwareSerial> rdm(&rdm_serial);

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

Servo myservo;

Servo myservo1;

int i=0;

int i1=0;

int i2=0;

int button = 3;

const int trigPin = A0;

const int echoPin = A1;

const int trig1Pin = A2;

const int echo1Pin = A3;

23
const int trig2Pin = A4;

const int echo2Pin = A5;

const int trig3Pin = 4;

const int echo3Pin = 5;

long duration;

int distance;

long duration1;

int distance1;

long duration2;

int distance2;

long duration3;

int distance3;

void setup()

Serial.begin(9600);

lcd.begin(16, 2);

myservo.attach(7);

myservo1.attach(6);

pinMode(button, INPUT);

24
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output

pinMode(echoPin, INPUT); // Sets the echoPin as an Input

pinMode(trig1Pin, OUTPUT); // Sets the trigPin as an Output

pinMode(echo1Pin, INPUT); // Sets the echoPin as an Input

pinMode(trig2Pin, OUTPUT); // Sets the trigPin as an Output

pinMode(echo2Pin, INPUT); // Sets the echoPin as an Input

pinMode(trig3Pin, OUTPUT); // Sets the trigPin as an Output

pinMode(echo3Pin, INPUT); // Sets the echoPin as an Input

lcd.print(" WELL COME");

delay(1000);

lcd.clear();

myservo.write(0);

myservo1.write(0);

void loop()

s:

25
lcd.setCursor(0, 0);

lcd.print(" P1: P2: P3: ");

delay(200);

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

digitalWrite(trig1Pin, LOW);

delayMicroseconds(2);

digitalWrite(trig1Pin, HIGH);

delayMicroseconds(10);

digitalWrite(trig1Pin, LOW);

duration1 = pulseIn(echo1Pin, HIGH);

distance1 = duration1*0.034/2;

26
digitalWrite(trig2Pin, LOW);

delayMicroseconds(2);

digitalWrite(trig2Pin, HIGH);

delayMicroseconds(10);

digitalWrite(trig2Pin, LOW);

duration2 = pulseIn(echo2Pin, HIGH);

distance2 = duration2*0.034/2;

digitalWrite(trig3Pin, LOW);

delayMicroseconds(2);

digitalWrite(trig3Pin, HIGH);

delayMicroseconds(10);

digitalWrite(trig3Pin, LOW);

duration3 = pulseIn(echo3Pin, HIGH);

distance3 = duration3*0.034/2;

// Prints the distance on the Serial Monitor

Serial.print("Distance: ");

Serial.println(distance);

27
Serial.print("Distance1: ");

Serial.println(distance1);

Serial.print("Distance2: ");

Serial.println(distance2);

Serial.print("Distance3: ");

Serial.println(distance3);

if (distance < 10){

i=1;

lcd.setCursor(1, 1);

lcd.print("N/A");

if ((distance > 10)&&(i==0)){

lcd.setCursor(1, 1);

lcd.print("A/V");

28
if (distance1 < 10){

i1=1;

lcd.setCursor(7, 1);

lcd.print("N/A");

if ((distance1 > 10)&&(i1==0)){

lcd.setCursor(7, 1);

lcd.print("A/V");

if (distance2 < 10){

i2=1;

lcd.setCursor(13, 1);

lcd.print("N/A");

if ((distance2 > 10)&&(i2==0)){

lcd.setCursor(13, 1);

lcd.print("A/V");

29
if (distance3 < 10){

i=0;

i1=0;

i2=0;

myservo1.write(90);

delay(2000);

myservo1.write(0);

delay(100);

if((i==1)&&(i1==1)&&(i2==1)){

goto s;

else

if (digitalRead(button)==HIGH){

goto l;

if (digitalRead(button)==LOW){

30
goto s;

l:

lcd.clear();

lcd.setCursor(0, 0);

lcd.println("ENTER CARD:");

static const unsigned long long my_id = 0x380082A8C4;

static const unsigned long long my_id1 = 0x0D0055E20A;

static const unsigned long long my_id2 = 0x0D0055E20A;

static const unsigned long long my_id3 = 0x0D0055E20A;

static unsigned long long last_id = 0;

last_id = rdm.read();

Serial.print("RFID:0x");

rdm.print_int64(last_id);

31
Serial.println();

if(last_id == my_id) {

Serial.println("USER1:");

lcd.setCursor(0, 1);

lcd.println("USER1:");

myservo.write(90);

delay(5000);

myservo.write(0);

lcd.clear();

goto s;

if(last_id == my_id1) {

Serial.println("USER2:");

lcd.setCursor(0, 1);

lcd.println("USER2:");

myservo.write(90);

delay(5000);

32
myservo.write(0);

lcd.clear();

goto s;

if(last_id == my_id2) {

Serial.println("USER3:");

lcd.setCursor(0, 1);

lcd.println("USER3:");

myservo.write(90);

delay(5000);

myservo.write(0);

lcd.clear();

goto s;

if(last_id == my_id3) {

Serial.println("USER4:");

lcd.setCursor(0, 1);

lcd.println("USER4:");

33
myservo.write(90);

delay(5000);

myservo.write(0);

lcd.clear();

goto s;

34
3.3.3 Simulation

Figure 3.8 System Simulation

35
CHAPTER FOUR
SYSTEM
IMPELEMENTATION AND
TESTING

36
CHAPTER FOUR

SYSTEM IMPELEMENTATION AND TESTING

4.1 Introduction
In this section , the system circuit will be implemented using the
component that mentioned in chapter three also testing the system to
ensure its performance.

4.2 System Impelementation


The microcontroller acts the core of the system, the
automatic car parking system can be diveded into three parts,
input unit, proccessing core, and the output unit.

The input is RFID(radio frequency reader) is used to support


the microcontroller within input signals that‟s required to do
proccess, groupe of sensors (ultrasonic sensor1,2,3,4). The
group of sensors is connected in PORT A(0 to 5) .

The sensors are used to read inside the parking, output


terminals are used to handle the output signals from the
microcontroller and the output terminals used in the LCD,
servo motor, those are used to change the cases inside default
value in microcontroller the LCD is connected in pin (2 to 16) , and
the servo motors is connected in pin 6,7. As shown in Figure 4.1

36
Figure 4.1 system impelementation

37
4.3 System Testing
In this section the system is start in 6 cases , how the car enter the
parking ,status of parkings is show in LCD, and cars exit from the
parking.

4.3.1 Case 1
When the car comes the RFID read the tag on the card , if the tag is
registered in the system the entry servo will open the barrier and the
LCD will show the available parking as shown in the Figure 4.3 after
the car parking in either P1 or P2 or P3 the parking availability will be
reduced.

Figure 4.3 case1

38
4.3.2 Case2
When the car comes the RFID read the tag on the card , if the tag is
registered in the system the entry servo will open the barrier and the
LCD will show the available parking as shown in the Figure 4.4 in
this case P2 or P3 after the car parking in either P2 or P3 the parking
availability will be reduced.

Figure 4.4 case P2 or P3

39
4.3.3 Case 3
When the car comes the RFID read the tag on the card , if the tag is
registered in the system the entry servo will open the barrier and the
LCD will show the available parking as shown in the Figure 4.5 after
the car parking in P1,P2 the parking will be full

Figure 4.5 P3 available

40
4.3.4 Case 4
When all parking filled up with cars the LCD will show to the driver
(N/A N/A N/A)(no more space) message , and the entry barrier will
not open as shown in Figure 4.6 if an unregistered car comes the
barrier will not open to the driver to park his car.

Figure 4.6 Parking filled up

41
CHAPTER FIVE
CONCLUSION AND
RECOMMENDATION

42
CHAPTER FIVE

CONCLUSION AND RECOMMENDATION

5.1 Conclusion

In this project an automatic car parking system is designed to control


cars entry and exit inside the parking by using ultrasonic sensors.
Theses sensors are connected to the microcontroller. The ultrasonic
sensors can sense car motion inside the parking. The Radio Frequency
Identification (RFID) detects the authorized whom can use the
parking. The servo motor used to close and open the barrier for entry
and exit to the parking. The Liquid Crystal Display (LCD) is used to
display the data which comes from the microcontroller after
processing this data.

5.2 Recommendation

 Adding Camera Control Television (CCTV) for monitoring the


motion inside the parking.
 Adding Light Emitter Diode (LED) to ensure suitable parking.
 Linking with data base system to register the user and help to
give priority to premium users.

42
REFRENCES

1. Chon, H. D., Agrawal, D., and El Abbadi, A. Year. "NAPA:


Nearest
2. https://www.arduino.cc/en/Main/ArduinoBoardUnoSMD
3. available parking lot application," Data Engineering, 2002.
Proceedings. 18th International Conference on, IEEE2002, pp.
496-497.
4. http://ovens.reviewed.com/features/the-history-of-smart-
appliances
5. Fraifer, M., and Fernström, M. 2014. "Smart Car parking
system prototype utilizing CCTVs," in Intel Ireland Research
Conference 2014: At Dublin-Ireland.
6. Kianpisheh, A., Mustaffa, N., Limtrairut, P., and
Keikhosrokiani, P. 2012. "Smart parking system (SPS)
architecture using ultrasonic detector," International Journal of
Software Engineering and Its Applications (6:3), pp 55-58.
7. Mahmud, S., Khan, G., Rahman, M., and Zafar, H. 2013. "A
survey of intelligent car parking system," Journal of applied
research and technology (11:5), pp 714-726.
8. Schmidt, M. ["Arduino: A Quick Start Guide"], Pragmatic
Bookshelf, January 22, 2011, Pg. 201
9. https://www.ijser.org/researchpaper/Smart-Parking-System.pdf

43
10.M. Y. I. Idris, E. M. Tamil, N. M. Noor and K. W. Fong,
“Parking Guidance System Utilizing Wireless Sensor Network
and Ultrasonic Sensor”, Information Technology Journal, ISSN
1812-5638, (2009).
11.B. K. Konstantinos Domdouzis and C. Anuba., “An
experimental study of the effects of different medium on the
performance of rfid system,” vol. 21. Advanced Engineering
Informatics, 2011.
12.http://ovens.reviewed.com/features/the-history-of-smart-
appliances
13.Chip Hall of Fame: Atmel ATmega8". IEEE Spectrum:
Technology, Engineering, and Science News. Retrieved 2017-
10-10
14.David Harris & Sarah Harris (2012). Digital Design and
Computer Architecture, Second Edition, p. 515. Morgan
Kaufmann. ISBN 0123944244.

44
Appendix

45

You might also like