Lite / Discovering How the World Works / Week 16
Gates at work: safety interlocks and sorting rules
A sorting machine has three sensors and four bins. How can a few gates decide where every part goes?
Why should I care?
Real machines combine many conditions: a press must see two hands AND a closed guard; a sorter must check colour, size AND metal. Turning a client's words into exact logic is one of the most important (and most error-prone) jobs in engineering.
- Combine gates to express a rule with more than one condition.
- Turn a written brief into a rule table for a machine.
- Explain why safety interlocks use AND and why 'fail-safe' design matters.
Safety: Interlocks in real machines are designed and certified by qualified engineers. Never bypass a guard or interlock on a real machine.
Predict
A guillotine paper cutter should only cut if the guard is down AND both hand buttons are pressed. How many conditions must be 1 at the same time?
- 1
- 2
- 3
Guess first, then reveal
3: guard down, left button, right button. That's (guard AND left) AND right, two AND gates chained. Needing both hands on buttons keeps them away from the blade.
Discover
In the Sorting Machine Build, Level 2, turn the client's four-line brief into an 8-row rule table. Start with the easy rows: any part with metal (M = 1). Then do the others. Watch the belt run your table.
What the interactive shows (text version)
The Sorting Machine Build's Level 2 shows an 8-row table: every combination of red (R), large (L) and metal (M). For each row you choose a bin. The correct table puts every row with M = 1 in Metal, rows with M = 0 and L = 1 in Reject, R = 1, L = 0, M = 0 in Red plastic, and the all-zero row in Mixed plastic.
Understand
Chaining gates
Gates can feed other gates. (A AND B) AND C is 1 only when all three are 1. (A OR B) AND NOT C means 'A or B, but never when C'. Work from the inside out, like brackets in maths.
From words to logic
A brief like 'metal goes in the metal bin; otherwise large parts are rejected; otherwise red parts go to red plastic; everything else to mixed' becomes rules with three bits: R (red), L (large), M (metal). Order matters: the first rule that matches wins. Words like 'otherwise', 'unless' and 'only if' hide NOT and AND, so read them carefully.
Interlocks and fail-safe
An interlock is an AND that stops a machine unless every safety condition is true: door shut AND guard down AND hands clear. Good designs are also fail-safe: if a wire breaks, the signal drops to 0 and the AND output goes to 0, so the machine stops instead of starting.
Explain it another way
Intuitive
An interlock is like a bank vault that needs two managers turning two keys at once. One key alone does nothing.
Technical
Priority rules ('first match wins') become logic by adding NOT terms: Metal = M; Reject = L AND NOT M; Red = R AND NOT L AND NOT M; Mixed = NOT R AND NOT L AND NOT M. Exactly one output is 1 for each input row.
Applied
Lifts use interlocks so the motor can't move while any door is open; washing machines lock the door AND check the water level before spinning. Engineers prove these rules with complete truth tables.
Worked example 1
Using the sorter's rules, where does a large, red, non-metal part go? (R = 1, L = 1, M = 0)
Check in order. Metal? M = 0, no. Large? L = 1, yes: Reject. The red rule never gets a turn, because 'large' comes first.
Common mix-ups
The order of rules in a brief doesn't matter.
✓ With 'first match wins' rules, changing the order changes where some parts go. Write the NOT terms to make each rule exact.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
Write the logic for a garage door that closes only if the close button is pressed AND nothing is in the doorway AND the door is NOT already shut. Draw it with gates and give its truth table (8 rows).
Reflect
Why should a safety system stop when a wire breaks, instead of carrying on?
Write your answer on paper or in your own notes. Lite never stores what you write.