Industrial Automation Lab Manual
Industrial Automation Lab Manual
Prepared for
Department of Electrical & Electronics Engineering
by:
INSTRUCTIONS TO STUDENTS
1. Only enter the lab wearing proper uniform, shoes, and ID card
2. Use the tools, training kits, computers and equipments safely to avoid
injuring yourself and damaging the equipments.
3. Never run inside the lab.
4. Do your work with very attentive mind and carefulness.
5. Students must bring the rough record every day, with the experiment or
work of that day written and diagrams and table drawn.
6.
on next day.
Course Outcome:
LIST OF PRACTICALS
1. To write assembly language programmes, execute and verify the result for the following;
i. Various arithmetic operations.
ii. Various data transfer operations.
iii. Finding the maximum value in an array.
iv. Arrange an array in ascending order / descending order.
v. BCD to Hex conversion.
2. To write an assembly language programme to Interface LEDs through port 1 including time
delay.
3. To write an assembly language programme and control a stepper motor.
4. To write an assembly language programme and control a DC motor.
5. To wire up hardware, write and implement ladder programmes for the following controls.
i. Lamp control for various situations.
a. Staircase control, hospital etc.
b. Traffic light control.
ii. Induction motor controls as in direct on Line (DOL) starter, Star-delta starter.
iii. Conveyor motor controls.
iv. Lift controls
v. Water level control using level sensors.
8051 MICROCONTROLLER
Experiment No: 1
Date :
AIM: To study 8051 microcontroller architecture, pin details, programming model and features.
a. ALU 8 bit
b. RAM 128 byte
c. ROM - 4k
d. I/O port 4 no. x 8 bit = 32 bits
e. Instruction set 111
f. Timers - 2 no. x 16 bit
g. Program memory 64k
h. Data memory 64k
i. Clock 12MHZ
j. Serial port 1 no.
k. Interrupt source 5 no.
l. On-chip oscillator and clock circuit
m. Boolean processor
n. Full duplex UART (sending and receiving at a time)
PIN DETAILS
40 Pin DIP
ARCHITECTURE OF 8051
PROGRAMMING MODEL
RESULT
Studied 8051 microcontroller architecture, pin details, programming model and features.
Experiment No: 2
Date :
8 BIT MULTIPLICATIONS
AIM: Write an assembly language program to find the product of two numbers stored in the
external memory location [4100]H and [4101]H. Store the result in the external
memory location [4102]H (LSB) and [4103]H (MSB). Write the assembly listing. Enter
the program (or hex code) in 8051 microcontroller kit and execute the program and
show the result.
PROBLEM ANALYSIS
In order to perform multiplication in 8051 the two numbers should be stored in A and B
registers. Then multiplication can be performed using MUL instruction. After multiplication
the 16 bit product will be in A(LS Byte) and B (MS byte).
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4200H Starting address
MOV DPTR,#4100 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4100)
Copy the data from
MOV B,A
accumulator to B register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4101)
MUL AB Multiply A and B
INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A external memory
location(4102)
Copy the data from B to
MOV A,B
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4103)
HALT SJMP HALT Stop execution
END
PROCEDURE
RESULT
Multiplication of two 8 bit numbers is done and the result is stored in the external memory
locations.
Input Output
st nd
1 no. 2 no. MS Byte LS Byte
Memory
[4100] [4101] [4103] [4102]
address
Data
Experiment No: 3
Date :
SQUARE OF A NUMBER
AIM: Write an assembly language program to find the square of the number stored in the
external memory location [4200]H. Store the result in the external memory location
[4201]H (LSB) and [4202]H (MSB). Write the assembly listing. Enter the program (or
hex code) in 8051 microcontroller kit and execute the program and show the result.
PROBLEM ANALYSIS
Square of a number can be obtained by multiplication. To get square the same number should
be stored in Reg A & Reg B. The MUL instruction can be used for getting square. After
multiplication the 16 bit product will be in A(LS Byte) and B (MS byte).
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4300H Starting address
MOV DPTR,#4200 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4200)
Copy the data from
MOV B,A
accumulator to B register
MUL AB Multiply A and B
INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A external memory
location(4201)
Copy the data from B to
MOV A,B
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4202)
HALT SJMP HALT Stop execution
END
PROCEDURE
4.
twice after each instruction.
5.
6. Now for executing the progr
7.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.
RESULT
Input Output
Hex no. MS Byte LS Byte
Memory
[4100] [4202] [4201]
address
Data
Experiment No: 4
Date :
AIM: Write an assembly language program to divide the numbers stored in the external
memory location [4300]H and [4301]H. Store the QUOTIENT in the external memory
location [4302]H and REMAINDER in [4303]H. Write the assembler listing. Enter the
program (or hex code) in 8051 microcontroller kit and execute the program and show
the result.
PROBLEM ANALYSIS
In order to perform division in 8051, the dividend should be stored in A register and the
divisor should be stored in B register. Then the content of A can be divided by content of B
using the instruction DIV AB. After division the quotient will be in Reg A and the remainder
will be in Reg B.
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4400H Starting address
MOV DPTR,#4300 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4300)
MOV B,A Copy the data from
accumulator to B register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4301)
DIV AB Divide A by B
INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A external memory
location(4302)
Copy the data from B to
MOV A,B
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4303)
HALT SJMP HALT Stop execution
END
PROCEDURE
7.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.
RESULT
Division of two 8 bit numbers is done and the result is stored in the external memory
locations.
Input Output
Divisor Dividend Quotient Remainder
Memory
[4300] [4301] [4302] [4303]
address
Data
Experiment No: 5
Date :
8 BIT ADDITION
AIM: Write an assembly language program to add two 8 bit numbers stored in the external
memory location [4400]H and [4401]H. Store the result in the external memory
location [4402]H (LSB) and [4403]H (MSB). Write the assembly listing. Enter the
program (or hex code) in 8051 microcontroller kit and execute the program and show
the result.
PROBLEM ANALYSIS
In order to perform addition in 8051 one of the data should be in Accumulator (A) and other
data should be in SFR(direct address) or in internal RAM location or an immediate number.
Addition can be performed by ADD instruction. After addition sum is available in
accumulator.
The sum of two 8 bit data can be either 8 bits (sum only) or 9 bit (8 bit sum and 1 bit carry).
Hence to accommodate carry register R7 is used in this program.
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4500H Starting address
CLR C Resetting carry flag.
MOV DPTR,#4400 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4400)
Copy the data from
MOV R0,A
accumulator to R0 register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4401)
Get the immediate data 00H
MOV R7,#00H
to register R7.
Add the content in R0 with
ADD A,R0
accumulator.
JNC AHEAD Jump if no carry to AHEAD
INC R7 Increment register R7.
AHEAD: INC DPTR Increment DPTR
Transfer the data from A to
MOVX @DPTR,A
external memory
location(4402)
Copy the data from R7 to
MOV A,R7
Accumulator
INC DPTR Increment DPTR
Transfer data from A to
MOVX @DPTR,A external memory
location(4403)
HALT: SJMP HALT Stop execution
END
PROCEDURE
4.
twice after each instruction.
5.
6.
7.
8.
9. <address of external memory location where
result is stored>
10. Now data stored in that location will be displayed.
RESULT
Addition of two 8 bit numbers is done and the result is stored in the external memory
locations.
Input Output
st nd
1 no. 2 no. MS Byte LS Byte
Memory
[4400] [4401] [4403] [4402]
address
Data
Experiment No: 6
Date :
8 BIT SUBTRACTION
AIM: Write an assembly language program to subtract two 8 bit numbers stored in the
external memory location [4500]H and [4501]H(number stored in 4501H number
stored in 4500H ). save the difference in external memory location [4502]H if the
number is positive write data 00 in [4503] H to indicate positive sign. If the number is
negative write data 01 in [4503]h to indicate negative sign.
PROBLEM ANALYSIS
In order to perform subtraction in 8051 one of the data should be in Accumulator (A) and
other data should be in SFR(direct address) or in internal RAM location or an immediate
number. Subtraction can be performed by SUBB instruction. After subtraction difference is
available in accumulator.
The difference of two 8 bit data can be either 8 bits (difference only) or 9 bit (8 bit difference
and 1 bit borrow). Hence to accommodate borrow register R7 is used in this program.
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4600H Starting address
CLR C Resetting carry flag.
MOV DPTR,#4500 Initializing DPTR
Load the data to A from
MOVX A,@DPTR external memory location
(4500)
Copy the data from
MOV R0,A
accumulator to R0 register
INC DPTR Increment DPTR
Load the 2nd data to A from
MOVX A,@DPTR external memory
location(4501)
Get the immediate data 00H
MOV R7,#00H
to register R7.
Add the content in R0 with
SUBB A,R0
accumulator.
JNC AHEAD Jump if no carry to AHEAD
INC R7 Increment register R7.
CPL A Compliment the accumulator
INC A Increment accumulator
AHEAD: INC DPTR Increment DPTR
PROCEDURE
7.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.
RESULT
Subtraction of two 8 bit numbers is done and the result is stored in the external memory
locations.
Input Output
1st no. 2nd no. MS Byte LS Byte
Memory
[4500] [4501] [4503] [4502]
address
Data
Experiment No: 7
Date :
BLOCK TRANSFER
PROBLEM ANALYSIS
In order to transfer a block of data from one external memory location to other, initializes the
counter R6 and get the number in accumulator and save in register R0. Each time we check
whether R6 equal to zero and save the in result location
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4700H Starting address
MOV DPTR,#4501 Initializing DPTR
MOV R0,#50 Move 50H to R0
Initialize the counter with
MOV R6,0AH
number of data
BACK1: MOVX A,@DPTR Bring data to accumulator
Move the data from
MOV @R0,A
accumulator to register R0
INC DPTR Increment DPTR
INC R0 Increment R0
Decrement counter, if not
DJNZ R6,BACK 1
zero, go to BACK1
Initialize the counter with
MOV R6,0AH
number of data
MOV R0,#50 Move 50H to R0
MOV DPTR,#4601 Initializing DPTR
Move data from register R0
BACK2: MOV A,@R0
to accumulator
Transfer the data from A to
MOVX @DPTR,A
external memory location
INC DPTR Increment DPTR
INC R0 Increment R0
Decrement counter, if not
DJNZ R6,BACK 2
zero, go to BACK2
HALT: SJMP HALT Stop execution
END
PROCEDURE
7.
8.
9. Now
result is stored>
10. Now data stored in that location will be displayed.
RESULT
Input Output
Memory address Data Memory address Data
[4501]H [4601]H
[4502]H [4602]H
[4503]H [4603]H
[4504]H [4604]H
[4505]H [4605]H
[4506]H [4606]H
[4507]H [4607]H
[4508]H [4608]H
[4509]H [4609]H
[450A]H [460A]H
Experiment No: 8
Date :
PROBLEM ANALYSIS
In order to find the largest data from the set of que. Each
time we compare one data with other and save largest one in one of the memory locations
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4800H Starting address
MOV DPTR,#4701 Initializing DPTR
Initialize the counter with
MOV R6,#0AH
number of data
MOVX A,@DPTR Bring data to accumulator
Move the data from
MOV R4,A
accumulator to register R4
Decrement counter by
DEC R6 one(because 1st number is
already taken)
AGAIN: INC DPTR Increment DPTR
MOVX A,@DPTR Bring data to accumulator
Move the data from
MOV R2,A
accumulator to register R2
CLR C Clear Carry bit
Subtract data in R4 from data
SUBB A,R4
in Accumulator.
Check for carry, if carry bit is
set, jump to an instruction
JC AHEAD
which contains label as
AHEAD
Move the data from R2 to
MOV A,R2
register accumulator
PROCEDURE
7. layed.
8.
9.
result is stored>
10. Now data stored in that location will be displayed.
RESULT
OUTPUT
INPUT (Largest
data)
Memory
4701 4702 4703 4704 4705 4706 4707 4708 4709 470A 4600
address
Data
Experiment No: 9
Date :
LED INTERFACING
AIM: Write
the pattern given in the external memory location [4600] H. The LED should be turn
ON and OFF alternatively 10 times.
PROBLEM ANALYSIS
LED logic one has to be applied to its anode and logic zero to the cathode. Here L
connected in common anode configuration (which means logic one is already present in the
anode). Hence on receiving logic zero the corresponding led will be turned ON and by
receiving a logic one the corresponding led will be turned OFF .
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4700H Starting address
MOV R7,#0A Initialize the counter
MOV DPTR,#4600 Initialize data pointer
MOVX A,@DPTR Bring data to accumulator
Move the data from
REPEAT: MOV P1,A accumulator to register
P1(port one)
ACALL DELAY Call delay subroutine.
CPL A Compliment Accumulator
Decrement counter if not
DJNZ R7,REPEAT
equal to zero go to REPEAT
Move logic one to port one to
MOV P1,#FF
turn
HALT: SJMP HALT Stop execution.
Move the content FF to
DELAY: MOV R0,#FF
register R0
Move the content FF to
BACK2: MOV R1,#FF
register R1
Move the content 0A to
BACK1: MOV R2,#0A
register R2
PROCEDURE
7.
8.
9. N
result is stored>
10. Now data stored in that location will be displayed.
RESULT
Input
Memory address OUTPUT
[4600]H
FF
0F
DATA F0
AA
55
Experiment No: 10
Date :
AIM: Write an assembly language program to rotate a stepper motor by a particular angle
defined by a number stored in the external memory location [4400] H. The rotation
angle should be able to change by changing the number stored in [4400] H.
PROBLEM ANALYSIS
Stepper motors operate differently from normal DC motors, which simply spin when voltage
is applied to their terminals. Stepper motors, on the other hand, effectively have multiple
"toothed" electromagnets arranged around a central metal gear. To make the motor shaft turn,
first one electromagnet is given power, which makes the gear's teeth magnetically attracted to
the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet,
they are slightly offset from the next electromagnet. So when the next electromagnet is turned
on and the first is turned off, the gear rotates slightly to align with the next one, and from
there the process is repeated. Each of those slight rotations is called a "step." In that way, the
motor can be turned a precise angle. There are two basic arrangements for the
electromagnetic coils: bipolar and unipolar.
There are four coils in the stepper motor namely ABCD. These coils are activated by giving a
value 1 to the corresponding pin in the port P1 of the microcontroller. The coils are
deactivated by giving a value 0 to the corresponding pin in the port P1 of the microcontroller.
When two adjacent coils are activated the rotor rotates and stops at a position in between
those coils. Port P1 is accessed through port P9 of the training kit. P9 is connected to P12
port in the kit which is dedicated for stepper motor. The values to be given to port P1 for each
position is given in table below. A counter is set using a value in register R3. Four steps are
counted for one decrement in R3 value. Thus we can set number of steps required and thus
angle of rotation by the value we store in R3.
39 H 0011 1001 1 0 0 1
35 H 0011 0101 0 1 0 1
36 H 0011 0110 0 1 1 0
3A H 0011 1010 1 0 1 0
HEX HEX
LABEL INSTRUCTION COMMENT
ADDRESS CODE
ORG 4100H Starting address
4100 MOV DPTR,#4400 Initialize data pointer
4103 MOVX A,@DPTR Bring data to accumulator
Move the data from
4104 MOV R3,A accumulator to register R3 for
a counter
Move value to port one to
4105 START MOV P1,#39H
turn rotor to first step
4108 ACALL DELAY Call delay subroutine.
Move value to port one to
410A MOV P1,#35H
turn rotor to second step
410D ACALL DELAY Call delay subroutine.
Move value to port one to
410F MOV P1,#36H
turn rotor to third step
4112 ACALL DELAY Call delay subroutine.
Move value to port one to
4114 MOV P1,#3AH
turn rotor to fourth step
4117 ACALL DELAY Call delay subroutine.
Decrement counter by one for
4119 DEC R3
counting 4 steps
Move the new value of
411A MOV A,R3
counter to the accumulator.
Stop further execution if
411B END JZ END
counter value becomes zero
Continue rotation if counter
411D SJMP START
value is not zero
Move the content 0A to
411F DELAY: MOV R1,#0AH register R1 for a counter
value to create a delay
Move the content FF to
register R2 for a counter
4121 BACK2 MOV R2,#FFH
value within a counter to
create a delay
Continue decreasing R2
4123 BACK1 DJNZ R2, BACK1
counter until it becomes zero
Decrease R1 counter and
4125 DJNZ R1, BACK2 jump back to R2 counter if
R1 counter is not zero
Stop the delay subroutine and
4127 RET return back to the main
program
PROCEDURE
6. Now enter the instructions in assembly language one by one and pre
twice after each instruction.
7.
8. Connect port P9 and P12 headers of the kit using 10 core connecting cable.
9.
10.
11.
12. Measure the angle of rotation of the stepper motor.
RESULT
PROGRAMMABLE LOGIC
CONTROLLER
Experiment No: 11
Date :
LOGIC GATES
AIM: To prepare a ladder program for realization of logic gates and verify the truth tables
using PLC trainer kit
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.2 Logic input A
DI.3 Logic input B
DO.0 Logic output Q
AND Gate: The AND gate output will be high state only when all the inputs are in high
DI.2 and DI.3 are the two digital inputs.
DO.0 is the AND gate digital output.
A B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate: Its output will become high if any of the input is in high state.
represents the OR Gate. DI.2 and DI.3 are the two digital inputs. DO.0 is the OR gate
digital output.
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
XOR Gate: Its output will be high if and only if one input is in high state.
represents the XOR Gate. DI.2 and DI.3 are the two digital inputs. DO.0 is the XOR gate
digital output.
TRUTH TABLE LADDER PROGRAM
A B A xor B
0 0 0
0 1 1
1 0 1
1 1 0
CONNECTION DIAGRAM
PROCEDURE
1. Switch on the PC.
2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.
RESULT
Prepared a ladder program for logic gates and verified the truth tables using PLC trainer kit.
Experiment No: 12
Date :
AIM: To prepare a ladder program for staircase lamp control and verify the truth table using
PLC trainer kit
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DO.0 Logic output for lamp L1
In staircase lamp control we are using two toggle switches DI.2 and DI.3 to control the
lamp. Output lamp control is through DO.0. The output is ON only when the input
switches are having opposite conditions.
STATUS TABLE
S1 S2 L1
0 0 0
0 1 1
1 0 1
1 1 0
LADDER PROGRAM
CONNECTION DIAGRAM
PROCEDURE
RESULT
Prepared a ladder program for staircase lamp control and verified the truth tables using
PLC trainer kit.
Experiment No: 13
Date :
AIM: To prepare a ladder program for godown lamp control and verify the truth table using
PLC trainer kit
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DI.4 Logic input for switch S3
DO.0 Logic output for lamp L1
DO.1 Logic output for lamp L2
DO.2 Logic output for lamp L3
In godown lamp control we are using three toggle switches S1 , S2, S3 to control three
lamps L1, L2, L3. The input switches are connected to the digital inputs DI.2, DI.3 and
DI.4 of the PLC and the lamps are connected to the relays which are connected to digital
outputs DO.0, DO.1 and DO.2 of the PLC. L1 is ON when S1 only is ON. L1 turns off
and L2 turns on when S2 is also turned ON. Then L2 turns off and L3 turns ON when S3
is also turned ON. Rung 1 is for controlling L1, Rung 2 is for controlling L2 and Rung 3
is for controlling L3.
STATUS TABLE
S1 S2 S3 L1 L2 L3
0 0 0 0 0 0
1 0 0 1 0 0
1 1 0 0 1 0
1 1 1 0 0 1
LADDER PROGRAM
CONNECTION DIAGRAM
PROCEDURE
1. Switch on the PC.
2. Open the Connected Components Workbench software from start menu or desktop.
3. To create a new project click New and select the controller Micro 810 (QWB) and
Add to project.
4. From the Project menu right click the Program tab and select Add New LD .
5. Construct ladder diagram for the program by dragging instruction set in the Tool box
menu and giving proper addresses for input and output as shown in the ladder
diagram.
6. Build the program, and correct if any error specified in the bottom of the screen.
7. cable.
8. Download the prepared ladder program.
9. Run the program and verify the result.
RESULT
Prepared a ladder program for godown lamp control and verified the truth tables using
PLC trainer kit.
Experiment No: 14
Date :
AIM: To prepare a ladder program for master control of lamps and verify the truth table using
PLC trainer kit
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DI.4 Logic input for switch S3
DI.5 Logic input for switch S4
DO.0 Logic output for lamp L1
DO.1 Logic output for lamp L2
DO.2 Logic output for lamp L3
In master control of lamps we are using four toggle switches S1, S2, S3, and S4 to
control three lamps L1, L2 and L3. S4 is the master switch. The input switches are
connected to the digital inputs DI.2, DI.3, DI.4 and DI.5 of the PLC and the lamps are
connected to the relays which are connected to digital outputs DO.0, DO.1 and DO.2 of
the PLC. L1 is ON when S1 only is ON. L2 is ON when S2 only is ON. L3 is ON when
S3 only is ON. But L1, L2 and L3 turns ON when S4 is turned ON irrespective of the
condition of other switches S1, S2 and S3. Rung 1 is for controlling L1, Rung 2 is for
controlling L2 and Rung 3 is for controlling L3.
STATUS TABLE
S1 S2 S3 S4 L1 L2 L3
0 0 0 0 0 0 0
1 0 0 0 1 0 0
0 1 0 0 0 1 0
0 0 1 0 0 0 1
0 0 0 1 1 1 1
CONNECTION DIAGRAM
LADDER PROGRAM
PROCEDURE
RESULT
Prepared a ladder program for master control of lamps and verified the truth tables using
PLC trainer kit.
Experiment No: 15
Date :
AIM: To prepare a ladder program for hospital lamp control and verify the truth table using
PLC trainer kit
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.2 Logic input for switch S1
DI.3 Logic input for switch S2
DO.0 Logic output for relay D0
DO.1 Logic output for relay D1
DO.2 Logic output for relay D2
DO.3 Logic output for relay D3
In hospital lamp control we are using two toggle switches S1 and S2 to control two
lamps L1 and L2. The input switches are connected to the digital inputs DI.2 and DI.3 of
the PLC. The lamps should be connected for a series and parallel connection. Therefore
lamps could not be directly controlled by two digital outputs only. To achieve both series
and parallel connections four control relays has to be used. These four relays are
controlled by the digital outputs DO.0, DO.1, DO.2 and DO.3. The conditions of the
status table are achieved by controlling the four digital outputs based on the ladder logic
program made referring the truth table prepared.
When S1 and S2 is OFF all four relays are OFF. When both lamps have to be bright
relays D0, D1, D2 has to be closed. When only one lamp has to be bright only D1 has to
be closed. When both lamps has to be dim D0, D3 has to be closed and D1 and D2 has to
be open. D1, D2 and D3 should never be closed together to avoid short circuit.
Rung 1 is for controlling D0, Rung 2 is for controlling D1, Rung 3 is for controlling D2,
and Rung 3 is for controlling D3.
S1 S2 L1 L2 S1 S2 D0 D1 D2 D3
0 0 OFF OFF 0 0 0 0 0 0
0 1 BRIGHT BRIGHT 0 1 1 1 1 0
1 1 BRIGHT OFF 1 1 0 1 0 0
1 0 DIM DIM 1 0 1 0 0 1
CONNECTION DIAGRAM
LADDER PROGRAM
PROCEDURE
RESULT
Prepared a ladder program for hospital lamp control and verified the truth tables using
PLC trainer kit.
Experiment No: 16
Date :
DOL STARTER
AIM: To prepare a ladder program for DOL starting of a three phase motor and verify the
program using PLC trainer kit.
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.0 START Push botton
DI.1 STOP Push botton
DI.2 OLR switch
DO.0 STARTER COIL
In DOL starter the three phase supply to the motor winding connections are given
through the main contacts of a three phase contactor. The contactor is turned ON by
energizing its electromagnetic coil. The coil is energised through relay module in PLC
connected to DO.0 output. The output DO.0 is turned ON when START push button is
pressed which sends the input signal to input DI.0. When turned ON, the STARTER
holds in ON condition due to the holding circuit in the ladder program. The output DO.0
is turned OFF when STOP push button is pressed which sends the input signal to input
DI.1. A toggle switch named OLR switch in the trainer kit is used to emulate overload
condition. When this switch is turned on it sends a signal to DI.2 which will turn OFF the
output DO.0 and thus starter coil is de-energised and motor is turned OFF.
CONNECTION DIAGRAM
LADDER PROGRAM
PROCEDURE
RESULT
Prepared a ladder program for DOL starting of a three phase motor and verified the
program using PLC trainer kit by running the motor.
Experiment No: 17
Date :
AIM: To prepare a ladder program for STAR DELTA starting of a three phase motor and
verify the program using PLC trainer kit.
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.0 START Push botton
DI.1 STOP Push botton
DI.2 OLR switch
DO.0 MAIN CONTACTOR COIL
DO.1 STAR CONTACTOR COIL
DO.2 DELTA CONTACTOR COIL
In STAR DELTA starter the three phase supply to the motor winding connections are
given first in STAR connection and then in DELTA connection.
RUNG 1 - The MAIN contactor is turned ON when the output DO.0 is turned ON by the
input START button (DI.0). The holding circuit in the program holds the main
contactor in ON position. STOP switch will turn off the MAIN contactor.
RUNG 2 - The STAR contactor is turned ON when the output DO.1 is turned ON after
the MAIN contactor NO switch closes. NC switches in name of the TIMER
and DELTA contactor is also in this rung to turn OFF the STAR Contactor.
RUNG 3 - An On time delay timer T1 is started when MAIN contactor NO switch closes.
After the set time 10sec is over, the local variable TIMER 1 turns ON and it
turns OFF the STAR contactor by opening its NC switch in Rung 2.
RUNG 4 - TIMER 1 turns ON another timer TIMER 2 to delay the turning ON of
DELTA contactor by 500ms.
RUNG 5 - The NO switch of Main contactor is already closed. When the set time of
TIMER 2 is over the NO switch of local variable TIMER 2 in Rung 5 closes to
turn ON the DELTA Contactor output DO.2. The NC switch of STAR
prevents DELTA and STAR contactors from being turned ON together.
CONNECTION DIAGRAM
LADDER PROGRAM
PROCEDURE
RESULT
Prepared a ladder program for STAR DELTA starting of a three phase motor and verified
the program using PLC trainer kit by running the motor.
Experiment No: 18
Date :
AIM: To prepare a ladder program for running a three phase motor in forward direction for 10
sec then stop for 10 sec and then in reverse direction for 10 sec and stop for another 10
sec alternately until stop push button is pressed and verify the program using PLC
trainer kit.
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.0 START Push botton
DI.1 Manual STOP Push botton
DO.0 FORWARD Contactor Coil
DO.1 REVERSE Contactor Coil
For reversing a motor rotation direction we have to change the phase sequence of the
connection by interchanging any two phases. This alteration of connection is achieved by
using two contactors. In one contactor named FORWARD CONTACTOR the motor is
connected in RYB phase sequence and in another contactor named REVERSE
CONTACTOR the motor is connected in RBY sequence.
RUNG 1 - When START pushbutton DI.0 is pressed it switches ON the local output
MAIN which holds in ON state for the rest of the time. MAIN turns ON all
the connections in other rungs.
RUNG 2 - When MAIN turns ON it turns ON the FORWARD output switch DO.0 and
the FORWARD CONTACTOR turns ON running the motor in forward
direction.
RUNG 3 - When MAIN turns ON the FWD STOP local output is tuned ON after a 10 sec
delay due to TON Timer T1. When FWD STOP turns ON the FORWARD
output in Rung 2 is turned OFF due to the opening of NC switch in the name
of FWD STOP. Thus FORWARD CONTACTOR turns OFF and the motor
stops running.
RUNG 4 - When MAIN turns ON it turns ON the REVERSE output switch DO.1 after a
20 sec delay due to TON Timer T2, and the REVERSE CONTACTOR turns
ON running the motor in reverse direction.
RUNG 5 - When MAIN turns ON the REV STOP local output is tuned ON after a 30 sec
delay due to TON Timer T3. When REV STOP turns ON the REVERSE
output in Rung 4 is turned OFF due to the opening of NC switch in the name
of REV STOP. Thus REVERSE CONTACTOR turns OFF and the motor
stops running.
RUNG 6 - When REV STOP is turned ON a local output RESTART is turned on after a
40 sec delay due to TON Timer T4. Thus the FWD STOP and REV STOP
outputs are turned OFF due to the NC contact in the name of RESTART in
Rung 3 and Rung 5. When FWD STOP is turned OFF the FORWARD
output in Rung 2 is turned ON again, thus repeating the cycle.
LADDER PROGRAM
CONNECTION DIAGRAM
PROCEDURE
RESULT
Prepared a ladder program for running a three phase motor in forward direction for 10 sec
then stop for 10 sec and then in reverse direction for 10 sec and stop for another 10 sec
alternately until stop push button is pressed and verified the program using PLC trainer kit
by running the motor.
Experiment No: 19
Date :
LIFT CONTROL
AIM: To prepare a ladder program for controlling the miniature working model of a Lift and
verify the program using PLC trainer kit.
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.0 START PB
DI.1 STOP PB
DI.2 Ground floor PB
DI.3 First floor PB
DI.4 Second floor PB
DI.5 Ground floor sensor
DI.6 First floor sensor
DI.7 Second floor sensor
DO.0 Motor Down
DO.1 Motor Up
In Lift control model there are three levels, Ground floor, First floor and Second floor.
Each floor has their corresponding push buttons sensors. The push button when pressed
sends signal to the PLC for bringing the lift to the corresponding floor and the sensor
sends the signal to PLC giving information about where the lift is. Lift model has two
motor running controls, UP and DOWN. When the PLC sends signal to UP terminal the
motor runs in a direction to move the lift upwards and when the PLC sends signal to
DOWN terminal the motor runs in opposite direction to move the lift downwards.
RUNG 1 - The control module is started by START push button (DI.0). A latching branch
is provided to hold on the start condition and an NC contact for STOP push
button is also given. START LATCH NO contact is given in all other rungs to
control them.
RUNG 2 - When GROUND FLOOR PUSH BUTTON is pressed a local output
GROUND PB LATCH is turned ON to hold on the GROUND FLOOR PUSH
BUTTON. The latch is turned OFF when GROUND FLOOR SENSOR is
turned ON.
RUNG 3 - When FIRST FLOOR PUSH BUTTON is pressed a local output FIRST PB
LATCH is turned ON to hold on the FIRST FLOOR PUSH BUTTON. The
latch is turned OFF when FIRST FLOOR SENSOR is turned ON.
RUNG 4 - When SECOND FLOOR PUSH BUTTON is pressed a local output SECOND
PB LATCH is turned ON to hold on the SECOND FLOOR PUSH BUTTON.
The latch is turned OFF when SECOND FLOOR SENSOR is turned ON.
RUNG 5 - When GROUND PB LATCH is turned ON it turns ON a local output TO
GROUND if either FIRST FLOOR SENSOR or SECOND FLOOR SENSOR
is ON. A branch for holding on the TO GROUND output is also given. This
rung is intended to turn ON the Down rotation of motor if lift is at first or
second floor and stop at ground floor.
RUNG 6 - When FIRST PB LATCH is turned ON it turns ON a local output DOWN TO
FIRST if SECOND FLOOR SENSOR is ON. A branch for holding on the
DOWN TO FIRST output is also given. This rung is intended to turn ON the
Down rotation of motor if lift is at second floor and stop at first floor.
RUNG 7 - An output is given for the Down rotation of the motor by activation of output
DO.0 MOTOR DOWN if either DOWN TO FIRST or TO GROUND outputs
are ON. This brings the lift to First floor if it is in Second floor or to Ground
floor if it is in First or second floor.
RUNG 8 - When SECOND PB LATCH is turned ON it turns ON a local output TO
SECOND if either GROUND FLOOR SENSOR or FIRST FLOOR SENSOR
is ON. A branch for holding on the TO SECOND output is also given. This
rung is intended to turn ON the Up rotation of motor if lift is at ground or first
floor and stop at second floor.
RUNG 9 - When FIRST PB LATCH is turned ON it turns ON a local output UP TO
FIRST if GROUND FLOOR SENSOR is ON. A branch for holding on the UP
TO FIRST output is also given. This rung is intended to turn ON the Up
rotation of motor if lift is at ground floor and stop at first floor.
RUNG 10 - An output is given for the Up rotation of the motor by activation of output
DO.1 MOTOR UP if either UP TO FIRST or TO SECOND outputs are ON.
This brings the lift to First floor if it is in Ground floor or to Second floor if it
is in First or Ground floor.
CONNECTION DIAGRAM
LADDER PROGRAM
PROCEDURE
RESULT
Prepared a ladder program for controlling the miniature working model of a Lift and
verified the program using PLC trainer kit.
Experiment No: 20
Date :
AIM: To prepare a ladder program for the operation of water level controller to automatically
fill the tank if it is empty and drain the water if the tank is full and verify the program
using PLC trainer kit.
EQUIPMENTS REQUIRED
THEORY
INPUTS/OUTPUT DENOTATIONS
Input/output Use
DI.0 HIGH LEVEL SENSOR
DI.1 LOW LEVEL SENSOR
DO.0 PUMP
DO.1 DRAIN VALVE
In the water level controller training board there is a water tank with two sensors, high
level and low level. It also have a mini pump working at 12 V DC and a solenoid drain
valve working at 230 V AC.
RUNG 1 The output DO.0 for the PUMP is turned ON if both LOW LEVEL SENSOR
and HIGH LEVEL SENSOR are OFF. Once the pump starts, the tank is filled
and the LOW LEVEL SENSOR will turn OFF while the tank is filling. Then a
parallel branch of NO contact will prevent the PUMP from turning OFF.
RUNG 2 Once the tank is filled both HIGH LEVEL SENSOR and LOW LEVEL
SENSOR are in ON condition. Then the output DO.1 for the DRAIN VALVE
turns ON and the water is drained from the tank. Then the HIGH LEVEL
SENSOR turns OFF, but the DRAIN VALVE will be still ON due to the
parallel branch of NO contact across HIGH LEVEL SENSOR.
CONNECTION DIAGRAM
LADDER PROGRAM
PROCEDURE
RESULT
Prepared a ladder program for the operation of water level controller to automatically fill
the tank if it is empty and drain the water if the tank is full and verified the program using
PLC trainer kit.
APPENDIX
Hex Code Bytes Mnemonic Operands Hex Code Bytes Mnemonic Operands
68 1 XRL A, R0 9B 1 SUBB A, R3
69 1 XRL A, R1 9C 1 SUBB A, R4
6A 1 XRL A, R2 9D 1 SUBB A, R5
6B 1 XRL A, R3 9E 1 SUBB A, R6
6C 1 XRL A, R4 9F 1 SUBB A, R7
6D 1 XRL A, R5 A0 2 ORL C, /bit
6E 1 XRL A, R6 A1 2 AJMP addr11
6F 1 XRL A, R7 A2 2 MOV C, bit
70 2 JNZ offset A3 1 INC DPTR
71 2 ACALL addr11 A4 1 MUL AB
72 2 ORL C, bit A5 reserved
73 1 JMP @A+DPTR A6 2 MOV @R0, direct
74 2 MOV A, #immed A7 2 MOV @R1, direct
75 3 MOV direct, #immed A8 2 MOV R0, direct
76 2 MOV @R0, #immed A9 2 MOV R1, direct
77 2 MOV @R1, #immed AA 2 MOV R2, direct
78 2 MOV R0, #immed AB 2 MOV R3, direct
79 2 MOV R1, #immed AC 2 MOV R4, direct
7A 2 MOV R2, #immed AD 2 MOV R5, direct
7B 2 MOV R3, #immed AE 2 MOV R6, direct
7C 2 MOV R4, #immed AF 2 MOV R7, direct
7D 2 MOV R5, #immed B0 2 ANL C, /bit
7E 2 MOV R6, #immed B1 2 ACALL addr11
7F 2 MOV R7, #immed B2 2 CPL bit
80 2 SJMP offset B3 1 CPL C
81 2 AJMP addr11 B4 3 CJNE A, #immed, offset
82 2 ANL C, bit B5 3 CJNE A, direct, offset
@R0, #immed,
83 1 MOVC A, @A+PC B6 3 CJNE
offset
@R1, #immed,
84 1 DIV AB B7 3 CJNE
offset
85 3 MOV direct, direct B8 3 CJNE R0, #immed, offset
86 2 MOV direct, @R0 B9 3 CJNE R1, #immed, offset
87 2 MOV direct, @R1 BA 3 CJNE R2, #immed, offset
88 2 MOV direct, R0 BB 3 CJNE R3, #immed, offset
89 2 MOV direct, R1 BC 3 CJNE R4, #immed, offset
8A 2 MOV direct, R2 BD 3 CJNE R5, #immed, offset
8B 2 MOV direct, R3 BE 3 CJNE R6, #immed, offset
8C 2 MOV direct, R4 BF 3 CJNE R7, #immed, offset
8D 2 MOV direct, R5 C0 2 PUSH direct
8E 2 MOV direct, R6 C1 2 AJMP addr11
8F 2 MOV direct, R7 C2 2 CLR bit
90 3 MOV DPTR, #immed C3 1 CLR C
91 2 ACALL addr11 C4 1 SWAP A
92 2 MOV bit, C C5 2 XCH A, direct
93 1 MOVC A, @A+DPTR C6 1 XCH A, @R0
94 2 SUBB A, #immed C7 1 XCH A, @R1
95 2 SUBB A, direct C8 1 XCH A, R0
96 1 SUBB A, @R0 C9 1 XCH A, R1
97 1 SUBB A, @R1 CA 1 XCH A, R2
98 1 SUBB A, R0 CB 1 XCH A, R3
99 1 SUBB A, R1 CC 1 XCH A, R4
9A 1 SUBB A, R2 CD 1 XCH A, R5
Hex Code Bytes Mnemonic Operands Hex Code Bytes Mnemonic Operands
CE 1 XCH A, R6 E7 1 MOV A, @R1
CF 1 XCH A, R7 E8 1 MOV A, R0
D0 2 POP direct E9 1 MOV A, R1
D1 2 ACALL addr11 EA 1 MOV A, R2
D2 2 SETB bit EB 1 MOV A, R3
D3 1 SETB C EC 1 MOV A, R4
D4 1 DA A ED 1 MOV A, R5
D5 3 DJNZ direct, offset EE 1 MOV A, R6
D6 1 XCHD A, @R0 EF 1 MOV A, R7
D7 1 XCHD A, @R1 F0 1 MOVX @DPTR, A
D8 2 DJNZ R0, offset F1 2 ACALL addr11
D9 2 DJNZ R1, offset F2 1 MOVX @R0, A
DA 2 DJNZ R2, offset F3 1 MOVX @R1, A
DB 2 DJNZ R3, offset F4 1 CPL A
DC 2 DJNZ R4, offset F5 2 MOV direct, A
DD 2 DJNZ R5, offset F6 1 MOV @R0, A
DE 2 DJNZ R6, offset F7 1 MOV @R1, A
DF 2 DJNZ R7, offset F8 1 MOV R0, A
E0 1 MOVX A, @DPTR F9 1 MOV R1, A
E1 2 AJMP addr11 FA 1 MOV R2, A
E2 1 MOVX A, @R0 FB 1 MOV R3, A
E3 1 MOVX A, @R1 FC 1 MOV R4, A
E4 1 CLR A FD 1 MOV R5, A
E5 2 MOV A, direct FE 1 MOV R6, A
E6 1 MOV A, @R0 FF 1 MOV R7, A