Home » PLC Program for Two Way Switch Logic
Guest Articles PLC Tutorials

PLC Program for Two Way Switch Logic

This is PLC Program for Two ways switch logic for staircase light in house

PLC Two Way Switch Logic

  • In duplex type house there are ground floor and first floor and sometimes second floor also.
  • Sometimes people need to go from ground floor to first floor or from first floor to ground floor by staircase provided in house.
  • But in staircase there is no sunlight so people need a lamp/light to see the steps of the staircase easily.
  • Here we are using a simple PLC to control this lamp using two switches, one switch at ground floor and second switch at first floor to control one lamp as shown in below figure.
  • Note : we can also build the circuit using simple relays/switches also. This article only for understanding the basic concept of 2 way switch using  a PLC Ladder Logic.

Problem Diagram

PLC Program for Two ways switch logic for staircase light

Problem Solution

  • We will solve this problem by simple automation. As shown in figure consider one simple house with one floor and staircase is provided in the house.
  • Here we will set lighting system for the users to switch ON/OFF the light whether they are on bottom of the stair or at top.
  • We will provide separate switch for each floor as shown in above figure.

List of inputs/outputs

Digital Inputs

  • SW1 : I0.1
  • SW2 : I0.2

Digital Outputs

  • Lamp : Q0.0

PLC Ladder diagram for two ways switch logic

PLC Ladder Logic for Two Way Switch

Program Description

  • For this application, we used S7-1200 PLC and TIA portal software for programming.
  • In above program, we have added two NO contacts of SW 1 (I0.1) and SW 2 (I0.2) in series and NC contacts of SW1 (I0.1) and SW2 (I0.2) in parallel of this series SW1 & SW2 NO Contacts.
  • If the status of the bottom switch (SW1) and status of the top switch (SW2) are same then lamp will be ON. And if either status of the bottom or top switch is different from other then lamp (Q0.0) will be OFF.
  • When lamp (Q0.0) is OFF then user can ON the lamp by changing status of any switch. Also user can turn OFF the lamp by changing the status of one of the two switches.

Runtime Test Cases

PLC Two Way Switch Logic

Note : The above PLC Logic provided for basic idea about application of PLC for Two Way Switch Logic. The Logic is limited and not complete application.

Author : Bhavesh

Articles You May Like :

PLC Ladder Logic : Contacts and coils

Sequence of Conveyors with Interlock

Two out of Three Logic Analogy

Float-type Level Switch to Control a pump

Programmable Logic Controllers MCQ

Share With Your Friends

Related Articles

Components of PLC

S Bharadwaj Reddy

Start the Counting from a Preset Value in PLC

S Bharadwaj Reddy

Why is RTO used in the Place of TON Timer?

S Bharadwaj Reddy

What is SCADA ? How does SCADA Works ?

S Bharadwaj Reddy

Problem on PLC, HMI, VFD, and Motor Circuit

S Bharadwaj Reddy

Reversing Control Valve Actuator Fail Safe Mode

S Bharadwaj Reddy


Alisahib March 18, 2019 at 2:35 pm

I think this LD is wrong.There must be SW1 (NO) to SW2(NC) (1st rung)
SW2(NO) to SW1(NC)(2 nd rung)

Aradhana Toppo November 28, 2019 at 12:36 pm



Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

PLC Program for Two Way Switch Logic

WordPress Image Lightbox
Send this to a friend