PLC

PLC Ladder logic example for beginners: Four-Way traffic light control using Siemens PLC

PLC Ladder logic example for beginners: Four-Way traffic light control using Siemens PLC

Let’s discuss the four-way traffic light control and solution based on PLC controller using ladder logic program. For this purpose, we have used Siemens PLC software TIA PORTAL V15 for developing the ladder logic program. This is one of the common examples for PLC programming beginners.

FOUR-WAY TRAFFIC LIGHT CONTROL DIAGRAM

Four way traffic light control diagram
Four-way traffic light control diagram

CONTROL SOLUTION:

There are so many ways to develop a program for traffic light control using a ladder logic program. But here normal inputs, outputs and timers are used with time delay to switch on and switch off the desired outputs at desired sequence as shown in the table below.

This system is designed to control the traffic light automatically and to switch on and switch off according to the sequence of operation to control the traffic congestion.

SIEMENS TIA PORTAL V15 is used for developing this control philosophy.

LIST OF INPUTS AND OUTPUTS FOR FOUR-WAY TRAFFIC LIGHT CONTROL

For the four-way traffic light control system, we are using 12 outputs, 2 inputs, one memory and On-Delay timers as shown in the table below

S. NoNameData TypeLogical AddressType
1STARTBoolean%I0.0INPUT
2MEMORYBoolean%M0.0MEMORY
3STOPBoolean%I0.1INPUT
4EAST GREENBoolean%Q0.0OUTPUT
5NORTH REDBoolean%Q0.1OUTPUT
6WEST REDBoolean%Q0.2OUTPUT
7SOUTH REDBoolean%Q0.3OUTPUT
8EAST YELLOWBoolean%Q0.4OUTPUT
9NORTH YELLOWBoolean%Q0.5OUTPUT
10NORTH GREENBoolean%Q0.6OUTPUT
11EAST REDBoolean%Q0.7OUTPUT
12WEST YELLOWBoolean%Q1.0OUTPUT
13WEST GREENBoolean%Q1.1OUTPUT
14SOUTH YELLOWBoolean%Q1.2OUTPUT
15SOUTH GREENBoolean%Q1.3OUTPUT
16TIMERBooleanIEC TIMER DB0TIMER
17TIMERBooleanIEC TIMER DB1TIMER
18TIMERBooleanIEC TIMER DB2TIMER
19TIMERBooleanIEC TIMER DB3TIMER
20TIMERBooleanIEC TIMER DB4TIMER
21TIMERBooleanIEC TIMER DB5TIMER
22TIMERBooleanIEC TIMER DB6TIMER
23TIMERBooleanIEC TIMER DB7TIMER

CONTROL PHILOSOPHY ASSUMPTIONS:

This program is designed with the below-mentioned assumptions in mind

  1. At one point in time, only one side of traffic is allowed
  2. Only free left is allowed (Considering Right-hand driving condition)
  3. The traffic light turns yellow before doing any signal switchover
  4. Start/Stop buttons are Pushbuttons (Momentary contact)

SEQUENCE OF OPERATION

It describes the systematic steps to turn on the output of traffic light lamps. The sequence is shown below

S.NOEASTWESTNORTHSOUTHTIMING (Seconds)
1GRRR60
2YRYR10
3RRGR60
4RYYR10
5RGRR60
6RYRY10
7RRRG60
8YRRY10


LOGIC DESCRIPTION                     

In this project On delay, timer plays a major role in this program.

What is on delay timer?

The on-delay timers are mostly used in electric circuits. In the program part, on delay timer is most commonly used in the PLC ladder logic system. The on-delay means delayed switching on the outputs (NO) contact this means that timer does not change to close contact until the preset time is reached. This type of timer is called as ON DELAY timer

In this project, a ladder logic program is used. Here I am going to explain the logic of each rung, in Siemens rungs are represented as networks, so rungs will be explained as networks hereafter.

Also Read: Ladder logic example for beginners – Overhead water tank automatic level control

NETWORK 1

Control Philosophy: To start/stop the sequence

Ladder explanation:

When the start pushbutton (%I0.0) is pressed NO contact gets energized, resulting the memory bit (%M0.0) turning “ON”

Since the memory bit is connected in the rung parallel to the start pushbutton, the memory bit will keep latched until someone push the stop pushbutton (%I0.1).

When the stop pushbutton (%I0.1) is pressed NC contact gets energized, resulting in the memory bit (%M0.0) turning “OFF”, which results in stopping the entire sequence.

NETWORK 2

Control Philosophy: At this step, the East traffic light will be Green and all other lights will be Red

Ladder explanation:

When the memory bit is on and since the timer DB7 done bit is (NC) contact state. The timer DB0 starts to run according to the preset time.  

Since the timer DB0 done bit is (NC) contact state as a result the output East Green (%Q0.0) will be on until it reaches the preset value of the timer DB0.

The same logic is applicable for the output North Red (%Q0.1) & West Red (Q0.2).

For the output North Red rung the timer done bit DB0 (NC) and the timer done bit DB3 (NO) contact is connected parallel.

And for the output West Red, the timer done bit DB2 (NC), and the timer done bit DB5 (NO) is connected parallel.

For the output South red Since the timer is done bit DB4 (NC) contact state, as a result, the output South Red (%Q0.3) will be on until it reaches the preset value of the timer DB4

NETWORK 3

Control Philosophy: At this step, East and North traffic light will be yellow and all other lights will be Red

Ladder explanation:

Since the memory, bit is on and the timer DB0 done bit NO contact is energized resulting in the timer DB1 starting to run according to the preset time

Since the timer DB1 is in NC contact state as a result the output East yellow (%Q0.4) is on until it reached the preset value of the timer DB1. Once it attained the preset value the output will be off. In this rung its connected parallel to the timer DB1 done bit and DB6 done bit. Hence DB6 done bit is in NO contact state

Same for output North yellow since the timer DB1 done bit is in NC contact state as a result the output (%Q0.5) is on until it reaches to the preset value of the timer DB1.In this rung its connected parallel to the timer DB1 done bit and DB2 done bit .Hence DB2 done bit is in NO contact and DB3 done bit NC contact connected in series

NETWORK 4

Control Philosophy: At this step, the North traffic light will be green and all other lights will be Red

Ladder explanation:

 Since the memory bit is on and the timer DB1 done bit NO contact is energized, the timer DB2 seconds starts to run according to the preset time.Once the DB1 NO contact is energized the output East Red (%Q0.6) is on

Since the timer DB2 done bit is in NC contact state resulting output North green (%Q0.7) is on until it reaches to the preset value of timer DB2

NETWORK 5

Control Philosophy: At this step, the West and North traffic light will be yellow and all other lights will be Red.

Ladder explanation:

Since the memory, bit is on and the timer DB2 done bit NO contact is energized the timer DB3 seconds starts to run according to the preset time.

 Since the timer DB3 done bit is in NC contact state resulting the output West Yellow (%Q1.0) is on until it reaches the preset value of the timer DB3.In this rung timer DB5 done bit NC contact and DB4 done bit NO contact  is  connected in series and it both connect parallel to the DB3 done bit

NETWORK 6:

Control Philosophy: At this step, the West traffic light will be green and all other lights will be Red.

Ladder explanation:

Since the memory, bit is on and the timer DB3 done bit NO contact is energized the timer DB4 seconds starts to run according to the preset time.

Since the timer DB4 done bit is in NC contact state as a result the output West green (%Q1.1) is on until it reaches the preset value of the timer DB4.

NETWORK 7:

Control Philosophy: At this step, South Yellow output will be on initially and South Green traffic light will be made on and all other lights will be Red.

Ladder explanation:

Since the memory, bit is on and the timer DB4 done bit NO contact is energized the timer DB5 starts to run according to the preset time.

Since the timer DB5 done bit is in NC contact state resulting from the output South yellow (%Q1.2) is until it reached to the preset value of the timer DB5. In this rung   DB7 done bit NC contact and DB6 done bit NO contact connected in series and its connected parallel to DB5 done bit

Once the timer DB 5 done bit NO contact has energized the output South Green (%Q1.3) is on since the timer DB6 done bit NC contact connected series to DB5 done bit.

NETWORK 8

Control Philosophy: At this step, Timer DB7 is the purpose to run the program in cycle sequence

Ladder explanation:

Since the memory, bit is on and the timer DB5 done bit NO contact is energized the timer DB6 seconds starts to run according to the preset time and once again the timer DB6 done bit NO contact is energized the timer DB7 runs according to the preset time.

The DB 7 done bit NC contact added in the Network 2 to run the program in the cycle formation according to the sequence

In this way, we have discussed four-way automatic traffic light controls using a basic PLC ladder logic program according to the above sequence. We have demonstrated this process by using small time delay the real-time delay settings may vary.

Related Articles

Back to top button