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.