Automatic Car Parking System: A Mini Project Report Submitted by

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

AUTOMATIC CAR PARKING

SYSTEM
A MINI PROJECT REPORT
Submitted by
ASHOK 11E108
PREM KISHORE M. 11E143
RAJAPRASATH 11E147
RAMZAN SADIQ M.M. 11E151

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

PSG COLLEGE OF TECHNOLOGY


PEELAMEDU, COIMBATORE 641004.

ACKNOWLEDGEMENT:
Before we get into the thick of things, we present out
wholehearted compliments, with higher regards and warm thanks to one
and all, who were the bone behind the sinew of this project. We all give
glory and honour to Almighty God whose belongings and help made this
endeavour a success.
We have great pleasure to convey our gratitude to
Dr. RUDRAMOORTHY, Principal, PSG college of Technology for
permitting to do the mini project.
We express our heartiest gratitude and respectful regards to
Dr. P. NAVANEETHAN, the Head of the Department of EEE, PSG
college of Technology, for his support and encouragement while doing
the mini project.
We express our profound sense of gratitude to our internal
guide Dr. R. NEELAVENI, Associate Professor of EEE department
for her valuable guidance, constructive criticism and consistent
enthusiastic interest during the course of investigation and writing of
manuscript that led this work to its successful completion.
We regard our sincere thanks to the technical staff who
helped us during the project and made our project successful.
Last but not the least, we did like to express our special
thanks to our Parents and friends for their support and constant
encouragement during the project work.

CONTENTS
ABSTRACT
INTRODUCTION
BLOCK DIAGRAM
COMPONENTS REQUIRED
CIRCUIT DIAGRAM
HARDWARE DESCRIPTION
SOFTWARE
FUTURE SCOPE
REFERENCES

ABSTRACT
The Project Automatic Car Parking System using AT89C51
Microcontroller is an interesting project which uses Intel 8051
microcontroller as its brain. The project is designed for car parking.
The aim of this project is to atomize the facility of car parking.
LCD is provided to display the information about the total number of
cars that can be parked and the place free for parking. Two IR TX-RX
pairs are used in this project to identify the entry or exit of the cars
into/out of park. These two IR TX-RX pairs are arranged either side of
the gate. The TX and RX are arranged face to face across the road so
that the RX should get IR signal continuously.
Whenever the mains are switched on, the LCD displays the
message, parking space for 10 vehicles. The number 10 indicates the
maximum capacity of park in this project. Whenever a car comes in
front of the gate, the IR signal gets disturbed and the microcontroller
will open the gate by rotating the stepper motor. The gate will be closed
only after the car leaves the second IR pair since the microcontroller
should know whether the car left the gate or not. Now the
microcontroller decrements the value of the count and displays it on
LCD. In the similar way, the microcontroller increments the count
whenever the car leaves the park. And this count will be displayed in the
LCD display.

INTRODUCTION
Population of Indias six major metropolises increased by
about 1.9 times during 1981 to 2001, the number of motor vehicles went
up by over 7.75 times during the same period. Presently demand for cars
going up at the rate of 15% per annum. Presently approximately 15 lakhs
cars are being sold every year. Cars being parked on roads cause traffic
congestion and pollution. Parking is one of the major concerns in terms
of space occupation in these places. It can be broadly classified into two
categories: On street and off- street. On street parking results in traffic
congestion and therefore off street parking facility should be given more
importance. But, we dont have enough space to construct parking
facilities.
The only solution to this problem is multi-storey parking
system. This can be effectively implemented using Automatic car
parking system.
Car parking lots in buildings are usually managed manually on
the space available advanced system are now giving way to automated
car parking systems, which are cost-effective and also reduce waiting
time for cars.
Using a programmed microcontroller, with photo interruption as
sensor input can be used to output a command to rotate a motor through
motor driver IC in clockwise and anti-clockwise to operate the entry
boom. Motor driver IC L293d is used for the motor while a 16 X2
alphanumerical line LCD display gives the status.

BLOCK DIAGRAM

IR Sensors

Regulated
Power Supply

8051
Microcontroll
er

Motor
Driver

LCD
Driver

COMPONENTS REQUIRED

AT89C51 MICROCONTROLLER
LM293D MOTOR DRIVER IC
16X2 ALPHANUMERICAL LCD
IR LED (2)
TSOP 1738 IR RECEIVER (2)
555 TIMER (4)
DC MOTOR
CAPACITORS 33pF (2)
RESISTORS 10K OHM (8)

CIRCUIT DIAGRAM

In the above circuit diagram, the 2 switches indicate the output of IR


receiver. Output of IR receiver is logic HIGH when it is interrupted by a
entering/leaving car. And the output of IR receiver is usually at logic
LOW. This idea is substituted in the simulation with a switch input,
connected to the pin 2 of 555 timers in the monostable configuration.
HARDWARE DESCRIPTION
1. MICRO-CONTROLLER UNIT:
Micro-controller unit is constructed with ATMEL 89C51
Micro-controller chip. The ATMEL AT89C51 is a low power, higher
performance CMOS 8-bit microcomputer with 4K bytes of flash
programmable and erasable read only memory (PEROM). Its highdensity non-volatile memory compatible with standard MCS-51
instruction set makes it a powerful controller that provides highly
flexible and cost effective solution to control applications.
Micro-controller works according to the program written in it.
The program is written in such a way, so that this controller displays the
data in the LCD according to the information received by the
pushbuttons and the sensing probe.
The 8051 series of microcontrollers are highly integrated single
Chip microcomputers with an 8-bit CPU, memory, interrupt controller,
timers, Serial I/O and digital I/O on a single piece of silicon. The 8051 is
an 8-bit Machine. Its memory is organized in bytes and practically all its
instruction deal with byte quantities. It uses an Accumulator as the
primary register for instruction Results. Other operands can be accessed
using one of the four different addressing modes available: register
implicit, direct, indirect or immediate. Operands reside in one of the five
memory spaces of the 8051.
The five memory spaces of the 8051 are: Program Memory,
External Data Memory, Internal Data Memory, Special Function
Registers and Bit Memory.
The Program Memory space contains all the instructions,

immediate data and constant tables and strings. It is principally


addressed by the 16-bit Program Counter (PC), but it can also be
accessed by a few instructions using the 16-bit Data Pointer (DPTR).
The maximum size of the Program Memory space is 64K bytes. Several
8051 family members integrate on-chip some amount of either masked
programmed ROM or EPROM as part of this memory.
The External Data Memory space contains all the variables, buffers
and data structures that can't fit on-chip. It is principally addressed by
the 16-bit Data Pointer (DPTR), although the first two general purpose
register (R0, R1) of the currently selected register bank can access a
256-byte bank of External Data memory. The maximum size of the
External Data Memory space is 64Kbytes. External data memory can
only be accessed using the indirect addressing mode with the DPTR, R0
or R1.
The Internal Data Memory space is functionally the most
important data memory space. It resides up to four banks of general
purpose registers, the program stack, 128 bits of the 256-bit memory,
and all the variables and data structures that are operated on directly by
the program. The maximum size of the Internal Data Memory space is
256-bytes. However, different 8051 family members integrate different
amounts of this memory space on chip.

2. TSOP1738 (IR Sensor)


The TSOP17XX Series are miniaturized receivers for
infrared remote control systems. PIN diode and preamplifier are
assembled on lead frame, the epoxy package is designed as IR filter. The
demodulated output signal can directly be decoded by a microprocessor.
TSOP17XX is the standard IR remote control receiver series, supporting
all major transmission codes.
Features:
Photo detector and preamplifier in one package
Internal filter for PCM frequency
Improved shielding against electrical field disturbance
TTL and CMOS compatibility
Output active low
Low power consumption
High immunity against ambient light
Continuous data transmission possible (up to 2400 bps)

3. 555 TIMER IC:


The LM555 is a highly stable device for generating
accurate time delays or oscillation. Additional terminals are provided for
triggering or resetting if desired. In the time delay mode of operation,
the time is precisely controlled by one external resistor and capacitor.
For astable operation as an oscillator, the free running frequency and
duty cycle are accurately controlled with two external resistors and one
capacitor. The circuit may be triggered and reset on falling waveforms,
and the output circuit can source or sink up to 200mA or drive TTL
circuits
Applications:
Precision timing
Pulse generation
Sequential timing

4. LM293D MOTOR DRIVER IC:

L293D is a dual H-bridge motor driver integrated circuit (IC).


Motor drivers act as current amplifiers since they take a low-current
control signal and provide a higher-current signal. This higher current
signal is used to drive the motors.
L293D contains two inbuilt H-bridge driver circuits. In its
common mode of operation, two DC motors can be driven
simultaneously, both in forward and reverse direction. The motor
operations of two motors can be controlled by input logic at pins 2 & 7
and 10 & 15. Input logic 00 or 11 will stop the corresponding motor.
Logic 01 and 10 will rotate it in clockwise and anticlockwise directions,
respectively.
Enable pins 1 and 9 (corresponding to the two motors) must
be high for motors to start operating. When an enable input is high, the
associated driver gets enabled. As a result, the outputs become active
and work in phase with their inputs. Similarly, when the enable input is
low, that driver is disabled, and their outputs are off and in the highimpedance state.

5. 162 LCD MODULE:


162 LCD module is a very common type of LCD module
that is used in 8051 based embedded projects. It consists of 16 rows
and 2 columns of 57 or 58 LCD dot matrices. The module were are
talking about here is type number JHD162A which is a very popular
one. It is available in a 16 pin package with back light, contrast
adjustment function and each dot matrix has 58 dot resolution. The
pin numbers, their name and corresponding functions are shown in
the table below.

Pin
No:
1
2

Name Function
VSS

This pin must be connected to


the ground
VCC Positive supply voltage pin (5V
DC)

3
4
5
6
7
8
9
10
11
12
13
14
15
16

VEE
RS
R/W
E
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
LED+
LED-

Contrast adjustment
Register selection
Read or write
Enable
Data
Data
Data
Data
Data
Data
Data
Data
Back light LED+
Back light LEDVEE pin is meant for adjusting the contrast of the LCD
display and the contrast can be adjusted by varying the voltage at this
pin. This is done by connecting one end of a POT to the Vcc (5V), other
end to the Ground and connecting the centre terminal (wiper) of the POT
to the VEE pin.
The JHD162A has two built in registers namely data
register and command register. Data register is for placing the data to be
displayed, and the command register is to place the commands. The
162 LCD module has a set of commands each meant for doing a
particular job with the display. High logic at the RS pin will select the
data register and Low logic at the RS pin will select the command
register. If we make the RS pin high and the put a data in the 8 bit data
line (DB0 to DB7), the LCD module will recognize it as a data to be
displayed. If we make RS pin low and put a data on the data line, the
module will recognize it as a command.
R/W pin is meant for selecting between read and write
modes. High level at this pin enables read mode and low level at this pin
enables write mode.

E pin is for enabling the module. A high to low transition


at this pin will enable the module.
DB0 to DB7 are the data pins. The data to be displayed
and the command instructions are placed on these pins.
LED+ is the anode of the back light LED and this pin
must be connected to Vcc through a suitable series current limiting
resistor. LED- is the cathode of the back light LED and this pin must be
connected to ground.
PROGRAM:
#include<reg51.h>
#include<lcd.h>
sbit i1 = P1^0;
sbit i2 = P1^1;
sbit o1 = P3^0;
sbit o2 = P3^1;
sbit e = P3^2;
sbit RS = P2^5;
sbit RW = P2^6;
sbit EN = P2^7;
sbit D0 = P0^0;
sbit D1 = P0^1;
sbit D2 = P0^2;
sbit D3 = P0^3;
sbit D4 = P0^4;
sbit D5 = P0^5;
sbit D6 = P0^6;
sbit D7 = P0^7;
void MSdelay(void);
void display(unsigned char);
void Lcd8_Ready(void);
void main(void)
{
unsigned char count=0,c=0;

P1= 0xFF;
e=1;
RW=0;
Lcd8_Init();
Lcd8_Set_Cursor(1,1);
Lcd8_Write_String("SWIFT Automatic");
Lcd8_Set_Cursor(2,2);
Lcd8_Write_String("Parking System");
Lcd_Delay(3000);
Lcd8_Clear();
Lcd8_Set_Cursor(1,1);
Lcd8_Write_String("No.of free slots");
Lcd8_Set_Cursor(2,7);
Lcd8_Write_Char('1');
Lcd8_Set_Cursor(2,8);
Lcd8_Write_Char('0');
while(1)
{
while(i1==1)
{
c=0;
o1=1;
o2=0;
MSdelay();
while(i2==1)
{
o1=0;
o2=0;
MSdelay();
if(i1==0)
{
o1=0;
o2=1;

MSdelay();
if(c==0)
{
if(count<=10) count++;
c=1;
display(count);
}
}
}
}
while(i2==1)
{
c=0;
e=1;
o1=1;
o2=0;
MSdelay();
while(i1==1)
{
o1=0;
o2=0;
MSdelay();
if(i2==0)
{
o1=0;
o2=1;
MSdelay();
if(c==0)
{
if(count>0) count--;
c=1;
display(count);
}
}
}

}
if(i1==i2)
{
o1=o2=0;
}
if(count == 10)
e=0;
else
e=1;
}
}
void MSdelay()
{
TMOD=0x01;
TH0=0xFA;
TL0=0x66;
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;
}
void display(unsigned char c)
{
Lcd8_Clear();
//Lcd8_Ready();
Lcd8_Set_Cursor(1,1);
Lcd8_Write_String("No.of free slots");
Lcd8_Set_Cursor(2,7);
switch(c)
{
case 0: Lcd8_Write_Char('1');
Lcd8_Cmd(0x14);
Lcd8_Write_Char('0');
break;
case 1: Lcd8_Write_Char('9');break;

case 2: Lcd8_Write_Char('8');break;
case 3: Lcd8_Write_Char('7');break;
case 4: Lcd8_Write_Char('6');break;
case 5: Lcd8_Write_Char('5');break;
case 6: Lcd8_Write_Char('4');break;
case 7: Lcd8_Write_Char('3');break;
case 8: Lcd8_Write_Char('2');break;
case 9: Lcd8_Write_Char('1');break;
case 10: Lcd8_Clear();
Lcd8_Set_Cursor(1,4);
Lcd8_Write_String("NO SPACE");
Lcd8_Set_Cursor(2,5);
Lcd8_Write_String("AVAILABLE!");
break;
}
Lcd_Delay(300);
}
void Lcd8_Ready()
{
D7 = 1;
RS = 0;
RW = 1;
while(D7==1)
{
EN=0;
MSdelay();
EN=1;
}
return;
}
Lcd.h HEADER FILE:

//LCD Module Connections


extern bit RS;
extern bit EN;
extern bit D0;
extern bit D1;
extern bit D2;
extern bit D3;
extern bit D4;
extern bit D5;
extern bit D6;
extern bit D7;
//End LCD Module Connections
void Lcd_Delay(int a)
{
int j;
int i;
for(i=0;i<a;i++)
{
for(j=0;j<100;j++)
{
}
}
}
//LCD 8 Bit Interfacing Functions
void Lcd8_Port(char a)
{
if(a & 1)
D0 = 1;
else
D0 = 0;

if(a & 2)
D1 = 1;
else
D1 = 0;
if(a & 4)
D2 = 1;
else
D2 = 0;
if(a & 8)
D3 = 1;
else
D3 = 0;
if(a & 16)
D4 = 1;
else
D4 = 0;
if(a & 32)
D5 = 1;
else
D5 = 0;
if(a & 64)
D6 = 1;
else
D6 = 0;
if(a &
128)
D7 = 1;
else
D7 = 0;
}

void Lcd8_Cmd(char a)
{
RS = 0;
EN = 1; // => RS = 0
Lcd8_Port(a);
//Data transfer
Lcd_Delay(5);
EN = 0;
Lcd_Delay(5);
EN = 1;
// => E = 0
}
Lcd8_Clear()
{
Lcd8_Cmd(1);
}
void Lcd8_Set_Cursor(char a, char b)
{
if(a == 1)
Lcd8_Cmd(0x80 + b);
else if(a == 2)
Lcd8_Cmd(0xC0 + b);
}
void Lcd8_Init()
{
Lcd8_Port(0x00);
RS = 0;
Lcd_Delay(200);
///////////// Reset process from datasheet /////////
Lcd8_Cmd(0x30);
Lcd_Delay(50);
Lcd8_Cmd(0x30);
Lcd_Delay(110);
Lcd8_Cmd(0x30);

/////////////////////////////////////////////////////
Lcd8_Cmd(0x38); //function set
Lcd8_Cmd(0x0C); //display on,cursor off,blink off
Lcd8_Cmd(0x01); //clear display
Lcd8_Cmd(0x06); //entry mode, set increment
}
void Lcd8_Write_Char(char a)
{
RS = 1;
EN = 1; // => RS = 1
Lcd8_Port(a);
//Data transfer
//EN = 1;
// => E = 1
Lcd_Delay(5);
EN = 0;
Lcd_Delay(5);
EN = 1;
// => E = 04
}
void Lcd8_Write_String(char *a)
{
int i;
for(i=0;a[i]!='\0';i++)
Lcd8_Write_Char(a[i]);
}

FUTURE SCOPE:
Implementation of this project helps the car drivers to know
which floor is free to park his car and the no. of empty slots in that floor.
And when this idea is expanded, it can also sense the position of free slot
in the parking lot. By implementing this system large amount of space,
time and money can be saved. Space is effectively utilized at

comparatively lower cost, which is more than twice of the limited


parking space on the ground. This idea can be implemented in all Public
parking lots.

BIBLIOGRAPHY
1.

The 8051 Micro controller and Embedded Systems


- Muhammad Ali Mazidi & Janice Gillispie Mazidi

2. Micro controllers Theory and Applications


- Ajay V. Deshmukh
3. Microprocessors and Interfacing
- N.Senthil Kumar, M.Saravanan and S.Jeevananthan
4. www.electroschematics.com
5. www.engineersgarage.com

You might also like