Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

NIRMA UNIVERSITY

INSTITUTE OF TECHNOLOGY
B. TECH. SEM. III (EC)
EC305-DIGITAL DESIGN LAB
SPECIAL ASSIGNMENT

CAR PARKING SYSTEM

BY:

ADITYA R(19BEC004)

AVI NAWAL (19BEC012)

Electronics & Communication Engineering Department

Institute of Technology, Ahmedabad

1
CONTENTS

Topic Page No.


1. Introduction 3

2. Block Diagram 4

3. Circuit Diagram 4

4. Working 5

5. Verilog Code 5

6. RTL View 10

7. Output Waveform 10

8. Conclusion 10

9. Contribution 11

10. Future Work 11

11. References 11

2
Introduction
Thirty years ago, there were only a few vehicles moving on the road. The number of cars
could be equated to a very small number. In the past three decades the number of vehicles has
increased 10-fold and there has been substantial increase in the number of four wheelers due
to increasing urbanisation and population.
It is seen now, that every household has a vehicle. Despite the fall in economy witnessed in
2020, the estimated sale of vehicles this year is 60 million units. The reason being that the
vehicles have started becoming economical, such that the middle class can afford one.

The increasing no. of vehicles is the reason for increase in parking problems, especially in
places like malls, shopping complexes, parks, etc.
A few reasons for this are the growth in population, improvement in lifestyle and concerns
for the safety of the vehicle.
Now a days at every parking place a person is employed just to arrange the vehicle and guide
the people coming, to park their cars. Also, at places with parking problems, people have to
wait in long queues and search for free slots.
So, there is an idea such that arrangement and security at the parking area is handed over to
technology.
The central idea for this project came from the troubles people face to park their cars during
their daily routine. The idea requires two sensors, one at the entrance and the other at the exit
of the gate, Verilog code according to the requirement, a device that asks for a password,
indicators (red light and green light) to instruct the cars to either enter or to wait, seven
segment displays to display the status.

3
Block Diagram

Password Start

=False Enter the


Password
Stop

Wrong
Correct
Password
Password

Exit
Sensor=False

Circuit Diagram

4
Working
The working of the model is as follows:
1. There is a sensor at the entrance that detects the incoming car.
2. If the feedback from the entrance sensor is true then the system asks for a password.
3. If the driver enters the correct password, the feedback is sent to the system
4. But if the driver enters the wrong password, it asks for the same until the correct
password is given.
5. If the password is correct and the feedback from the sensor placed at the exit of the
gate is false the gate is still open
6. But if the password is correct and the feedback from the sensor placed at the exit of
the gate is true the system attains the idle situation
7. Another situation arises when the car is about to enter the parking and another car
arrives at the parking gate. In such a situation the feedback from both the sensors are
true.
8. In such case the second car has to wait until it enters the right password. Once the
right password is entered the procedure is same as the first car.

Verilog Code
// Car parking system presented by : Aditya R
`timescale 1ns / 1ps
module parking_system(
input clk,reset, //clock and reset of the car parking system
input sensor_entry, sensor_exit, //two sensor in front and behind the gate of the car parking
system
input [1:0] password_1, password_2, //input password
output wire GREEN_LED,RED_LED, //signalling LEDs
output reg [6:0] SEG_1, SEG_2 //7-segment Display
);
parameter IDLE = 3'b000, WAIT_PASSWORD = 3'b001, WRONG_PASS = 3'b010,
RIGHT_PASS = 3'b011,STOP = 3'b100;
// This is a Moore based FSM
reg[2:0] current_state, next_state;
reg[31:0] counter_wait;
reg red_tmp,green_tmp;
// Next state

5
always @(posedge clk or negedge reset)
begin
if(~reset)
current_state = IDLE;
else
current_state = next_state;
end
// counter_wait
always @(posedge clk or negedge reset)
begin
if(~reset)
counter_wait <= 0;
else if(current_state==WAIT_PASSWORD)
counter_wait <= counter_wait + 1;
// The counter wait increases as the password is correct
//until the Exit_Sensor=True(Non Blocking)
else
counter_wait <= 0; //Non Blocking
end
// change state
always @(*)
begin
case(current_state)
IDLE: begin
if(sensor_entry == 1)//if the front sensor is on, there is a car going to the gate
next_state = WAIT_PASSWORD; //wait for password
else
next_state = IDLE;
end
WAIT_PASSWORD: begin

6
// The WAIT_PASSWORD state goes to RIGHT_PASS state
//if password entered is True else it goes to the WRONG_PASS
if(counter_wait <= 3) //wait for few cloxk cycles for password
next_state = WAIT_PASSWORD;
else
begin
if((password_1==2'b01)&&(password_2==2'b10)) //if password is correct, let them in
next_state = RIGHT_PASS;
else
next_state = WRONG_PASS;
end
end
WRONG_PASS: begin
if((password_1==2'b01)&&(password_2==2'b10))
next_state = RIGHT_PASS;//if password is correct, let them in
else
next_state = WRONG_PASS; //if not, they cannot get in until the password is right
end
RIGHT_PASS: begin
if(sensor_entry==1 && sensor_exit == 1)
next_state = STOP;
//if the gate is opening for the current car, and the next car comes,
//STOP the next car and require password
//the current car going into the car park
else if(sensor_exit == 1)
next_state = IDLE;
//if the current car passed the gate an going into the car park
//and there is no next car, go to IDLE
else
next_state = RIGHT_PASS;

7
end
STOP: begin
if((password_1==2'b01)&&(password_2==2'b10))
next_state = RIGHT_PASS;
//check password of the next car
//if the pass is correct, let them in
else
next_state = STOP;
end
default: next_state = IDLE;
endcase
end
// LEDs and output, change the period of blinking LEDs here
always @(posedge clk) begin
case(current_state)
IDLE: begin
green_tmp = 1'b0;
red_tmp = 1'b0;
SEG_1 = 7'b1111111; // off
SEG_2 = 7'b1111111; // off
end
WAIT_PASSWORD: begin
green_tmp = 1'b0;
red_tmp = 1'b1;
//RED LED turn on and Display 7-segment LED as EN to let the car know they need to input
password
SEG_1 = 7'b000_0110; // Displays EN in the seven segment dispay
SEG_2 = 7'b010_1011;
end
WRONG_PASS: begin
green_tmp = 1'b0; //if password is wrong, RED LED blinking

8
red_tmp = ~red_tmp;
SEG_1 = 7'b000_0110; // Displays EE in the seven segment dispay
SEG_2 = 7'b000_0110;
end
RIGHT_PASS: begin
green_tmp = ~green_tmp;
red_tmp = 1'b0; //if password is correct, GREEN LED blinking
SEG_1 = 7'b000_0010; // Displays 60 in the seven segment dispay
SEG_2 = 7'b100_0000;
end
STOP: begin
green_tmp = 1'b0;
red_tmp = ~red_tmp;
// Stop the next car and RED LED blinking
SEG_1 = 7'b001_0010;// Displays 5P in the seven segment dispay
SEG_2 = 7'b000_1100;
end
endcase
end
assign RED_LED = red_tmp ;
assign GREEN_LED = green_tmp;
endmodule

9
RTL View

Output Waveform

Conclusion
The basic idea is to check for the entry of the vehicle at the parking lot and allow them to
enter if they have entered the right password (which they might receive after they pay
nominal parking fee). This system is simpler as it just uses two basic sensors (IR sensors),
LEDs and displays for indication. This system eliminates the wastage of time that occurs in
unproductive work and also ensures that the work is done in an organised manner.

10
Future Work
There is always scope for improvement and our this project is just a beginning phase to an
innovative idea. The sensors used at the entrance and the exit can be of high cost but would
give precise inputs. Another development could be number plate recognition system that
enhances the security levels of parking area.

Contribution
Decision of topic: Aditya R and Avi Nawal
Verilog: Aditya R
Report: Aditya R
PPT: Aditya R
Testbench: Aditya R

References
1. Hua-Chun Tan: Jie Zhang Xin-Chen Ye: Hui-Ze Li; Pei Zhu Qing-Hua Zhao (2009).
"Intelligent car-searching system for large park," Machine Learning and Cybernetics,
2009 international Conference on vol.6, no. pp.3134-3138.
2. Ramneet Kaur and Balwinder Singh, "Design And Implementation Of Car Parking
System On FPGA" International Journal of VLSI design & Communication Systems
(VLSICS) Vol.4. No.3, June 2013. pp. 69-77.
3. Bhavana Chendika et al. In Journal of Engineering Research and Application ISSN
2248-1622. Vol 5 ome 7 (Part-3) July 2015. pp.01-03

11

You might also like