\documentclass[12pt,titlepage,a4paper]{article} \usepackage{graphicx} \begin{document} \title {Miniature Electronic Elevator Model} \author {G.VIVEKANANTH \\20032045 \and S.VAIDYANATHAN \\20032036 \and S.RAMANATHAN \\20031991 \and S.SENTHIL KUMAR \\20032013} \maketitle \tableofcontents \setcounter{tocdepth}{2} \section {What this project does} \subsection {Hardware} The Elevator protoype was tested on a 8051 micro controller based PCB. A stepper motor was used to control the motion of the elevator. A Driver IC (L293D) was used to drive the stepper motor. A 7 segment display was indoctrined to show the present floor. 6 buttons (3 simulated to be interior to the lift and 3 exterior) was used to choose between the 3 floors of the hypothetical building. A stop button was also provided to give a delay on pressing. The physical elevator is simulated by a printer head. \newline Due to Hardware problems, we have provided an alternate solution by using the 8085 microprocessor kit to drive the stepper motor. \subsection {Software} The Software to run this project has been done for 2 main micro processors -- the Intel 8085 and Intel 8051 (microcontroller). The 8051 makes use of the internal timer clocks, while the 8085 largely depends on the delay routine to provide its timing facility. \section {Hardware Details} \begin {itemize} \item Intel 8051 Micro Controller \item L293D driver IC \item 6 V input Supply \item Regulator IC \item Stepper Motor \item 7-segment display \item 7-segment driver \item LCD Display \item Keyboard \item Buttons \end {itemize} \section {DataSheets and Pin Details} \subsection {Intel 89S8252 Micro Controller (Intel 8051)} \begin {center} \includegraphics [scale=0.6] {8051.eps} \end {center} %\sebsection { \subsection {L393D -- Driver IC} \begin {center} \includegraphics [scale=0.6] {l293d.eps} \end {center} \subsection {7805 -- Regulator IC} \begin {center} \includegraphics [scale=0.7] {7809.eps} \end {center} \section {Working of the Elevator} \subsection {Main Circuit Diagram} \begin {center}\includegraphics [scale=0.2] {main_circuit1.eps}\end {center} \subsection {Introduction} Miniature Electronic Elevator Model is a simple electronic model showin the workin of a Elevator. This model does all the basic functions of a lift in an efficient manner. The basic functions involve the call buttons to each floor and the emergency stop button. The actual prototype is modelled for 3 floors. But it can be extended to as many floors as possible , dependin on the requirement, the basic model being the same. Let us see the important components used in the prototype model. Stepper motor and 7-segment LED are being interfaced using a micro-controller AT89S8252. The stepper motor is used for the basic up-down movement of the elevator. And the 7-segment display is used to display the floor in which the elevator is present at that instant. We need drivers for driving these components. \subsection {Micro-Controller} Micro-controller is used to interface all the hardware components of the elevator and give commands of operation to the components. The micro controller code decides what has to be done by the elevator at that particular instant. The operation to be performed is decided by the switch which is controlled by the user. The micro-controller plays the most important role in the prototype because this only controls all the components connected to the model. In this model, the micro-controller controls the stepper motor and the 7-segment display which are the hardware components in this prototype model. \subsection { Stepper Motor} The Stepper motor is used for the up-down movement of the elevator. Stepper motor can be rotated using the micro controller by givin a set of sequences in some prescribed order. By changing the order, we can change the direction of the rotation. The speed of the motor can also be changed by changing the speed with which the sequence is changed by the micro-controller. The sequence for the rotation of the stepper motor in the clockwise direction is given in the table1 \begin{tabular}{c|c|c} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{tabular} The sequence for the rotation of the stepper motor in the Anti-Clockwise direction is given in Table 2 \begin{tabular}{ccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{tabular} Thus depending on whether the elevator has to move upward or downward, the stepper motor is designated to rotate either in the clockwise or anti-clockwise direction. The time for which the stepper motor is to be driven depends on the distance between the floors. Thus the stepper motor plays an important role in the movement of the Elevator. The stepper motor cannot be directly driven by the micro controller. It needs a motor driver to do this job which is connected between the controller and the stepper motor. The driver used is L293D . \subsection {7-Segment LED Display} The 7-segment display is used to display the floor in which the elevator is being placed at the present instant. The model is designed with three floors and they are named as Ground floor ( 0 ) , First floor ( 1 ) , Second floor ( 2 ) . Depending on the position of the lift , the corresponding number is displayed by the display. The number to be displayed is sensed by the micro controller and commands are sent to the display to display the corresponding number. The display cannot be directly connected to the micro controller. It needs a driver between the controller and the display so that the controller drives the display. The driver used is 7447 in our prototype. \subsection {Circuit Description} \subsubsection {Power Supply} All the Ics used in our prototype require 5V power supply. This 5V stable power supply is produced by 7805. The input to this can be any voltage greater than 5V and the output will always be a stable 5V output which is connected to the Vcc of all the IC. \subsubsection {Stepper Motor} Now let us see the full circuit description of the protoype. The pin 40 which is Vcc is connected to the 5V supply and 20 is connected to the ground.Pin number 31 which is EA/VPP is connected to Vcc for our purpose. PORT 1 is used for the stepper motor purpose. The pins P1.4 , P1.5 , P1.6 , P1.7 are used to produce the sequence for the stepper motor. They has to be connected to the driver which is L293D. These are connected to the 4 inputs of the driver IC as shown in the circuit diagram. The driver IC has 2 voltages. One is Vss which is used to activate the IC and is given 5V. The other is Vs which is the motor voltage and 15V is given to this voltage supply.There are 4 grounds which are interconnected and connected to the common ground. There are 2 enables namely Enable1 and Enable2. Both are connected to Vcc for our purpose. The corresponding 4 outputs are connected to the stepper motor 4 coils to produce the required sequence. Thus the step motos has been interfaced properly using the controller \subsubsection {Display} Next we have to see how to interface the display. For the display purpose , we use PORT0. The pins used are P0.0 , P0.1 , P0.2 , P0.3. These pins are connected to the inputs A,B,C,D of 7447 which is a binary to 7-segment converter. The binary number is given in the inputs and the output of the driver contains segment output. This can be connected to the 7-segment display . WE use common anode type fpr pur purpose. The pin numbers to which the output of the driver are connected are shown in the circuit diagram. Depending on which number to be displayed , the corresponding binary number is sent from the controller to driver which converts into it 7-segment number. Thus the required number is being displayed usin the driver and 7-segment display. \subsubsection {Switch Control} The action to be performed by the elevator is basically defined by the user through switch control. The Port used for switch action is PORT2. The pins being used for this purpose are P2.2 , P2.3 , P2.4 , P2.5 , P2.6 , P2.7. The switches are directly connected to these pins. The six switches used are Call buttons. One set is interior call buttons for floors 0 , 1 , 2. The other set are exterior call buttons which would be placed in each floor. Now when a switch is pressed by the user , this is detected by the micro controller and the required action is carried out by the micro-controller and the required commands are sent to the stepper motor and display circuit. Thus the required action is performed by the Miniature Electronic Elevator Model as per the user requirement. Thus the circuit of Miniature Electronic Elevator Model is explained with corresponding interfacing components explained at each stage. \section {Working of LCD Display} \subsection {LCD Interfacing Circuit} \begin{center}\includegraphics{CKT1.eps}\end{center} \subsection{LCD Interfacing} This circuit is to interface a liquid crystal display with a micro controller and display the desired in it. Here we use 2*16 display of lcds. Information on liquid crystal displays can be viewed properly only if we view it at an angle of ninety degrees. \subsection {Description} The 2*16 display of lcds have 14 pins which comprises of: \begin {itemize} \item 8 data lines \item RS(register select) \item R/W(read/write) \item E(enable) \item Vcc \item Vee \item GND \end {itemize} \subsection {Data Lines} The data lines are used to transfer the data to and from the micro controller,8 bits at a time. In this the line D7 is used as a an intial flag signal by the lcd when RS=0 and R/W=1,which when high is indicative that the lcd is busy. Hence called the busy flag. \subsection {Control Signals} RS(register select) This is used to select either the command or the data register of the liquid crystal display. When RS=0 then the command register is selected and when RS=1 the data register is selected when the user sending the ascii value of the data to be displayed is sent and displayed in the lcd R/W(read/write) This is decide whether we need to read from or write to the liquid crystal display. When R/W=0 then we are writing and when R/W=1 then we are reading. E(enable) The lcd has an internal latch which is necessary in order to prevent the microcontroller from being loaded due to current requirement of the lcd. When we are writing we need to send to high-to-low signal so that the signal is latched into the lcd. And when we are reading a low-to-high signal is required in order that the data is obtained from the latch \subsection {Vcc,Vss,GND} The lcd requires +3V or +5V to work and the ground pin should be the same as that for the micro controller. The Vss pin is actually a contrast controller. A potentiometer between the source and this pin controls the contrast of the lcd. \section {Cost Estimate} 74LS47 - Rs.20 resistors - Rs.40 capacitors - Rs.40 printer head - Rs.150 PCB - Rs.50 RNC connectors- Rs.80 LCD - Rs.160 7 segmnent LED- Rs.10 keyboard - Rs.30 ------- total - Rs.960 ------- \section{ACKNOWLEDGEMENT} --------------- We hereby express our sincere thanks and gratitude to our lecturer Mr.N.Ramadoss, for bringing out the creativity in us and motivating us to do an useful prototype project. We also thank him for extending his support all through the project which helped us to succeed in our endeavour. \section{8051 Code Segment} \begin{verbatim} org 0h ljmp new org 0003h ljmp stop; org 000Bh mov r7,#01h clr tr0 reti ;org 0013h ;ljmp main org 0200h new: mov ie,#86h setb ip.1 ;here:sjmp here ljmp main org 0030h main: mov r0,#01h mov r1,#01h mov r7,#00h mov p0,#00000011b keys: mov p2,#0ffh mov a,p2 cjne a,#0feh,xkey0 jmp key0 xkey0:mov a,p2 cjne a,#0fdh,xkey1 jmp key1 xkey1:mov a,p2 cjne a,#0fbh,xkey2 jmp key2 xkey2:mov a,p2 cjne a,#0f7h,xkey3 jmp key3 xkey3:mov a,p2 cjne a,#0efh,xkey4 jmp key4 xkey4:mov a,p2 cjne a,#0dfh,xkey5 jmp key5 xkey5:sjmp keys key0: cjne r0,#01h,key01 ljmp keys key01: cjne r0,#03h,key02 dec r0 dec r0 ljmp mot key02: dec r0 ljmp mot key1: cjne r0,#02h,key11 ljmp keys key11: cjne r0,#03h,key12 dec r0 ljmp mot key12: inc r0 ljmp mot key2: cjne r0,#03h,key21 ljmp keys key21: cjne r0,#02h,key22 inc r0 ljmp mot key22: inc r0 inc r0 ljmp mot key3: cjne r0,#01h,key31 ljmp keys key31: cjne r0,#03h,key32 dec r0 dec r0 ljmp mot key32: dec r0 ljmp mot key4: cjne r0,#02h,key41 ljmp keys key41: cjne r0,#03h,key42 dec r0 ljmp mot key42: inc r0 ljmp mot key5: cjne r0,#03h,key51 ljmp keys key51: cjne r0,#02h,key52 inc r0 ljmp mot key52: inc r0 inc r0 ljmp mot stop: mov r3,#0ffh l1: mov r4,#0ffh l2: djnz r4,l1 djnz r3,l2 reti mot: mov r7,#00h mov a,r0 clr c subb a,r1 cjne a,#01h,motup2 setb p3.6 mov r2,#7fh mov a,#88h nlp: mov tmod,#01h mov tl0,#00h mov th0,#00h ;mov ie,#82h setb tr0 here0: clr p3.6 mov p1,a mov r5,#0ffh la1: mov r6,#0cch delaay:djnz r6,delaay djnz r5,la1 rr a setb p3.6 cjne r7,#01h,here0 djnz r2,nlp mov 01,00 mov r7,#00h clr p3.6 ljmp led motup2: cjne a,#02h,motdown1 setb p3.6 mov r2,#0ffh mov a,#88h nlp1: mov tmod,#01h mov tl0,#00h mov th0,#00h ;mov ie,#82h setb tr0 here1: clr p3.6 mov p1,a mov r5,#0ffh lb1: mov r6,#0cch delayb:djnz r6,delayb djnz r5,lb1 rr a setb p3.6 cjne r7,#01h,here1 djnz r2,nlp1 mov 01,00 mov r7,#00h clr p3.6 ljmp led motdown1: cjne a,#0ffh,motdown2 setb p3.7 mov r2,#07fh mov a,#11h nlp2: mov tmod,#01h mov tl0,#00h mov th0,#00h ;mov ie,#82h setb tr0 here2: clr p3.7 mov p1,a mov r5,#0ffh lc1: mov r6,#0cch delayc:djnz r6,delayc djnz r5,lc1 rl a setb p3.7 cjne r7,#01h,here2 djnz r2,nlp2 mov 01,00 mov r7,#00h clr p3.7 ljmp led motdown2: setb p3.7 mov r2,#0ffh mov a,#11h nlp3: mov tmod,#01h mov tl0,#00h mov th0,#00h ;mov ie,#82h setb tr0 here3: clr p3.7 mov p1,a mov r5,#0ffh ld1: mov r6,#0cch delayd:djnz r6,delayd djnz r5,ld1 rl a setb p3.7 cjne r7,#01h,here3 djnz r2,nlp3 mov 01,00 mov r7,#00h clr p3.7 ljmp led led: cjne r1,#01h,floor2 mov p0,#00000000b ljmp keys floor2: cjne r1,#02h,floor3 mov p0,#10000000b ljmp keys floor3: mov p0,#01000000b ljmp keys end \end{verbatim} \end{document}