WBCHSE HS Vocational Electronics study materials
WBCHSE HS Vocational Electronics study resources

TTL Alarm Logic with Floating Sensor Inputs

WBCHSE HS Vocational Electronics · Put your knowledge to work in context.

All case studies

TTL Alarm Logic with Floating Sensor Inputs

A trainee wires a workshop intruder alarm using a 74LS32 quad 2-input OR gate and a 74LS08 quad 2-input AND gate. The sensors are door switch D, window switch W and PIR sensor M. Each is a normally-open switch that connects the gate input to +5 V when active. The enable switch E is a toggle that should connect to +5 V when armed and to 0 V when disarmed. The required logic is A = E·(D + W + M). No pull-down resistors are fitted; the trainee assumes an open switch gives logic 0. On test, with all sensors open and E set to the 0 V position, the alarm output A is 1. A DMM on an open sensor input reads 1.9 V, and the OR gate output reads 4.6 V. The 74LS data sheet gives IIL(max) = -0.4 mA, VIL(max) = 0.8 V and VIH(min) = 2.0 V. A box of 10 kΩ resistors is available.

1. Explain the 1.9 V reading and why the alarm is on even with E at 0 V. What logic level does the floating input represent?

Read the worked answer

A 74LS input left open is not at 0 V. The input structure can source a small current, and with no pull-down the input floats to a voltage around 1.4-1.9 V, which is in the indeterminate region but is usually interpreted as high by the following gate. The DMM reading of 1.9 V is above VIL(max) = 0.8 V and close to VIH(min) = 2.0 V, so the gate can see it as high or become noise-sensitive. With all sensors open, the OR gate still receives high levels and its output goes to 4.6 V. The E switch is also wired only to +5 V, so the '0 V' position is open and also floats high. The AND gate therefore sees E = 1 and OR = 1, giving A = 1. The fault is missing pull-downs and an incomplete E switch, not a faulty gate.

2. Design input conditioning using the available 10 kΩ resistors. Show whether 10 kΩ is suitable for 74LS, and calculate a better value if necessary.

Read the worked answer

Each switch should connect the input to +5 V when active and to 0 V through a pull-down when inactive. For 74LS, the input low current IIL(max) = -0.4 mA means the input can source up to 0.4 mA when held low. The pull-down must keep the input below VIL(max) = 0.8 V while sinking that current: Rmax = 0.8 V/0.4 mA = 2 kΩ. A 10 kΩ resistor is too large: 0.4 mA × 10 kΩ = 4 V, so the input would sit high, not low. Use 1 kΩ or 470 Ω. With 1 kΩ, the low voltage is about 0.4 V; with 470 Ω, about 0.19 V. Fit one pull-down on each sensor input and on E, and use a changeover switch for E so the 'disarmed' position is a hard 0 V. Add a 0.1 µF decoupling capacitor near the gates.

3. The trainee fits 1 kΩ pull-downs but leaves unused inputs of the 74LS32 and 74LS08 floating. Why can that still be a problem, and how should unused inputs be treated?

Read the worked answer

Unused TTL inputs are high-impedance and can float high, pick up noise, and cause the gate output to switch unpredictably. They also increase supply current and can make the circuit sensitive to hand proximity. Tie every unused input to a defined level: for an OR gate, unused inputs should go to 0 V (GND); for an AND gate, unused inputs should go to +5 V through a 1 kΩ resistor or directly to Vcc. Alternatively, tie an unused input to a used input if that does not change the logic. Do not leave them open. After rewiring, test the full truth table: E = 0 should force A = 0; E = 1 with all sensors open should give A = 0; each sensor should give A = 1 only when E = 1. Check the OR gate output and the final AND output with a DMM or logic probe.