MATLAB Report
MATLAB Report
Submitted to:
Dr. Yasser M. Alginahi
Date:
27/10/2022
Table of Contents
1. Introduction…………………………………………………………………..……………3
1.1 Project Overview……………………………………………………………...………3
1.2 Project purpose……………………………………………………………………..…3
1.3 Project outcome……………………………………………………………………….3
2. Project components and Requirements……………………………………………………4
2.1 Hardware components………………………………………………………………4-9
2.2 Software……………………………………………………………………………….9
3. Methodology……………………………………………………………………………..10
3.1 Block diagram…………………………………………………………………..……10
3.2 Steps in methodology………………………………………………...………………11
4. Pseudo code………………………………………………………………………..…11-13
5. Milestones………………………………………………………………………………..13
6. Limitations and Risks that are faced……………………………………………………..14
7. Conclusion……………………………………………………………………………….14
8. References………………………………………………………………………………..15
Page 1 of 17
List of Figures:
2. Servo Motor……………………………………………………..……………………..4
4. Resistor………………………………………………………………….………….….5
5. Breadboard………………………………………………………………….….…........6
6. LCD……………………………………………………………….……………………6
7. Jumper Wires……………………………………………………………….………….7
8. Arduino UNO………………………………………………………………………….7
11. Potentiometer…………………………………………………………………………9
Page 2 of 17
1. Introduction
1.1 Project Overview:
Urban car parking is a major problem in both industrialised and developing nations. The rapid
growth in car ownership has led to a shortage of parking spaces for cars in many cities, creating
an imbalance between supply and demand that may be considered the main cause of urban parking
issues. Poor land use planning and an early underestimation of the need for space are two factors
that contribute to this mismatch. Lack of parking spaces, high parking rates, and traffic jams
brought on by individuals looking for a spot to park are common parking complaints [1]. A simple
and efficient parking management system makes it possible to manage parking. The servo motor,
LCD display, LED module, and Arduino UNO were used in the creation of this system. For coding,
MATLAB software is employed. This project can be used in a variety of locations, including
private parking lots, hotels, clinics, and offices.
To build a smart parking management system, an Arduino UNO board and MATLAB software
will be used. Along with segregated parking spaces, an automatic lifting bar, traffic lights to serve
as a signal, and an LCD display that shows the number of parking spaces available.
This project is meant to handle the parking spots system in a smart way. It shows how many
parking spots available; how many are occupied in a parking area and gives a specified parking
spot. “Welcome” is displayed on LCD before a vehicle enters to the parking spot in this situation
RGB LED light will be in red colour. After pressing enter by user, light turns from red to green
and servo motor rotates to open the barrier. With this number of parking spots available will be
decreased by 1. Next case is when the user wants to exit the parking spot and presses exit button
then the servo motor turns to open barrier and let vehicle pass. In this situation RGB LED turns
from red to green and simultaneously parking spots available are increased by 1. Another case is
when no parking spots are available then LCD shows “Please come Later” and light glows in red
with servo motor making no rotation.
Page 3 of 17
2. Project Components and Requirements:
To turn something on or off, a push button switch uses a basic electric mechanism or air switch
mechanism. Depending on the model, they may function with a momentary or latching action. The
button itself is typically made of a sturdy, long-lasting material like metal or plastic [2].
servo motor comes under electromechanical device that generates torque and velocity dependent
on the current and voltage input. As a component of a closed loop system, servo motors deliver
Page 4 of 17
torque and velocity in response to commands from servo controllers, with the loop being closed
by a feedback device.
RBG LEDs are short for red, blue, and green LEDs. These three colours are combined in RGB
LED devices to create over 16 million different shades of light. Be aware that not every hue is
conceivable. There are several colours that fall "outside" of the RGB LEDs' triangular shape.
2.1.4 Resistor
A resistor is an electrical component that is used to stop electrons to flow which come under
passive category. It comes with two terminals. The resistance of resistor measured in Ohms.
transmission lines.
Page 5 of 17
2.1.5 Breadboard
A breadboard makes it simple and quick to build temporary electronic circuits or conduct circuit
design experiments. The rows and columns of internally connected spring clips beneath the
perforated plastic casing of breadboards allow developers to quickly connect components or
cables.
There are several uses for LCD (Liquid Crystal Display) screens, which are electrical display
modules. A 16x2 LCD display is a very fundamental module that is frequently included into many
different devices and circuits [7]. With a 16x2 LCD, there are 2 lines that can each display 16
characters. Each character on this LCD is presented using a 5x7 pixel matrix. The 224 different
Page 6 of 17
characters and symbols that can be displayed on the 16 x 2 intelligent alphanumeric dot matrix
display. The Command and Data registers on this LCD are its two registers [7].
Jumper wires are simply wires with connector pins on both sides which can be useful for
connecting two sites without soldering [8]. With breadboards and other prototype equipment,
jumper wires are commonly used for modifying a circuit whenever it is needed [8].
Arduino is one of its kind electronic devices which connects both hardware and software with no
complexity [9]. By uploading set of instruction to Arduino microcontroller one can turn on light,
switch on/off the fan, start a motor, and can be used to devices that are run by voice. For dumping
Page 7 of 17
code into Arduino board Arduino software (IDE) is used along with a certain programming
language [9].
Arduino board is powered by a 9v battery with cables. It comes with to wires one is positive and
another one is negative. Positive wire is connected to Arduino board and negative to ground on
bread board [10].
It is basically a cable that acts as median for Arduino board and programming device. It comes
with USB-B, USB-C [11].
Page 8 of 17
2.1.11 Potentiometer
A three-terminal resistor with a sliding or revolving contact that creates a variable voltage divider
is called a potentiometer [12]. It functions as a variable resistor or rheostat if only the wiper and
one end of the connector are used [12].
2.2 Software
MATLAB blends a programming language that natively expresses matrix and array mathematics
with a desktop application optimised for iterative analysis and design. For writing scripts that mix
code, output, and formatted text in an executable notebook, it comes with the Live Editor [13].
You can use MATLAB programmes to test out various algorithms on data. Once you've
achieved the desired results, you can generate a MATLAB programme automatically and it can
do your job automatically [13].
With relatively small code modifications, scale your analysis to run on clusters, GPUs, and
clouds. You don't need to master out-of-memory programming, large data programming, or to
completely rebuild your code [13].
Page 9 of 17
3. Methodology
Smart parking system is executed for three cases. Case1 is for vehicles that are entering parking
slots. Case 2 is for cars that are wanting to exit the parking area by pressing “Exit”. Case 3 is for
executing, if parking slots are not available to fill.
Page 10 of 17
Figure 13: Flow Chart
Case2: vehicle enters parking area where slots are not available
4. Pseudocode:
Step-2: Create an LCD object and initialize the 16X2 LCD display.
Step-3: Allocate 2 pins on the Arduino to initialize “Green” and “Red” pins in the LED
Step-5: Allocate an Arduino pin to Servo motor and create an object named "servo", then turn the
Servo Motor to the "0" position.
Page 11 of 17
Step-6: To show that the barrier gate is closed, write "1" to the Red LED pin on the Arduino
UNO.
Step-7: Initialize a variable named empty slots to store the total number of available parking slots
Step-8: Display below details on the LCD with specified time delay
• Welcome message,
• Project name,
• Group number,
• Team member1 name & student ID,
• Team member2 name & student ID.
Case1:
• To indicate that a barrier gate is open, RGB LED turns from red to green
• The servo motor rotates back to 0 degrees by closing the barrier gate
Case 2:
Page 12 of 17
Case 3:
• If presses exit
• Servo motor rotates to 90 degrees and raises barrier gate allows vehicle to pass
• Close the barrier gate where servo motor rotates back to 0 degrees and lights turns to red
5. Milestones:
For smart parking system we divided tasks equally and contributed equally. At this stage we
reached two milestones. One is planning the project to meet our objectives by designing an
algorithm with steps and stages of work. Another milestone that we met is collecting every
hardware required for the project along with software such as MATLAB.
Page 13 of 17
6. Limitations and Risks that are faced:
First limitation that we faced was to decide what necessary components that are required for smart
parking system. Risk taken in verifying Arduino with outside code to check whether its working
or not. Need to handle components with at most care if not they can become defective. Need to
store the components like resistor, LED, and lights in some cool places if not when they exposed
to high temperature, they may disfunction.
7. Conclusion:
Smart Parking system can overcome all possible difficulties of conventional parking system. With
this, users can save lot of time by doing task with ease and can save fuel. It will become a
revolutionary change in the parking system and cam customize according to requirements. Users
can easily find where the spots are available and how many spots available. Pollution problem can
be reduced to some extent with this technology. This technology can be established in vertical
parking system also.
8. References:
Page 14 of 17
[1]. H. Ibrahim, "Car Parking Problem in Urban Areas, Causes and Solutions," 1st International
Conference on Towards a Better Quality of Life, Apr. 24, 2018. [Online]. Available:
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3163473#:~:text=This%20imbalance%20is
%20partially%20due,examples%20of%20everyday%20parking%20problems. [Accessed: Oct.
21, 2022].
[2]. “What is a push button switch?,” Herga Technology Ltd, Nov. 19, 2018. [Online]. Available:
https://www.herga.com/news-media/technical-blog-archive/what-is-a-push-button-switch-
#:~:text=A%20Push%20Button%20switch%20is,such%20as%20metal%20or%20plastic.
[Accessed: Oct. 22, 2022].
[3]. “How Servo Motors Work,” KOLLMORGEN, Sep. 29, 2020. [Online]. Available:
https://www.kollmorgen.com/en-us/blogs/how-servo-motors-work/. [Accessed: Oct. 20, 2022].
[6]. T. Schousek, “Embedded control fundamentals,” Science Direct, 2018. [Online]. Available:
https://www.sciencedirect.com/topics/engineering/breadboard. [Accessed: Oct. 22, 2022].
[8]. “What Are Jumper Wires: Know by Colour, Types and Uses,” WILTRONICS, Apr. 14, 2022.
[Online]. Available: https://www.wiltronics.com.au/wiltronics-knowledge-base/what-are-jumper-
wires/#:~:text=Jumper%20wires%20are%20electrical%20wires,diagnose%20problems%20in%2
Page 15 of 17
0a%20circuit. [Accessed: Oct. 23, 2022].
[10]. M. Bevequva, “Car Battery Cable Replacement: A Complete DIY Guide,” carparts.com.
[Online]. Available: https://www.carparts.com/blog/car-battery-cable-replacement-a-complete-
diy-guide/. [Accessed: Oct. 23, 2022].
[11]. “USB 2.0 Cable Type A/B,” Arduino. [Online]. Available: https://store-
usa.arduino.cc/products/usb-2-0-cable-type-a-b. [Accessed: Oct. 22, 2022].
Page 16 of 17