OR Gate Alarm System
Multi-sensor alarm using OR gates. Any sensor activation triggers the alarm. Learn how OR gates enable multiple trigger sources.
学べること
- Recognise OR as the gate of choice for "any of these" trigger logic.
- Read the 3-input OR truth table — only the all-zeros row produces 0.
- Compare OR-based and AND-based security systems and pick the right one for the use case.
- See OR gates aggregating multiple sensor or alarm signals in real systems.
- Understand why adding another sensor to an OR-based alarm is just one more input.
仕組み
Real alarm systems work on a simple rule: if any sensor detects something, sound the alarm. This circuit wires three sensor switches — Window, Motion, Glass-break — into an OR gate that drives an alarm output. The output is high whenever at least one sensor is active.
With three inputs, OR has 2³ = 8 possible input combinations. Of these, exactly one (all zeros) keeps the alarm silent; the other seven trigger it. This is the inverse pattern from AND, which fires only on the all-ones row.
The educational insight: OR encodes the security policy "trigger if any of these conditions are met," while AND encodes "trigger only when all conditions are met." The same three sensor switches feeding an AND gate would mean "alarm only when all three sensors agree something is wrong" — useful in some applications (false-alarm reduction by requiring corroboration) but the wrong choice for an intrusion alarm where missing one sensor due to a single trigger event would be catastrophic.
Notice that OR is commutative and associative — sensor order doesn't matter, and a 3-input OR is equivalent to chaining two 2-input ORs.
真理値表
Three sensors feeding an OR gate: 8 combinations, 7 of which trigger the alarm. Only the all-quiet state (0,0,0) keeps the alarm silent.
| 入力 | 出力 | |||
|---|---|---|---|---|
| Window | Motion | Glass | Alarm | |
| 0 | 0 | 0 | 0 | All quiet — alarm silent |
| 0 | 0 | 1 | 1 | Glass-break alone fires alarm |
| 0 | 1 | 0 | 1 | |
| 0 | 1 | 1 | 1 | |
| 1 | 0 | 0 | 1 | |
| 1 | 0 | 1 | 1 | |
| 1 | 1 | 0 | 1 | |
| 1 | 1 | 1 | 1 | All sensors firing — alarm active |
ブール式
OR with three inputs — output is 1 if any of A, B, C is 1.
Same expression in formal-logic notation.
De Morgan equivalent — OR of the inputs equals NOT of the AND of inverted inputs.
順を追って試す
上の埋め込み回路で入力を設定し、期待される結果と一致するか確認しましょう。
- 1Window = 0 Motion = 0 Glass = 0期待値:
Alarm = 0観察ポイント: All sensors quiet — alarm light is dark. This is the only combination that keeps the alarm silent. - 2Window = 1 Motion = 0 Glass = 0期待値:
Alarm = 1観察ポイント: Single sensor activates and the alarm fires immediately. OR doesn't wait for corroboration. - 3Window = 0 Motion = 1 Glass = 1期待値:
Alarm = 1観察ポイント: Two sensors both active — alarm stays on. Once on, additional sensors don't change the output. - 4Window = 1 Motion = 1 Glass = 1期待値:
Alarm = 1観察ポイント: All three sensors active. OR continues to output 1 — there's no "more high" than 1.
使用コンポーネント
実世界での応用
Home security systems. Window switches, motion detectors, glass-break sensors, and door contacts all OR together to drive a single alarm output. Add another sensor: just OR it in.
Industrial e-stop chains. Emergency-stop buttons throughout a factory feed an OR gate that cuts machine power. Any single button press shuts down the line — exactly what's needed for safety.
Smoke and fire detection. Multiple smoke detectors in a building OR together to trigger sprinklers and the central alarm. One detector is enough to activate the response.
CPU interrupt aggregation. Every peripheral that can request CPU attention — keyboard, network card, disk, timer — drives an interrupt line. Those lines OR together to a single CPU input. The CPU then reads a separate "who interrupted" register to identify the source.
Multi-fault detection. Power-supply over-voltage, over-current, and over-temperature signals OR together to drive a single "fault" line that shuts the supply down.