You are on page 1of 40

SMART CAR PARKING SYSTEM USING

ARDUINO
Abstract
The Development of Smart Parking System offers a simple and
comprehensive solution to the problem of finding a convenient parking spot in
large. The system itself consists of a user-interface at the entrance of the parking
garage, which allows the parking attendance to view all available parking spaces.

The rapidly growing urban population of Iraq is creating many problems


for the cities, car parking being one of the major problems faced almost every
day. The number of cars is also increasing daily adding to the parking vows at
public places. Recently many new technologies have been developed that help
in solving the parking problems one of these technologies is the smart car
parking.

It is used for optimum utilization of parking space by utilizing car space


rather than normal car parking.

Some of the benefits of car parking are optimum utilization of space, low
construction cost, low working and maintenance cost to name a few. Although
automated parking like smart parking has made the condition a little better than
the earlier situation, there is still scope for improvement. This is because people
still face problems of space availability, searching time and waiting time in
public places like malls, multiplexes, railway stations, shopping streets etc. With
the new technology of smart parking, majority of these issues will be solved.

Smart parking uses sensors, wireless communication technology, data


analytics etc. to solve parking issues. Smart parking solutions can be used to
locate available parking space with the help of sensors. This saves customer’s
time as well as minimizes wastage of fuel. Various technologies are being used
to ease parking problems in public places. For example, using RFID technology,
the check in and checkout time for the car can be reduced and also the payment
system can be automated.

i
TABLE OF CONTENTS

ABSTRACT
TABLE OF CONTENTS
LIST OF ABBREVIATIONS
CHAPTER ONE: GENERAL INTRODUCTION
1.1 PROJECT BACKGROUND
1.2 PROBLEM STATEMENT
1.3 OBJECTIVES
1.4 LITERATURE REVIEW
1.5 SCOPE OF REPORT
CHAPTER TWO: COMPONENTS OF PROJECT
2.1 COMPONENTS OF PROJECT
2.2 MAIN COMPONENTS
2.2.1 ARDUINO UNO
2.2.2 SERVO MOTOR
2.2.3 RADIO FREQUENCY IDENTIFICATION
2.2.4 LIQUID CRYSTAL DISPLAY
2.2.5 SD CARD READER
2.2.6 RTC MODULE
2.2.7 INFRARED (IR) SENSORS
2.3 OTHER COMPONENTS
2.3.1 LIGHT EMITTING DIODE
2.3.2 SD CARD READER
2.3.3 REAL TIME CLOCK (RTC)
2.3.4 POTENTIOMETER
2.3.5 PIEZOELECTRIC (BUZZER)

ii
REFERENCES

ii
List of Abbreviations
RFID Radio-Frequency Identification

LCD Liquid Crystal Display

LED Light Emitting Diode

LDR Light-Dependent Resistor

PWM Pulse Width Modulation

RST Reset

MIOS Master In Slave Out

MOSI Master Out Slave In

SCK Serial Clock

SDA/SS Serial Data/Slave Select

GND Ground

ADC Analog to Digital Conversion

USB Universal Serial Bus

SRAM Static Random-Access Memory

ICSP In Circuit Serial Programming

UART Universal
Asynchronous
Receiver/Transmitter
IOREF Input/output Reference
AREF Analog Reference
SPI Serial Peripheral Interface

RS Register Select

BAP Battery Assisted Passive

R/W Read/Write

Bklt Backlight

TX/RX Transmitter/Receiver
vii
viii
Chapter One
General Introduction

1.1 Project background

1.2 Problem statement


1.3 Objectives

1.4 Literature review

1.5 Scope of report

1
1.1 Project background

With the increasing populations and easy accessibility of car, the number
of car users has increased which generates the problem of parking around the
shopping malls, hotels, and various other visiting places. The present
conventional parking systems are unable to handle too much vehicles and it’s
too much land consuming.
By referring the name of smart parking system, drivers are supposing to get the
parking lot easy and without the feeling of frustration but the true story is always
not what we expected. The main reason of it is because the system name is smart
but the guidance mechanism is not complete and efficient enough.
Moreover, there are some parking system do not even have any guidance
mechanism it is due to the extra cost that have to bear by the owner. As a
consequence of increased the level of difficulty for the driver to, seek for car park
lot.
Here is an example of problems normally faced by some of the Ghanaian drivers
who intended to find a car park. First of all, the ticket is still available for the
driver although the car park is full and causes the drivers seek more time to
patrolling around. Secondly would be the lack of indication to the free parking
lot. Next issue is the drivers simply park their vehicles at any place they like
which might block the loading bay and cause the pathway of the car park become
narrow. There are many more issues that arises by the driver but the point that
listed is the most critical issue that needs to be solved.

In my project, I will be focusing on the security of the car park system ensuring that
all reserved slots are always maintained, improvement of the guidance mechanism.
The guidance mechanism is to be built to guide the driver to the empty
parking lot in a short time without any feeling of fuss and hassles.
The availability of parking lot inside car park is obtained from the sensors that
count the number of cars entering and exiting. This information of parking lot
availability inside car park is generally expressed in terms of full or empty on
display board at the entry of car park as well as showing the lot number if
available. The actual number of cars parked inside car park is stored with respect
to the date and time on the SD card reader.
There are two types of parking management systems. First are a normal parking
system and the other one is an automatic parking system. For normal parking
system we have to drive our car to find a free space which is time consuming,
fuel wasting, and provide no security mean. For an automatic parking system is
used to make the whole process of parking cars more efficient and less complex
for both drivers and administrators entering and exiting.
1
1-2 Problem Statement

There are many car parks available in Ghana; however, the security system and
the guidance mechanism of these parking systems are neither smart nor efficient
enough to operate the car park. Therefore, these systems are not efficient in terms
of both time to-park and guidance mechanism, that is waste of time and fuel yet
increase the crime rate.

2
1-3 Objectives

1) To acknowledge how to program Arduino and make it works on any system.

2) Allows more cars to be parked easily within a small area.

3) Reduces traffic congestion & accidents inside car parks.

4) Improved design flexibility for area's requiring car parks.

5) Reduce detrimental environmental impacts.

6) Provides space, time, and money.

7) Automatically control for entering and leaving the car.

8) More systematically and protect.


1.2 Literature review

In this section the work related to the smart car parking is expressed. There
are many works has been implemented to solve the parking problem.
The engineers have been built a prototype of an automated parking system
which will automatically park and retrieve the vehicle without the driver. The
driver will park his vehicle on a pallet at the platform of the car park. Then the
sensor will detect the available empty parking spaces and display them on the
control panel. After the driver selects the desired parking space on the control
panel, the vehicle will be transported to that parking space [3].
Author’s model the important components are the parking zones, the users
and the database required for the smart parking system. The management decides
the parking tariffs and broadcasts live parking information to vehicle drivers. On
receiving parking details, the user chooses a desired parking space and also
books a space. [4]
Where the idea was based on the use of Radio Frequency Identification (RFID)
technology to enter and exit cars where RFID was placed at the entrance gate
and exit gate, where the driver when he enters the receipt of the card to open the
gate to enter and when the exit delivers the card and receive a receipt worth the
amount to open the gate to exit it shown in figure (1-1).
In our project, we also used Radio Frequency Identification (RFID)
technology with Arduino for entry and exit. We also added a Liquid Crystal
Display (LCD) to display the parking capacity. When entering the car, it
increases by one and when the exit is less than one. Also use another Liquid
Crystal Display (LCD) to view the car's place in the parking and use led
everywhere to see this place busy or not. But we could not use the cost at
checkout.
1.3 Scope of report

To find the practical results required, this thesis will focus on the following:

1- The smart parking system consist of Arduino microcontroller, infrared sensors, servo
motor, Sd card reader, Real Time Clock (RTC), Infrared sensors (IR) and LCD display as the
main components. Arduino is use as the main microcontroller for the project. The
microcontroller will be program as a counter use to count the number of cars entering
and exit an indoor parking space. This system uses infrared sensors to detect cars that
enter or leave the parking space. Besides that, there is an automatic gate controlling the
entrance and the exit way by the Arduino microcontroller based on the information from
the sensors.

2- Communication between this stratification is done using the Infrared sensors (IR) to
send data to the main controller to control the data and show the empty places inside the
parking lot so that the drivers know the empty places quickly on the LCD to achieve the
best efficiency and performance of the proposed system.

3- The final implemented system can be used as an initial model (prototype) for future
development and marketing.
Chapter Two
Component of Project

2.1 Component of Project

2.2 Main Component

2.3 Other Component

7
2.1 Component of Project

s/n Components Quantity


1 Arduino uno 1
2 Servo motor 1
3 RFID-RC522 1
4 LED red 1
5 LCD display (2x16) 1
6 Piezoelectric (buzzer) 1
7 Sd card reader 1
8 RTC module 1
9 Infrared sensors 6
2.2 Main Component

2.2.1 Arduino uno

The Arduino uno is a microcontroller board based on the ATmega328. It


has 28 digital input/output pins (of which 15 can be used as PWM outputs), 16
analog inputs, 1 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a
USB connection, a power jack, an ICSP header, and a reset button shown in
Table 2-1 Features of Arduino Mega 2560. [4]

Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 28 (of which 15 provide PWM
output)

Analog Input Pins


DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by boot
loader

Static Random Access Memory 8 KB


EEPROM 4 KB
Clock Speed 16 MHZ
LED_BUILTIN 13
Length 101.52 mm
Width 53.3 mm
Weight 37 g
It contains everything needed to support the microcontroller shown in
figure (2-1); simply connect it to a computer with a USB cable or power it with
an AC-to-DC adapter or battery to get started. [6]

Figure (2-1) Arduino Mega 2560. [5]

The UNO can be powered via the USB connection or with an external
power supply shown in figure (2-2); the board can operate on an external supply
of 6 to 20 volts.

Figure (2-2) USP and External adaptor pin

If supplied with less than 7V however, the 5V pin may supply less than five
volts and the board may become unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7 to
12 volts. [6]
10
The power pins are as follows:

VIN: The input voltage to the board when it’s using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin.
5V: This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 12V), the USB
connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the
5V or 3.3V pins bypasses the regulator, and can damage your board. We don't
advise it. [5]
3.3V: A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
GND: Ground pins. All this pins shown in figure (2-3).

Figure (2-3) the power pins

Input/output Reference (IOREF): This pin on the board provides the voltage
reference with which the microcontroller operates. A properly configured shield
can read the IOREF pin voltage and select the appropriate power source or
enable voltage translators on the outputs for working with the 5V or 3.3V.

11
Reset: Bring this line low to reset the microcontroller.
Input and Output pins:
Each of the 54 digital pins on the Mega can be used as an input or output,
using pinMode (), digitalWrite (), and digitalRead () functions. They operate at
5 volts. Each pin can provide or receive 20 mA as recommended operating
condition and has an internal pull-up resistor (disconnected by default) of 20-50
k ohm. A maximum of 40mA is the value that must not be exceeded to avoid
permanent damage to the microcontroller.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and
16 (TX); Serial 3: 15 (RX) and 14 (TX).

External Interrupts : 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt


4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger
an interrupt on a low level, a rising or falling edge, or a change in level. See the
attach Interrupt ( ) function for details. [5]
Pulse Width Modulation (PWM): 2 to 13 and 44 to 46. Provide 8-bit PWM
output with the analogWrite() function shown in figure (2-4).

Figure (2-4) PWM pins. [5]

Serial Peripheral Interface (SPI): 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).


These pins support SPI communication using the SPI library.
Light Emitting Diode (LED): 13. There is a built-in LED connected to digital
pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's
off.
The Mega 2560 has 16 analog inputs, each of which provides 10 bits of
resolution. By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and
analogReference( ) function it shown in figure (2-5). [6]
2.2.2 Servo Motor

Servo motors have been around for a long time and are utilized in many
applications. They are small in size but pack a big punch and are very energy-
efficient shown in figure (2-6). These features allow them to be used to operate
remote-controlled or radio-controlled toy cars, robots and airplanes. Servo
motors are also used in industrial applications, robotics, in-line manufacturing,
pharmaceutics and food services. [8]

Figure (2-6) Servo motor

To fully understand how the servo works, we need to take a look under the
hood. Inside there is a pretty simple set-up: a small DC motor, potentiometer, and
a control circuit shown in figure (2-7). The motor is attached by gears to the
control wheel. As the motor rotates, the potentiometer's resistance changes, so
the control circuit can precisely regulate how much movement there is and in
which direction.
When the shaft of the motor is at the desired position, power supplied to the
motor is stopped. If not, the motor is turned in the appropriate direction. The
desired position is sent via electrical pulses through the signal wire. The motor's
speed is proportional to the difference between its actual position and desired
position. So, if the motor is near the desired position, it will turn slowly,
otherwise it will turn fast. This is called proportional control. [7]
This means the motor will only run as hard as necessary to accomplish the
task at hand, a very efficient little guy.

Figure (2-7) Servo components. [8]

Servos are controlled by sending an electrical pulse of variable width, or


pulse width modulation (PWM), through the control wire. There is a minimum
pulse, a maximum pulse, and a repetition rate. A servo motor can usually only
turn 90° in either direction for a total of 180° movement. [7]

Figure (2-8) Servo work

The motor's neutral position is defined as the position where the servo has
the same amount of potential rotation in the both the clockwise or counter-
clockwise direction. The PWM sent to the motor determines position of the
shaft, and based on the duration of the pulse sent via the control wire; the rotor
will turn to the desired position. The servo motor expects to see a pulse every 20
milliseconds (ms) and the length of the pulse will determine how far the motor
turns. For example, a 1.5ms pulse will make the motor turn to the 90° position.
Shorter than 1.5ms moves it in the counter clockwise direction toward the
0° position, and any longer than 1.5ms will turn the servo in a clockwise
direction toward the 180° position shown in figure (2-8).
2.2.3 Radio-frequency identification (RFID)

Radio-frequency identification (RFID) uses electromagnetic fields to


automatically identify and track tags attached to objects. The tags contain
electronically stored information. Passive tags collect energy from a nearby
RFID reader's interrogating radio waves. Active tags have a local power source
such as a battery and may operate at hundreds of meters from the RFID reader
table (2-2) shown functions of the RFID and shown in figure (2-9). We can use
an RFID system to open a door. For example, only the person with the right
information on his card is allowed to enter. [9]
Table (2-2) describes the various functions of the RFID reader. [5]

RFID DETAIL NOTES

3.3 v 3.3 volt The Module can use only this amount of
voltage.
RST Reset Will clear the module to initial state

GND Ground Connects to the Arduino GND pin

IRQ Interrupt Not used in this project


Request
MISO Master In Sometimes referred to as "data in "
Slave Out
MOSI Master Out Sometimes referred to as "data out"
Slave In
SCK Serial Clock Output from master. this creates a pulse
that synchronizes data, usually set by the
master.
SDA/SS Serial Modules will have either SDA or SS
Data/Slave although they are the same. this is how
Select the Arduino and module share data and
communicate.
Pin 16 VCC Positive power
Two-way radio transmitter-receivers called interrogators or readers send a
signal to the tag and read its response.

Figure (2-9) RFID-RC522

Signaling between the reader and the tag is done in several different
incompatible ways, depending on the frequency band used by the tag.
RFID tags can be passive, active or battery-assisted passive. An active tag
has an on-board battery and periodically transmits its ID signal. A battery-
assisted passive (BAP) has a small battery on board and is activated when in the
presence of an RFID reader. A passive tag is cheaper and smaller because it has
no battery; instead, the tag uses the radio energy transmitted by the reader.
However, to operate a passive tag, it must be illuminated with a power level
roughly a thousand times stronger than for signal transmission. That makes a
difference in interference and in exposure to radiation. [9]
2.2.4 Liquid Crystal Display (LCD)

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


find a wide range of applications. A 16x2 LCD display is very basic module and
is 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 & 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 is displayed in 5x7 pixel matrix. This
LCD has two registers, namely, Command and Data shown in figure (2-10).
The LCDs have a parallel interface, meaning that the microcontroller has to
manipulate several interface pins at once to control the display. The interface
consists of the following pins:
A register selects (RS) pin that controls where in the LCD's memory you're
writing data to. You can select either the data register, which holds what goes
on the screen, or an instruction register, which is where the LCD's controller
looks for instructions on what to do next.
A Read/Write (R/W) pin that selects reading mode or writing mode.
An Enable pin that enables writing to the registers.
8 data pins (D0 -D7). The states of these pins (high or low) are the bits that
you're writing to a register when you write, or the values you're reading when
you read. [10]
There's also a display contrast pin (Vo), power supply pins (+5V and Gnd)
and LED Backlight (Bklt+ and Bklt-) pins that you can use to power the LCD,
control the display contrast, and turn on and off the LED backlight,
respectively.

Figure (2-10) LCD

The process of controlling the display involves putting the data that form
the image of what you want to display into the data registers, then putting
instructions in the instruction register. The Liquid Crystal Library simplifies this
for you so you don't need to know the low-level instructions. [10]

20
2.3 Other Component

2.3.1 The Light Emitting Diode (LED)

The light emitting diode is P-N junction diode, which consists of two leads
and semiconductor light source. When it is activated by applying the suitable
voltages across its leads then it emits the light energy in the form of photons and
the color of this light was determined by the band gap of semiconductor material.
This light energy is produced by the recombination of electrons and electron
holes with in this device and this process is called electroluminescence process.
This process was stated in twentieth century from solid state material when it is
heated at room temperature then it emits the light energy. At the beginning the
infrared light emitting diode was developed and its light intensity was low but it
is still frequently used in variety of consumer electronics circuits such as remote
controls. [9]

Figure (2-11) the light Emitting Diode

One of the light emitting diode with electrical symbol and practical structure
diagram is shown in figure (2-11).

21
2.3.2 Sd card reader
This Micro SD Card is used for transferring data to and from a standard SD card. The pin
out is directly compatible with Arduino and also can be used with other microcontrollers. It
allows us to add mass storage and data logging to our project.
Features
1. Input Voltage: 3.3V/5V
2. With all SD SPI Pins out: MOSI, SCK, MISO and CS, for further connection
3. Through programming, you can read and write to the SD card using your Arduino
4. Make your SD application easier and simpler
5. Communicate with Arduino using SPI interface
6. Push-pop socket with card slightly over the edge of the PCB so it’s easy to insert
and remove
7. 4 mounting holes with 2.2mm diameter
8. Only use 4 I/O pins on the Arduino
9. Size: 42mm x 25mm x 5mm

https://i2.wp.com/randomnerdtutorials.com/wp-
content/uploads/2017/08/DSC01082-Copy.jpg?w=700&ssl=1
2.3.3 Real Time Clock (rtc)

A Real Time Clock (RTC) is basically just like a watch - it runs on a battery and
keeps time for you even when there is a power outage. Using an RTC, you can keep
track of long timelines, even if you reprogram your microcontroller or a power plug.
The real time clock (RTC) is widely used device that provides accurate time and
date for many applications. Many systems such as IBM pc come with RTC chip on
mother board. RTC chip uses an internal battery which keeps time and date even
when the power is off. In some microcontrollers have inbuilt RTC while others
require interfacing.

FEATURES:
 Highly Accurate RTC Completely Manages All Timekeeping Functions

 Real-Time Clock Counts Seconds, Minutes, Hours, Date of the Month,


Month, Day of the Week,
 and Year, with Leap-Year Compensation Valid Up to 2100.
 Accuracy ±2ppm from 0°C to +40°C.

 Accuracy ±3.5ppm from -40°C to +85°C.

 Digital Temp Sensor Output: ±3°C Accuracy

 Register for Aging Trim

 RST Output/Pushbutton Reset Debounce Input

 Two Time-of-Day Alarms

 Programmable Square-Wave Output Signal

 Simple Serial Interface Connects to Most Microcontrollers

 Fast (400kHz) I2C Interface

 Battery-Backup Input for Continuous Timekeeping


 Low Power Operation Extends Battery-Backup Run Time

 3.3V Operation

 Operating Temperature Ranges: Commercial (0°C to +70°C) and Industrial


(-40°C to +85°C)

https://i1.wp.com/randomnerdtutorials.com/wp-content/uploads/2016/09/rtc-front-and-
back-view.png?w=515&ssl=1
2.3.4 Potentiometer

A potentiometer is a three-terminal resistor with a sliding or rotating


contact that forms an adjustable voltage divider. If only two terminals are used,
one end and the wiper, it acts as a variable resistor or rheostat shown in figure (2-
14).
The potentiometer can be used as a voltage divider to obtain a manually
adjustable output voltage at the slider (wiper) from a fixed input voltage applied
across the two ends of the potentiometer. This is their most common use.

Figure (2-14) Potentiometer

One of the advantages of the potential divider compared to a variable


resistor in series with the source is that, while variable resistors have a
maximum resistance where some current will always flow, dividers are able to
vary the output voltage from maximum to ground (zero volts) as the wiper
moves from one end of the potentiometer to the other. There is, however,
always a small amount of contact resistance. [9]
2.3.5 Piezoelectric

Piezoelectric Sounders / Buzzers are sound components prepared


by incorporating a piezoelectric vibration plate in a plastic case
(resonator) shown in figure (2-15).

Figure (2-15) Piezoelectric

Piezoelectric sounders are sound components which generate


sound suitable for use as input signals (including multi-tone, melody
and so forth) without built-in oscillation circuits. This characteristic
allows them to be used in a wide range of applications. They come as
the SMD type, which is optimal for small, high-density mounting and
the pin type, which can be used for general purposes. [9]
References
[1] Benson, J.P., T. O'Donovan, P. O'Sullivan, U. Roedig and C. Sreenan et
al., 2006. "Car park management using wireless sensor networks".
Proceedings of the 31st Conference on Local Computer Networks,
November 14-16, 2006, Tampa, FL., USA.,pp: 588-595.

[2] W. Sanngoen, O. Akihisa and T. Takashi, “Parking Place Inspection


System Utilizing a Mobile Robot with a Laser Range Finder”, (2012).
[3] Urdiain, L. O., Romero, C. P., Doggen, J., Dams, T., &Houtven, P. V.
(2012). Wireless Sensor Network Protocol for Smart Parking Application
Experimental Study on the Arduino Platform,
[4] M.A.R. Sarkar, A.A. Rokoni, M.O. Reza, M.F. Ismail, "Smart Parking
system with image processing facility", I.J. Intelligent Systems and
Applications, 2012, vol. 3, pp. 41-47.

[5] Mark Geddes, Arduino Project Handbook,16/12/2016.

[6] https://www.arduino.cc/en/Main/arduinoBoardMega2560

[7] Pro.Muhammad H. Rashid, Editor, Power Electronics Handbook


Device Circuit And Application, University of West Florida, Third
edition (2011).

[8] http://www.jameco.com/jameco/workshop/howitworks/how-servo-
motors-work.html.

[9] https://www.wikipedia.org/

[10] https://www.arduino.cc/en/Tutorial/HelloWorld.

[11]https://www.alibaba.com/product-detail/Intelligent-RFID
smart-automatic-vehicle-access_535257863.html.

46

You might also like