Search Your Query

Custom Search

Monday, 30 May 2011

Automated multistoried car parking system


  1. Introduction
  2. Basic idea
  3. Hardware description
    1. Display section
    2. Keyboard, Indicator & Beeper section
    3. Lift & motor section
    4. Sensor section
    5. LCD section
  4. Software program
1.Introduction:
Automatic multistoried car parking system helps to minimize the car parking area. In the modern world, where parking-space has become a very big problem and in the era of miniaturization, it is become a very crucial necessity to avoid the wastage of space in modern, big companies and apartments etc. In places where more than 100 cars need to be parked, this system proves to be useful in reducing wastage of space. This Automatic Car Parking System enables the parking of vehicles, floor after floor and thus reducing the space used. Here any number of cars can be parked according to the requirement. This makes the system modernized and even a space-saving one. This idea is developed using 8051 Microcontroller. Here program is written according to this idea using 8051.
Photograph of the model
Photograph of the model
2. Basic idea:
A display is provided at the ground floor which is basically a counter that displays number of cars in each floor. It informs whether the floors are fully filled with the cars or is it having place in a particular floor or not. There is facility of lift to carry the car to up and down. Movement of Lift is controlled by stepper motor. An indicator with a green and red LED is kept in all the floors to indicate whether the lift is busy or is it ready to take the car up or down. If the red LED glows that means the lift is already engaged and the person has to wait for the green LED to glow. In this project we have provided three floors of a building for car parking. Maximum storage capacity of each floor is given as ten. Storage capacity can be changed according to the requirement.
Any one can enter to first or second floor. The third floor in this model is for VIP’s only. Therefore when VIP’s are to be entering they are expected to enter their password and they will be taken to the third reserved floor. The password will be of 4 digits. The processor checks for the password entered and if it is found to be wrong, a siren is heard. In this particular model 10 passwords are stored. So when a password is entered, the processor checks for it and it is compared with 10 passwords. It indicates whether it is the correct one or not.
When the car enters the lift, the LDR detects its presence and sends a signal to glow RED LED indicating that the lift is busy. It also sends a signal to motor which makes the motor to rotate. After RED LED glows the lift will take the person and the car up to the floor where the space for parking is available. (For VIP it will be the third floor). When the lift reaches the first floor, the processor compares  the filled amount to that of the already fed capacity of that floor, and if it finds that the first floor is fully filled , it goes to the second floor and thus the procedure stops here. As soon as a car is placed in a particular floor, the display counter at the ground floor increments as to indicate the floor capacity has decreased by one. After the lift places the car in a particular floor, it comes back to its normal position and that time, the motor that drives it , also stops. Now processor sends signal to glow GREEN LED indicating that lift is free.
When a person needs to come down from a particular floor to ground floor, he is expected to focus the headlight onto the LDR placed in that floor. Now sensor section sends signal to motor that the lift has to be send back to that particular floor and sends a signal to glow RED LED indicating that the lift is busy. As soon as the lift reaches that particular floor car should come inside the lift, the display counter at the ground floor decrements by one as to indicate the floor capacity has increased by one. Lift comes back to its normal position and that time, the motor that drives it, also stops. Now processor sends signal to glow GREEN LED indicating that lift is free.
If there no parking taking place, the processor carries out the job according to the following priority:-
  1. It checks whether any password is entered.
  2. It checks whether any car is entered to lift.
  3. It checks whether any car headlight is pressed in front of  LDR placed in each floor.
It is like a round robin system.
3. Hardware description:
Introduction to 8051 Microcontroller:
The first task faced when learning to use a new computer is to become familiar with the capability of the machine. The features of the computer best learned by studying the internal hardware design, also called the architecture of the device, to determine the type, number, and size of the registers and other circuitry.
The hardware is manipulated by an accompanying set of program instructions, or software. One familiar with hardware and software, the system designer can then apply the microcontroller to the problems at hand. In this project we make use of microcontroller.
The 8051 microcontroller generic part number actually includes a whole family of microcontrollers that have numbers ranging from 8031 to 8751.The block diagram of the 8051 shows all of the features unique to microcontrollers:
  1. Internal ROM and RAM
  2. I/O ports with programmable pins
  3. Timers and counters
  4. Serial data communication
The block diagram also shows the usual CPU components program counter, ALU, working registers, and the clock circuits.
The 8051 architecture consists of these specific features:
  1. 8 bit CPU with registers A and B
  2. 16 bit PC &data pointer (DPTR)
  3. 8 bit program status word (PSW)
  4. 8 bit stack pointer(SP)
  5. Internal ROM or EPROM (8751)of 0(8031)to 4k(8051)
  6. Internal RAM of 128 bytes.
  7. 4 register banks , each containing 8 registers
  8. 80 bits of general purpose data memory
  9. 32 input/output pins arranged as four 8 bit ports:P0-P3
  10. Two 16 bit timer/counters:T0-T1
  11. Two external and three internal interrupt sources
  12. Oscillator and clock circuits
A pin out of the 8051 packaged in a 40 pin DIP is shown below.
Internal block diagram of IC 8051
Internal block diagram of IC 8051A pin out of the 8051 packaged in a 40 pin DIP.
A pin out of the 8051 packaged in a 40 pin DIP.

Main sections in this model are
3.1.   Display section
3.2.   Keyboard, indicator & Beeper section
3.3.   Lift & motor section
3.4.   Sensor section
3.5.   LCD section
Program is written using 8051 microcontroller. Two 8255 IC’s are connected to 8051. All circuits are interfaced with 8255. Block diagram of this project is shown below.Block diagram of the project
Block diagram of the project
3.1. Display section
This section displays the floor number along with the number of cars which has been already parked in that particular floor. So whenever a car is ready to either come down or go up, the program either decrements the count or increments the count automatically according to the going up or coming down of a car. Display section is done by interfacing with 8255(PPI) of 8051.Here 3 ports of 8255 are connected to three 7-segment display. Block diagram of this section is shown. Click here to study more about interfacing 7-segment display.
Display section
Display section
3.2. Keyboard, indicator & beeper
In this section,12 switches are connected in matrix form and it has three LED’s , RED, GREEN&YELLOW. The person, needed to enter the password has to wait until the GREEN LED glows and when it glows, he has to press the “START” button first. This time the RED LED glows. Then the person has to enter the password. As soon as it is entered, the program checks it with the already  stored passwords. If it is correct, YELLOW LED glows. If the entered password is wrong, beeper starts beeping signifying the incorrectness of the password entered. Circuit diagram of keyboard is shown bellow.
 Keyboard section
Keyboard section
The indicator section contains 2 LED’s , RED & GREEN  which are present in all the floors. RED LED signifies that the lift is presently busy and shall not entertain any car to enter but if GREEN LED glows, it suggests that the lift is ready and the car can enter the particular floor. Beeper and LED’s are connected to port C upper of 8255.
One more advantage of beeper is that; when a person tries to enter the lift irrespective of finding the display section to be FFF (means the floors are already filled), program sends a signal to Beeper section and it starts beeping indicating that he is not supposed to enter the lift since all the floors are already filled.

3.3. Lift and motor section
In lift section, there is a light beam and LDR   to know whether a car has entered the lift or not. When the GREEN LED of indicator section glows, that means the lift is ready for the car to enter. When the car enters the lift, the light beam falls on LDR present in the lift gets cut and it gives a signal that a car has entered the lift. Then program decides which floor lift has to go and gives a signal to motor section. Circuit diagram of sensor present in lift is shown bellow.
Sensor circuit
Lift Sensor circuit
The motor section is a mechanical part of the model  which is used for taking the lift up/down. When the lift has to go up, program gives the signal and the motor rotates clockwise and if it has to go down, it rotates anticlockwise. First 4 pins port A is connected to motor. Power transistors must be connected to drive the motor. Circuit diagram of this section is shown bellow.
Interfacing stepper motor
Interfacing stepper motor
3.4. Sensor section
Sensor section contains LDR’s .These LDR’s are connected to each floar to give information if any car has to come down.  When a person needs to come down from a particular floor to ground floor, he is expected to focus the headlight the car onto the LDR placed in that floor. When light falls on LDR its resistance decreases. Hence IC 555 triggers and gives a signal. Program identifies that signal and  gives a signal to motor section. The circuit diagram sensor is shown bellow. In this project same circuits is connected to three floors. This circuit is different if you compared with that of lift sensor shown above.
Sensor circuit diagram
Sensor circuit diagram
3.5. LCD Section:
In this project LCD is used to display some messages which is useful to car owners. Here 2X16  LCD ( Liquid Crystal Display) is used. This is used to display messages like
WELCOME TO CAR PARKING SYSTEM
LIFT IS BUSY PLEASE WAIT
PLEASE ENTER YOUR PASSWORD
Circuit diagram of LCD section is shown bellow. LCD is interfaced with 8051 microcontroller.
Click here to study more about interfacing LCD to 8051.
Circuit diagram of LCD interfacing
Circuit diagram of LCD interfacing


8051 Program for Automated multistoried car parking system.
mov r0,#19h
mov @r0,#0bfh
inc r0
mov @r0,#86h
inc r0
mov @r0,#0dbh
inc r0
mov @r0,#0cfh
inc r0
mov @r0,#0e6h
inc r0                            ; Storing the equivalent codes of common cathode display.
mov @r0,#0edh
inc r0
mov @r0,#fdh
inc r0
mov @r0,#87h
inc r0
mov @r0,#0ffh
inc r0
mov @r0,#0e7h
inc r0
mov @r0,#39h
inc r0
mov @r0,#00h
mov r0,#25h               ; Storing the equivalent codes of common anode.
mov @r0,#40h
inc r0
mov @r0,#0f9h
inc r0
mov @r0,#24h
inc r0
mov @r0,#30h
inc r0
mov @r0,#99h
inc r0
mov @r0,#12h
inc r0
mov @r0,#02h
inc r0
mov @r0,#78h
inc r0
mov @r0,#00h
inc r0
mov @r0,#18h
inc r0
mov @r0,#0eh
mov r0,#45h                 ; Storing ten 4 digit passwords in
mov @r0,#00h              ; internal RAM.
inc r0
mov @r0,#01h
inc r0
mov @r0,#02h
inc r0
mov @r0,#03h
inc r0
mov @r0,#08h
inc r0
mov @r0,#00
inc r0
mov @r0,#05h
inc r0
mov @r0,#01h
inc r0
mov @r0,#01h
inc r0
mov @r0,#00
inc r0
mov @r0,#00
inc r0
mov @r0,#01h
inc r0
mov @r0,#06h
inc r0
mov @r0,#00
inc r0
mov @r0,#05h
inc r0
mov @r0,#00
inc r0
mov @r0,#09h
inc r0
mov @r0,#08h
inc r0
mov @r0,#08h
inc r0
mov @r0,#06h
inc r0
mov @r0,#03h
inc r0
mov @r0,#01h
inc r0
mov @r0,#01h
inc r0
mov @r0,#07h
mov a,#08
STORE: dec a
inc r0
mov @r0,a
inc r0
movx @r0,a
inc r0
movx @r0,a
inc r0
movx @r0,a
djnz a,STORE
mov dptr,#2023h            ; Configuring two 8255 ports.
mov a,#81h
movx @dptr,a
mov dptr,#2043h
mov a,#80h
movx @dptr,a
mov r3,#00                    ; Clears the display.
mov r4,#00
mov r5,#00
mov a,r5
call LED_CODES
mov dptr,#2040h
movx @dptr,a
inc dptr
movx @dptr,a
inc dptr
movx @dptr,a
mov dptr,#2022h
mov a,#30h
movx @dptr,a
mov sp,#11h
call lcdwel                      ; Calling LCD display subroutine.
REPEAT: clr psw.3
clr psw.4
mov dptr,#2022h
movx a,@dptr
cjne a,#31h,DONE        ; Comparing whether car is inside the lift.
mov a,#0ah
xrl a,r4
jz SIREN                          ; Call SIREN if second floor is full.
call lcdbusy
mov a,#10h
movx @dptr,a                 ; send lift is busy signal.
call DELAY
mov r7,#02                     ; number of rotations to motor so that lift goes to first floor.
mov r6,#02h
call MOTER_UP                 ; Call motor to rotate clockwise.
mov a,#0ah
xrl a,r3
jz I_FULL                          ; If first floor is full then jump to I_FULL
inc r3
call DELAY
mov a,r3                          ; Increment the number of car in
call LED_CODES               ; first floor and display the number of cars.
mov dptr,#2042h
movx @dptr,a
mov r7,#02h                    ; Again load the  number of rotations to motor
mov r6,#02h
call MOTER_DOWN           ; Call motor to rotate anticlockwise.
mov dptr,#2022h
mov a,#30h
movx @dptr,a                  ; send lift is free signal.
call lcdwel
sjmp DONE
I_FULL:  mov r7,#02h       ;number of rotations to motor so that lift goes to second floor.
mov r6,#02h
call MOTER_UP                  ; Call motor to rotate clockwise.
inc r4
call DELAY
mov a,r4                           ; Increment the number of car in second floor.
call LED_CODES               ; Display the number of cars.
mov dptr,#2041h
movx @dptr,a
mov r7,#04h                    ; Again load the  number of rotations to motor.
mov r6,#02h
call MOTER_DOWN           ; Call motor to rotate anticlockwise.
mov dptr,#2022h
mov a,#30h
movx @dptr,a                   ; send lift is free signal.
call lcdwel
jmp DONE
SIREN: mov a,#70h          ; Subroutine for SIREN.
movx @dptr,a
GO:    movx a,@dptr
jb a.0,GO
jmp OVER1
DONE: movx a,@dptr        ; Compare if start button of the keyboard is pressed.
cjne a,#33h,OVER1
mov a,#0ah
xrl a,r5
jz SIREN                             ; Call SIREN if third flore is full.
mov a,#00
movx @dptr,a
call lcdbusy
setb psw.3
CLEAR: mov r1,#0ah        ; Scanning entered password from keyboard
mov r0,#04h
START: mov dptr,#2020h
mov a,#0eh
movx @dptr,a
WAIT: mov dptr,#2022h
movx a,@dptr
mov r7,#00
xrl a,r7
jz WAIT
mov a,#02
LOOP: mov r6,a
mov dptr,#2020h
movx @dptr,a
mov dptr,#2022h
movx a,@dptr
jnz COLSCAN
inc r7
mov a,r6
rl a
jmp LOOP
COLSCAN: rrc a
jc DONE1
inc r7
inc r7
inc r7
sjmp COLSCAN
OVER1: jmp OVER
DONE1: mov a,r7
clr psw.3
setb psw.4
mov r0,#19h
add a,r0
mov r0,a
mov a,@r0
clr psw.4
setb psw.3
mov dptr,#2021h
movx @dptr,a
inc dptr
UP: movx a,@dptr
jnz UP
mov a,#0ah
xrl a,r7
jz CLEAR
mov a,#0bh
xrl a,r7
jz BIT_CLEAR
mov a,r7
mov @r1,a                     ; Store entered each digit.
inc r1
mov r7,#0ffh
HEAR: djnz r7,HEAR
mov r7,#0ffh
HEAR1: djnz r7,HEAR1
djnz r0,START
mov r7,#0ah                 ; Checking whether entered 4 digit password is
mov r0,#45h                 ; any one of the stored password.
CHECK: mov r1,#0ah
mov r6,#03h
CHECK1:mov a,@r0
xrl a,@r1
jnz NEXT
inc r1
inc r0
djnz r6,CHECK1
mov dptr,#2022h
mov a,#90h
movx @dptr,a
clr psw.3
jmp OK                           ; Jump to OK if password is correct.
NEXT: inc r0
djnz r6,NEXT
inc r0
djnz r7,CHECK
mov dptr,#2022h
mov a,#50h
movx @dptr,a
AGAIN: movx a,@dptr
cjne a,#53h,AGAIN
clr psw.3
mov a,#30h                   ; Give SIREN if entered password is wrong.
movx @dptr,a
REMAIN: movx a,@dptr
xrl a,#33h
jz REMAIN
mov r0,#0ffh
STAY: djnz r0,STAY
call lcdwel
jmp OVER
LED_CODES:setb psw.4
mov r0,#25h
add a,r0
mov r0,a
mov a,@r0
clr psw.4
ret
BIT_CLEAR: dec r1
inc r0
mov r6,#0ffh
HEAR2: djnz r6,HEAR2
mov r6,#0ffh
HEAR3: djnz r6,HEAR3
jmp START
; continued…
OK: movx a,@dptr
cjne a,#91h,OK
mov a,#10h
movx @dptr,a
mov a,#00
mov dptr,#2021h
movx @dptr,a
call DELAY
mov r7,#06h                ; number of rotations to motor so that  lift goes to third flore.
mov r6,#02h
call MOTER_UP             ; Call motor to rotate clockwise.
inc r5                            ; Increment the number of car entered to
call DELAY                    ; third floor and display the number of cars.
mov a,r5
call LED_CODES
mov dptr,#2040h
movx @dptr,a
mov r7,#06h
mov r6,#02h
call MOTER_DOWN          ; Call motor to rotate anticlockwise.
call lcdwel
jmp OVER
MOTER_UP:push r5          ; Subroutine for motor to rotate clockwise.
mov r5,#70h
mov r0,r6
mov dptr,#2020h
mov a,#88h
h3: movx @dptr,a
rl a
mov r2,#30
h1: mov r1,#255
h2: djnz r1,h2
djnz r2,h1
djnz r5,h3
mov r5,#0ffh
djnz r6,h3
mov r6,r0
djnz r7,h3
pop r5
ret
MOTER_DOWN:push r5      ; Subroutine for motor to rotate anticlockwise.
mov r5,#70h
mov r0,r6
mov dptr,#2020h
mov a,#88h
h6: movx @dptr,a
rr a
mov r2,#30
h4: mov r1,#255
h5: djnz r1,h5
djnz r2,h4
djnz r5,h6
mov r5,#0ffh
djnz r6,h6
mov r6,r0
djnz r7,h6
pop r5
ret
DELAY:  mov r1,#10h            ; Subroutine for Delay
DELAY1: mov r2,#0ffh
DELAY2: mov r0,#0ffh
DELAY3: djnz r0,DELAY3
djnz r2,DELAY2
djnz r1,DELAY1
ret
OVER: mov dptr,#2022h
mov a,#30h
movx @dptr,a
movx a,@dptr
cjne a,#32h,I_OVER
mov a,#10h
movx @dptr,a
call lcdbusy
mov r7,#02h
mov r6,#02h
call MOTER_UP               ; Call motor to rotate clockwise.
dec r3                            ; Decrements the number of cars entered to first floor and display
mov a,r3                         ; the number of cars in first floor.
call LED_CODES
mov dptr,#2042h
movx @dptr,a
call DELAY
mov r7,#02h
mov r6,#02h
call MOTER_DOWN       ; Call motor to rotate anticlockwise.
mov dptr,#2022h
mov a,#30h
movx @dptr,a
call lcdwel
I_OVER: movx a,@dptr
cjne a,#34h,II_OVER
mov a,#10h
movx @dptr,a
call lcdbusy
mov r7,#04h
mov r6,#02h
call MOTER_UP               ; Call motor to rotate clockwise.
dec r4                            ; Decrements the number of cars entered to second floor and
mov a,r4                        ; display the number of cars in second floor.
call LED_CODES
mov dptr,#2041h
movx @dptr,a
call DELAY
mov r7,#04h
mov r6,#02h
call MOTER_DOWN       ; Call motor to rotate clockwise.
mov dptr,#2022h
mov a,#30h
movx @dptr,a
call lcdwel
II_OVER: movx a,@dptr
cjne a,#38h,END
mov a,#10h
movx @dptr,a
call lcdbusy
mov r7,#06h
mov r6,#02h
call MOTER_UP              ; Call motor to rotate clockwise.
dec r5                            ; Decrements the number of cars entered to third floor and display
mov a,r5                        ; the number of cars in third floor.
call LED_CODES
mov dptr,#2040h
movx @dptr,a
call DELAY
mov r7,#06h
mov r6,#02h
call MOTOR_DOWN       ; Call motor to rotate anticlockwise.
mov dptr,#2022h
mov a,#30h
movx @dptr,a
call lcdwel
END: jmp REPEAT
lcdwel: push r3             ; Subroutine for LCD to display ‘ WELCOME TO CAR PARKING SYSTEM ’
push r4
mov a,#3ch
call command
mov a,#0eh
call command
mov a,#01h
call command
mov a,#06h
call command
mov a,#80h
call command
mov a,#’W’
call data
mov a,#’E’
call data
mov a,#’L’
call data
mov a,#’C’
call data
mov a,#’O’
call data
mov a,#’M’
call data
mov a,#’E’
call data
mov a,#’ ‘
call data
mov a,#88h
call command
mov a,#’T’
call data
mov a,#’O’
call data
mov a,#’ ‘
call data
mov a,#’C’
call data
mov a,#’A’
call data1
mov a,#’R’
call data
mov a,#aah
call command
mov a,#’P’
call data
mov a,#’A’
call data
mov a,#’R’
call data
mov a,#’K’
call data
mov a,#’I’
call data
mov a,#’N’
call data
mov a,#’G’
call data
mov a,#’ ‘
call data
mov a,#’S’
call data
mov a,#’Y’
call data
mov a,#’S’
call data
mov a,#’T’
call data
mov a,#’E’
call data
mov a,#’M’
call data
pop r4
pop r3
ret
command: mov p1,a
clr p3.4
setb p3.3
clr p3.3
mov r3,#50
A: mov r4,#255
R: djnz r4,R
djnz r3,A
ret
data: mov p1,a
setb p3.4
setb p3.3
clr p3.3
mov r3,#50
AAA: mov r4,#255
AA: djnz r4,AA
djnz r3,AAA
ret
lcdbusy: push r4                  ; Subroutine for LCD to display ‘ LIFT IS BUSY PLEASE WAIT ’
push r3
mov a,#3ch
call command
mov a,#0eh
call command
mov a,#01h
call command
mov a,#06h
call command
mov a,#80h
call command
mov a,#’L’
call data
mov a,#’I’
call data
mov a,#’F’
call data
mov a,#’T’
call data
mov a,#’ ‘
call data
mov a,#’ ‘
call data
mov a,#’I’
call data
mov a,#’S’
call data
mov a,#88h
call command
mov a,#’ ‘
call data
mov a,#’ ‘
call data
mov a,#’B’
call data
mov a,#’U’
call data
mov a,#’S’
call data
mov a,#’Y’
call data
mov a,#aah
call command
mov a,#’P’
call data
mov a,#’L’
call data
mov a,#’E’
call data
mov a,#’A’
call data
mov a,#’S’
call data
mov a,#’E’
call data
mov a,#’ ‘
call data
mov a,#’W’
call data
mov a,#’A’
call data
mov a,#’I’
call data
mov a,#’T’
call data
mov a,#’ ‘
call data
pop r3
pop r4
ret






No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...