TactivergeLite

Lite / Discovering How the World Works / Week 27

Design challenge 2: design the brain

A sorting machine's whole brain fits on one small table. How can eight rows of yes and no sort thousands of parts?

About 30 min · 3 goals · Reviewed by the founders' mentors · Full interactive version

Why should I care?

Now you put the whole term together: sensors to measure, rules and loops to decide, actuators to act, and feedback to correct. Designing the brain on paper first, before any building or coding, is exactly what professional engineers do.

Predict

A sorter has three yes/no sensors: red?, large?, metal?. How many different combinations of readings are possible?

  1. 3
  2. 6
  3. 8
Guess first, then reveal

8. Each sensor doubles the possibilities: 2 × 2 × 2 = 8. A complete rule table needs a bin for every one of those 8 rows, or some parts will arrive with no instruction at all.

Discover

Turn the client's four-line brief into an 8-row rule table, choosing a bin for every combination of red, large and metal. Then watch the slow belt run your table.

What the interactive shows (text version)

The sorting-machine level can be replaced by this rule table for red (R), large (L) and metal (M): any row with M = yes goes to Metal; M = no and L = yes goes to Reject; M = no, L = no and R = yes goes to Red plastic; M = no, L = no and R = no goes to Mixed plastic. That covers all 8 combinations.

You can also open the interactive on the full site when you have a faster connection.

Understand

Start with the loop

Sketch the structure first:

forever: read every sensor → apply the rules → drive the actuators

Name each sensor and actuator. If the system aims at a target (a temperature, a position), mark where the gap is measured and fed back.

Cover every case

List every combination of sensor readings. Two yes/no sensors give 4 rows, three give 8. A rule table with an action for each row guarantees there's no situation your system hasn't thought about.

Priority rules

Some rules must win over others. Any metal part goes to Metal, whatever its colour or size. Put safety and top-priority rules first, so they're checked before anything else. 'IF metal THEN Metal ELSE IF large THEN Reject ELSE …' makes the order clear.

Explain it another way

Intuitive

A rule table is like a choose-your-own-adventure book where every page has a next step. No reader ever gets stuck on a page with nothing to do.

Technical

With n binary inputs there are 2ⁿ input combinations. A complete decision table maps each to an output. Nested IF–ELSE IF chains express priority: earlier conditions take precedence.

Applied

The client's sorting brief becomes four rules: metal first, then large, then red, then everything else. That one ordering fills all 8 rows of the table with no gaps and no contradictions.

Worked example 1

Brief: metal parts → Metal bin. Large non-metal → Reject. Small red plastic → Red. Everything else → Mixed. Write it as a priority chain.

IF metal THEN Metal ELSE IF large THEN Reject ELSE IF red THEN Red ELSE Mixed

Check one row: red, large, not metal → not metal, but large → Reject. Every one of the 8 rows lands in exactly one bin.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 2. Using the chain IF metal THEN Metal ELSE IF large THEN Reject ELSE IF red THEN Red ELSE Mixed, where does a small, red, metal part go?
Practice 3. A rule table for two sensors has only three rows filled in. What's the risk?
Practice 4. In your design, where do the sensor readings and rules go?

Apply it

For your term project, draw the sense–think–act diagram and write the rules as an IF–ELSE IF chain inside a forever loop. If you have yes/no sensors, fill in the complete rule table. Mark the one rule that must always win.

Reflect

Which part of your design's brain was hardest to decide, and why?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Design challenge 1: define the problemDesign challenge 3: test it and make it better →