Skip to the page
Year 9 · Summer 1 · Physical Computing

Designing a device for a user

What this lesson covers

Topic 13 Programming basics

KS3 Computing · A program stores information in variables, works on it with operators, and controls the order with sequence, selection and iteration. Examples are in Python, with Scratch alongside for Year 7.

Topic 11 Algorithms

KS3 Computing · An algorithm is a precise, step-by-step plan to solve a problem. Computational thinking turns a messy problem into one. Every algorithm is built from just three things: sequence, selection and iteration.

Computational Thinking Computer SystemsCambridge Lower Secondary Computing 0860

You will learn to

  • Identify who the user is, what problem they have, and what the device must never do.
  • Plan the inputs, process and outputs of a device in a table.
  • Write the device's decisions as plain steps or a flowchart before building.
  • Create a parts list that says what each part is for.

Success criteria

  • I can describe my user and their problem in two sentences.
  • I can fill in an input, process, output table for my device.
  • I can talk a partner through my plan, step by step, before I build.

Key words

Say each word, then read what it means. Every one is in the glossary too.

Variable
A named place in memory that holds a value.
Assignment
Storing a value in a variable. = in Python, ← in pseudocode.
Casting
Changing a value from one data type to another, like int("13").
Concatenation
Joining strings together: "7" + "7" = "77".
Selection
Choosing a path with if / else.
Iteration
Repeating steps: a loop.
Boolean
A value that is only True or False.
Infinite loop
A loop whose condition never becomes false.
Algorithm
Precise, ordered, finite steps to solve a problem.
Decomposition
Breaking a problem into smaller ones.
Abstraction
Ignoring detail that doesn't matter for the problem.
Sequence · selection · iteration
Steps one after another. First this, then this.
Pseudocode
Code-like writing for algorithms, without strict rules.
Trace table
Records variable values step by step to check logic.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Start with the user

A brief is a short description of a problem and who has it. Good devices start with the user, not the parts.

  • Who will use it?
  • What problem does it solve for them?
  • Where will it be used?
  • What must it never do?
e.g.Example

Brief: a crossing outside the school. Users: pupils on foot, and drivers. It must never let cars go while people are crossing.

Think about every user. A person who cannot see well needs a sound as well as a light.

Inputs, process, outputs

A sensor is an input part that measures something, like light or temperature.

An actuator is an output part that acts on the world: a light, a buzzer or a motor.

Part of the systemCrossing example
InputA push button for people who want to cross
ProcessThe program decides when to change the lights
OutputRed, amber and green lights for the cars
StorageA count of how many times people crossed
★Remember

An embedded system is a computer with one job. Your device is one.

Plan the decisions on paper

Write the steps in plain words before any code. Add the time for each step.

start: green for cars
forever:
    if the button is pressed:
        amber for 2 seconds
        red for 5 seconds (people cross)
        red and amber for 1 second
        green for cars

You can draw the same plan as a flowchart. The 'button pressed?' question is a diamond.

?Why?

Why plan on paper?

Changing a plan takes a minute. Changing wires and code can take a lesson. A plan also shows what to test later.

The parts list

PartHow manyIts job
Arduino Uno R31Runs the program
Breadboard Small1Holds the circuit together
LED: red, yellow, green3The traffic lights (yellow plays amber)
Resistor, 220 Ω3One for each LED, to limit the current
Pushbutton1The crossing button
Resistor, 10 kΩ1Pull-down: keeps the button pin at 0 until it is pressed
!Watch out

Every LED needs its own resistor. Every button input needs a pull-down resistor.

e.g.Worked example

Brief: a door alarm for a younger brother's bedroom. Plan it before you build.

  1. User: a child who wants to know if someone opens the door. It must never sound while the alarm is switched off.
  2. Inputs: a door sensor, and a slide switch to turn the alarm on or off. In Tinkercad, a pushbutton stands in for the door sensor: pressed means 'door open'.
  3. Process: if the alarm is on AND the door is open, sound the alarm.
  4. Outputs: a piezo buzzer (a tiny speaker) and a red LED.
  5. Parts: Arduino, breadboard, slide switch, pushbutton with a 10 kΩ pull-down, piezo buzzer, red LED with a 220 Ω resistor.
  6. Notice the process is an AND gate, just like last lesson.

Study it

Open the study page and go one step at a time.

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.