Premium Membership ♕

Save 50% on all EEP Academy courses with Enterprise Membership Plan and study specialized LV/MV/HV technical articles & guides.

Home / Technical Articles / Let’s develop the simple PLC program for lighting control system

Lighting control system

A lighting control system is to be developed. The system will be controlled by four switches, SWITCH1, SWITCH2, SWITCH3, and SWITCH4. These switches will control the lighting in a room based on the following criteria:

Let's develop the simple PLC program for lighting control system
Let's develop the simple PLC program for lighting control system (photo credit:
  1. Any of three of the switches SWITCH1, SWITCH2, and SWITCH3, if turned ON can turn the lighting on, but all three switches must be OFF before the lighting will turn OFF.
  2. The fourth switch SWITCH4 is a Master Control Switch. If this switch is in the ON position, the lights will be OFF and none of the other three switches have any control.

To do: Let’s design the wiring diagram for the controller connections, assign the inputs and outputs and develop the ladder diagram which will accomplish the task.

The wiring diagram //

The first item we may accomplish is the drawing of the controller wiring diagram. All we need do is connect all switches to inputs and the lighting to an output and note the numbers of the inputs and output associated with these connections.

The remainder of the task becomes developing the ladder diagram. The wiring diagram is shown in Figure 1.

PLC Wiring Diagram for Example Problem
Figure 1 – PLC Wiring Diagram for Example Problem

Notice that all four switches are shown as normally open selector switches and the output is connected to a relay coil CR1. We are using the relay CR1 to operate the lights because generally the current required to operate a bank of room lights is higher than the maximum current a PLC output can carry.

Attempting to operate the room lights directly from the PLC output will most likely damage the PLC.

For this wiring configuration, the following definition list is apparent:

  • INPUT IN4 = SWITCH4 (Master Control Switch)
  • OUTPUT OUT1 = Lights control relay coil CR1

This program requires that when SWITCH4 is ON, the lights must be OFF. In order to do this, it would appear that we need a N/C SWITCH4, not a N/O as we have in our wiring diagram. However, keep in mind that once an input signal is brought into a PLC, we may use as many contacts of the input as we need in our program, and the contacts may be either N/O or N/C.

Therefore, we may use a N/O switch for SWITCH4 and then in the program, we will logically invert it by using N/C IN4 contacts.

The ladder diagram to implement this example problem is shown in Figure 2.

Example, Lighting Control Program
Figure 2 – Example, Lighting Control Program

The ladder was printed using graphics characters (extended ASCII characters).

Notice the normally closed contact for IN4. A normally closed contact represents an inversion of the assigned element, in this case IN4, which is defined as SWITCH 4. Remember, SWITCH 4 has to be in the OFF position before any of the other switches can take control. In the OFF position, SWITCH 4 is open.

This means that IN4 will be OFF (de-energized). So, in order for an element assigned to IN4 to be closed with the switch in the OFF position, it must be shown as a normally closed contact. When SWITCH 4 is turned ON, the input, IN4, will become active (energized). If IN4 is ON, a normally closed IN4 contact will open.

With this contact open in the ladder diagram, none of the other switches will be able to control the output.

REMEMBER: A normally closed switch will open when energized and will close when de-energized.

PLC program to control a lighting device

How to create a PLC program to control a lighting device through a button or a SCADA system using the PLC-PROG IDE.

Reference // Programmable Logic Controllers

Premium Membership

Get access to premium HV/MV/LV technical articles, electrical engineering guides, research studies and much more! It helps you to shape up your technical skills in your everyday life as an electrical engineer.
More Information

Edvard Csanyi

Electrical engineer, programmer and founder of EEP. Highly specialized for design of LV/MV switchgears and LV high power busbar trunking (<6300A) in power substations, commercial buildings and industry facilities. Professional in AutoCAD programming.


  1. Carlos Restrepo
    Jul 20, 2017


    Why the changeto print PDF to access to documents?


    Carlos Restrepo

  2. Sadat ahmed
    Jan 19, 2017

    awsome work , information is good , beneficial for updating and brushing up concept,
    Hope to see more in future

  3. Ty
    Oct 11, 2015

    Hi Edvard, I’m still a little puzzled! Could it be that “S1, S2 & S3” is a 3 way switch controlled by S4 when turned on activates a n/o relay contact that provides a path for the lights?

  4. Masitembe
    Sep 08, 2015

    I want to learn plc’s and your website looks fascinating

  5. Lucas
    Aug 27, 2015

    Great job

  6. David
    Aug 24, 2015

    I would like to express my appreciation for all the information you keep sharing to the Engineering (Electrical) Society. Really appreciate that!!!

  7. Takas
    Jul 27, 2015

    The information yu giving is very vital all those in the Electrical Engineering field. Thanks guys

  8. Anonymous
    Jul 16, 2015

    Great ideas I’m gaining.

  9. manasa moharana
    Jul 13, 2015

    Actually, this portal is amazing. Here we are gaining knowledge. This idea is truly great. Thank for it and thanks for its founder.

  10. Mengistu
    Jul 07, 2015

    it is great what a blessed and kind persons you are. i always follow your essential posts as a lesson. i got all the time what my mind ask me. pls keep on doing this. Thanks very much

  11. James Murau Kiburi
    Jul 06, 2015

    That’s greatat. Thanks alot for that innovative ide.

Leave a Comment

Tell us what you're thinking. We care about your opinion! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a professional and meaningful conversation instead. Thanks for dropping by!

ninety two  −    =  eighty three

Learn How to Design Power Systems

Learn to design LV/MV/HV power systems through professional video courses. Lifetime access. Enjoy learning!

Subscribe to Weekly Newsletter

Subscribe to our Weekly Digest newsletter and receive free updates on new technical articles, video courses and guides (PDF).
EEP Academy Courses - A hand crafted cutting-edge electrical engineering knowledge