Lift Controller: Proff. Manish K. Patel
Lift Controller: Proff. Manish K. Patel
Lift Controller: Proff. Manish K. Patel
LIFT CONTROLLER
BY:
GUIDED BY:
This is to certify that the project titled “LIFT CONTROLLER” by Keyur C. Mehta (081043) is
a bona fide work carried out by them during the VI semester of their under graduate course in the
Electronics & Communication Engineering under my guidance and supervision.
This is to certify that the project titled “LIFT CONTROLLER” by Mayur S. Maru (081041) is
a bona fide work carried out by them during the VI semester of their under graduate course in the
Electronics & Communication Engineering under my guidance and supervision.
This is to certify that the project titled “LIFT CONTROLLER” by Hardik P. Dave (081017) is
a bona fide work carried out by them during the VI semester of their under graduate course in the
Electronics & Communication Engineering under my guidance and supervision.
First of all we would like to thank Mr. MANISH K.PATEL for giving us the
valuable guidance throughout the project work and making it a successful one. We are also
thankful to our contemporaries and peers who helped us to get through our difficulties.
We are obliged to our university (DDU) and EC department for giving us valuable
support and providing us fully equipped laboratories, so that we could perform our project
successfully.
Ours is a project which is a simple lift controller, which has many practical
applications and is useful in buildings, apartments, etc...Particularly in case of this lift controller,
the user has an option to choose between four floors. As the user gives the input the
microcontroller processes it accordingly and with the help of sensors and motors the lift reaches
its desired destination.
List of figures:
1. Microcontroller (89c51)
2. Motor driver (IC L293D)
3. Voltage regulator (IC 7805)
4. Seven segment display
5. Push button switches
6. DC Motors (30rpm & 100rpm)
7. Crystal oscillator (12MHz)
1. Microntroller (89c51)
L293D ic is 16 pin ic. It is used to drive dc motor. It needs two v cc supplies. One
is for drive dc motor which is 12V and other is for ic itself which is of 5V. It can drive two
motors. According to our input it can rotate motor in forward or backward direction or stop
the motor. In lift controller we have connected lift motor and door motor to this motor driver
ic.
Seven segment display is used to display any number. Here we have used
common anode seven segment display. In this vcc is common for all the pins when any of pin is
grounded then corresponding led will glow and we can see the number.
Push button switch is used to connect or disconnect the path passing through it.
Here we have used it to give inputs to the microcontroller.
Here we have used two DC motors. One is for up and down of lift and the other is
for opening and closing of door. Lift motor specification: 30 rpm , 12V DC & 100N*cm
torque. Door motor specification : 100 rpm , 12V DC & 60N*cm torque.
Other Specifications:
Diameter: 25mm
Length [excluding shaft]: 54mm
Shaft length: 15mm
Shaft diameter: 3mm
Weight: 200g
Crystal oscillator is used to generate high frequency signal. Here we have used 12
MHz frequency oscillator for generating input frequency of microcontroller. Cristal
oscillator is used at this frequency because it is stable at this high frequency.
Block Diagram :
Description of Block Diagram:
USER INPUT:-
The lift controller starts with this block in which the user gives the desired input
with the help of various available input switches. These switches are connected with
microcontroller.
MICROCONTROLLER:-
The next block after input switches is the microcontroller which takes the input
from switches and sensors , processes according to the code written in it and gives the output to
motor driver ic. Here microcontroller is also connected with seven segment display to display
current floor on which lift is appeared.
LIFT SENSOR:-
It senses the floor on which the lift is present. When lift is moving then at time
when it crosses the sensor it gives an interrupt to the controller so that microcontroller works
according to program and gives desired outputs to the motor driver ic .
MOTOR DRIVER:-
It takes input from microcontroller and according to input it gives output to DC
motors and motors rotate. As name suggests it is simply used to drive the motors.
MOTORS:-
Here two DC motors are used. One motor is used to control the lift movement and
the other is used to control the opening and closing of the lift door.
DISPLAY:-
It’s the block that displays the current status of lift position with the help of seven
segment display.
Program Code:
.ORG 0000H
LJMP MAIN
; INTERUPT LIFT PROGRAMING….
.ORG 0013H
PUSH 0E0H;
PUSH 0D0H;
LCALL IPT;
POP 0D0H;
POP 0E0H;
LCALL DELAY3;
RETI;
IPT:
JB P0.0,BIPT;
; FORWARD INTERUPT....
MOV A,R3;
RL A;
MOV R3,A;
INC R2;
MOV A,R2;
LCALL DISPLAY;
MOV A,R3;
CJNE A,04,FIPT1;
CLR P0.1;
LCALL TIMER;
CJNE R5,#00H,FIPT2;
MOV R4,#00H;
RET;
FIPT2:
MOV R4,05;
MOV R5,06;
MOV R6,#00H;
SETB P0.1;
RET;
FIPT1:
RET;
; DISPLAY PROGRAMMING..................................
DISPLAY:
CJNE A,#01H,SECOND
MOV P1,#0F9H
RET
SECOND:
CJNE A,#02H,THIRD
MOV P1,#0A4H
RET
THIRD:
CJNE A,#03H,FORTH
MOV P1,#0B0H
RET
FORTH:
CJNE A,#04H,FIFTH
MOV P1,#99H
FIFTH:
RET
; DISPLAY PROGRAMMING END.................................
; BACKWORD INTERUPT...
BIPT:
MOV A,R3;
RR A
MOV R3,A;
DEC R2;
MOV A,R2;
LCALL DISPLAY
MOV A,R3;
CJNE A,04,BIPT1;
CLR P0.0;
LCALL TIMER;
CJNE R5,#00H,BIPT2;
MOV R4,#00H;
RET;
BIPT2:
MOV R4,05;
MOV R5,06;
MOV R6,#00H;
SETB P0.0;
RET;
BIPT1:
RET;
; END LIFT INTERUPT..
; FORWARD LOOPING............
FLOOP:
CJNE R4,#00H,FLOOOP
SJMP MAINCHECK
FLOOOP:
MOV A,P2;
CPL A;
ANL A,#3EH;
CJNE A,#20H,FLOOP1;
MOV A,R3;
RL A;
MOV R4,A;
MOV R5,#00H;
MOV R6,#00H;
SJMP FSTOP;
FSTOP:
JB P0.1,FSTOP;
LJMP MAINCHECK;
FLOOP1:
CJNE A,03,FDIFFFLOOR;
SJMP FLOOP;
FDIFFFLOOR:
JC FLOOP;
CJNE A,04,FDIFFDEST;
SJMP FCHECKLOOP;
FDIFFDEST:
JC FLOWDEST;
CJNE R5,#00H,FHDEST3;
MOV R5,A;
SJMP FCHECKLOOP;
FHDEST3:
CJNE A,05,FHDEST;
SJMP FCHECKLOOP;
FHDEST:
JC FHDEST2;
MOV R6,A;
SJMP FCHECKLOOP;
FHDEST2:
MOV R6,05;
MOV R5,A;
SJMP FCHECKLOOP;
FLOWDEST:
CJNE R5,#00H,FLDEST3;
MOV R5,04;
MOV R4,A;
SJMP FCHECKLOOP;
FLDEST3:
MOV R6,05;
MOV R5,04;
MOV R4,A;
SJMP FCHECKLOOP;
FCHECKLOOP:
CJNE R4,#00H,FLOOP;
LJMP MAINCHECK;
; END FORWARD LOOPING.....
; BACKWORD LOOPING..........
BLOOP:
CJNE R4,#00H,BLOOOP
SJMP MAINCHECK
BLOOOP:
MOV A,P2;
CPL A;
ANL A,#3EH;
CJNE A,#20H,BLOOP1;
MOV A,R3;
RR A
MOV R4,A;
MOV R5,#00H;
MOV R6,#00H;
SJMP BSTOP;
BSTOP:
JB P0.0,BSTOP;
LJMP MAINCHECK;
BLOOP1:
CJNE A,03,BDIFFFLOOR;
SJMP BLOOP;
BDIFFFLOOR:
JNC BLOOP;
CJNE A,04,BDIFFDEST;
SJMP BCHECKLOOP;
BDIFFDEST:
JNC BLOWDEST;
CJNE R5,#00H,BHDEST3;
MOV R5,A;
SJMP BCHECKLOOP;
BHDEST3:
CJNE A,05,BHDEST;
SJMP BCHECKLOOP;
BHDEST:
JNC BHDEST2;
MOV R6,A;
SJMP BCHECKLOOP;
BHDEST2:
MOV R6,05;
MOV R5,A;
SJMP BCHECKLOOP;
BLOWDEST:
CJNE R5,#00H,BLDEST3;
MOV R5,04;
MOV R4,A;
SJMP BCHECKLOOP;
BLDEST3:
MOV R6,05;
MOV R5,04;
MOV R4,A;
SJMP BCHECKLOOP;
BCHECKLOOP:
CJNE R4,#00H,BLOOP;
LJMP MAINCHECK;
; END BACKWORD LOOPING
TIMER:
CLR P0.6
SETB P0.5
MOV R7,#2EH
REPEAT10:
MOV TMOD,#01H
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
CLR TF0
ROOT20:
SETB P0.5
JNB TF0,ROOT20
CLR TR0
CLR TF0
DJNZ R7,REPEAT10
CLR P0.5
CLR P0.6
MOV R7,#2EH
REPEAT20:
MOV TMOD,#01H
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
CLR TF0
ROOT30:
JNB TF0,ROOT30
CLR TR0
CLR TF0
DJNZ R7,REPEAT20
DELAY1:
MOV R7,#2EH
MOV R1,#00H
REPEAT1:
MOV A,P2
CJNE A,03H,OK
SJMP DELAY2
OK:
MOV TMOD,#01H
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
ROOT1:
SETB P0.6
JNB TF0,ROOT1
CLR TR0
CLR TF0
INC R1
DJNZ R7,REPEAT1
CLR P0.6
RET
DELAY2:
CLR P0.6
SETB P0.5
MOV A,R1
MOV R7,A
REPEAT2:
MOV TMOD,#01H
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
ROOT2:
SETB P0.5
JNB TF0,ROOT2
CLR TR0
CLR TF0
DJNZ R7,REPEAT2
CLR P0.4
CLR P0.5
SJMP DELAY4
DELAY4:
MOV R7,#2EH
REPEAT4:
MOV TMOD,#01H
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
ROOT4:
JNB TF0,ROOT4
CLR TR0
CLR TF0
DJNZ R7,REPEAT4
SJMP DELAY1
DELAY3:
MOV R7,#1EH
REPEAT3:
MOV TMOD,#01H
MOV TL0,#00H
MOV TH0,#00H
SETB TR0
ROOT3:
JNB TF0,ROOT3
CLR TR0
CLR TF0
DJNZ R7,REPEAT3
RET
.END
Working:
Working of lift is started with user input. When user gives any input with the help
of push button switches then it goes to microcontroller port p2. We have used p2 port as input
port. Now microcontroller starts working. According to the code written into it, it will give signal
to port p0. Now p2 port is connected to motor driver IC so command will be passed to motor
driver IC and it will rotate motor in either forward or backward direction. Here p1 port of
microcontroller is connected to seven segment display so it shows current floor. When lift passes
through any floor then sensor gives interrupt to microcontroller and if lift reached to desire floor
then motor stops otherwise it will continuously rotates. Here seven segment display number is
updated by microcontroller when lift passes through any floor.
Now what happens in microcontroller when it detects the input? It first checks the
current status of lift. If pressed button and current status is same then it open and close the door
using motor. If destination and current status is not same then motor rotates and lift goes to
destination. When lift reaches to destination then lift stops and door opens. Door stills open for 3
seconds and then door closes.
For example, now suppose we are on the first floor and two inputs are given
simultaneously, say second and fourth, then the lift will first go to the second floor, stops and
open and close the door for some time and then go to the fourth floor. Similar will be the case,
that if we are on fourth floor and we press first and third floor together, we will first stop on third
and then on the first floor. Hence, the closest floor is given the topmost priority. We have made
logic for 3 inputs at a time, so three different floor inputs can be given at a time. Along with all
these processes microcontroller will also display the status of the floor on which lift has reached
with the help of the seven segment display.
Troubleshoot:
First we cannot get output at port p0. Then we studied the datasheet of 89c51 and
connected 10k pull up resistors to get output.
In making of model we have found many difficulties. Firstly we have made model
using thermokol but it could not lift whole the load, so we made model using wood.
Applications:
Future Extension:
I. Websites:
www.electronicsforu.com
www.datasheetcatalog.com
II. Books: