Section 07 · Practice Questions

Alarm & Safety Systems

Four exam-style problems on safety-critical PLC logic — a four-input factory alarm that escalates by the number of active dangers, a home burglar alarm with a foil-loop window sensor, vessel overfill detection that’s tolerant to a small leak, and a car door / seat-belt safety interlock with timed cabin-lamp behaviour.

4Questions
4Worked Solutions
All practice sections

Alarm logic is mostly about states and thresholds — build truth tables for the conditions, then turn each row into a rung with the appropriate seal-in or timer.

Q1

A four-input factory alarm that escalates

A factory alarm system has four danger inputs. When only a single input is active, nothing happens. When any two inputs are active, the Red Pilot Light is activated. Any three active inputs trigger the SIREN. When all four are active together, the Fire-Department alarm is triggered. Treat every input as a Normally Open contact.

ShowHide worked solution

The simplest approach is to count how many inputs are active and act on that single number. A small ADD chain pushes the count into N7:0; then three equality comparators light the three outputs.

Ladder program
Rung 1: |---[ ALWAYS ]----(MOV 0, N7:0)----|     reset count each scan
Rung 2: |---[ I1 ]----(ADD N7:0, 1, N7:0)----|
Rung 3: |---[ I2 ]----(ADD N7:0, 1, N7:0)----|
Rung 4: |---[ I3 ]----(ADD N7:0, 1, N7:0)----|
Rung 5: |---[ I4 ]----(ADD N7:0, 1, N7:0)----|

Rung 6: |---[ N7:0 = 2 ]----(RED_LAMP)----|
Rung 7: |---[ N7:0 = 3 ]----(SIREN)----|
Rung 8: |---[ N7:0 = 4 ]----(FIRE_DEPT)----|

Count register N7:0 carries the number of active inputs; equality comparators drive each escalation level.

A pure-Boolean version would enumerate every C(4,2) pair for the red lamp and every C(4,3) triple for the siren — same behaviour, far more rungs.

Final AnswerUse a count register (sum of the four inputs); compare-equal to 2, 3, 4 drives RED_LAMP, SIREN, FIRE_DEPT respectively. Clean and easily scaled to more inputs.
Q2

A home burglar alarm with a foil-loop window sensor

Design the truth table, minimised equation, simplified circuit and ladder program for a home burglar alarm. When activated, the alarm and lights operate so as to encourage the intruder to leave. The alarm is triggered by either a window sensor W or a motion detector M. W is a thin foil loop around the window — current flows through it normally, so its output is normally true; when the glass breaks the current stops and the output goes false. M’s output goes ON when it detects a person. A master switch S arms and disarms the system.

ShowHide worked solution

Logical model

A broken window means W flips from 1 to 0, so the window-event is W′. Motion detection is M = 1. The alarm fires when the system is armed (S = 1) AND either condition is true.

S must be high (armed) and at least one of (W broken, motion) must hold.
SWMA
0××0
1100
1111
1001
1011
A = S · (W′ + M) = S·W′ + S·M
Ladder program
|---[ S ]---+----[/W]----+---------( A )---|
|           |            |
|           +----[ M ]---+

One rung — S in series with the parallel of NC-W and NO-M.

Final AnswerA = S · (W′ + M). A single rung — S in series with the parallel of an NC contact of W and an NO contact of M.
Q3

Vessel overfill detection with a 5-pound leak tolerance

Write a PLC program for an overfill condition in a vessel. The alarm must sound when the supply system leaks 5 lb or more of raw material into the vessel after the preset weight of 500 lb has been reached. Pressing Start energises the fill solenoid and the filling indicator lamp; when the weight reaches 500 lb, the fill solenoid is de-energised, the filling lamp goes out and the Full lamp lights. If the solenoid leaks 5 lb or more after that, the alarm is energised — and stays so until the overflow level falls back below the 5-lb limit.

ShowHide worked solution

The whole rung-set is just three weight thresholds: under 500 lb the fill runs and seals; at 500 lb the fill drops and the Full lamp comes on; if the weight ever climbs to 505 lb or more, the alarm energises (and it tracks the weight directly, so it clears automatically when the level falls back below 505).

Ladder program
Rung 1 — start filling, seal-in until weight reaches 500 lb:
|---[ START ]---[/STOP]---[N7:0 < 500]----+----( FILL_SOL )---|
|                                         |
|---[ FILL_SOL ]---[N7:0 < 500]-----------+

Rung 2 — filling indicator follows the solenoid:
|---[ FILL_SOL ]------------( FILLING_LAMP )----|

Rung 3 — full indicator at the preset weight:
|---[ N7:0 ≥ 500 ]------------( FULL_LAMP )----|

Rung 4 — overfill alarm above the 5-lb tolerance:
|---[ N7:0 ≥ 505 ]-----------( ALARM )----|

Rung 5 — alarm clears when the level drops back:
|---[ N7:0 < 505 ]-----------(/ALARM)----|

The two-sided comparison (≥ 505 to set, < 505 to clear) gives a clean hysteresis-free track of the live weight — no latching needed, no flutter once the leak is dealt with.

Final AnswerTwo compare thresholds (≥ 500 ends the fill; ≥ 505 lights the alarm). FILL_SOL latches and is broken at 500 lb. The alarm auto-clears when the weight falls below 505 lb.
Q4

Car door and seat-belt safety with a timed cabin lamp

Develop ladder logic for a car door / seat-belt safety arrangement. When the car door is open, or the seat belt is not fastened, a buzzer sounds for 5 seconds provided the ignition key is on. A cabin lamp is switched on when the door is opened and remains ON for 10 seconds after the door is closed — unless the ignition has been started with the key, in which case the lamp goes out immediately.

ShowHide worked solution

Two independent timers do the work. The buzzer condition BUZZ_REQ = IGN · (DOOR + ¬BELT) kicks off a 5-second TON; the buzzer is on while the timer is running. For the cabin lamp, an off-delay-style TON tracks the door — it keeps the lamp on for 10 seconds after the door closes — and an IGN override forces the lamp off the moment the engine starts.

Ladder program
Rung 1 — buzzer request: ignition on AND (door open OR belt unfastened):
|---[ IGN ]---[ DOOR  ]---+---( BUZZ_REQ )--|
|---[ IGN ]---[/BELT  ]---+

Rung 2 — 5-second timer on the buzzer:
|---[ BUZZ_REQ ]----(TON T1, PRE = 5 s)----|

Rung 3 — buzzer on while T1 is running (its first 5 seconds):
|---[ BUZZ_REQ ]---[/T1.DN]----( BUZZER )----|

Rung 4 — cabin lamp: ON while door open, plus the timing tail
|---[ DOOR ]----+----( LAMP )----|
                |
|---[ T2.TT ]---+

Rung 5 — 10-s off-delay timer triggered by door closing:
|---[/DOOR ]----(TON T2, PRE = 10 s)----|

Rung 6 — ignition starting forces the cabin lamp off immediately:
|---[ IGN ]----(/LAMP)----|
Final AnswerBUZZER = (DOOR + ¬BELT)·IGN, gated by a 5-second TON. LAMP = DOOR OR (T2.TT after door close), forced OFF by IGN.