Key Stage 2 design and technology · Technical knowledge
KS2 programming and controlling products: a guide
In Key Stage 2 design and technology, children apply what they know from computing to program, monitor and control their products. A product might have a sensor that monitors the light or temperature, a program that decides what to do, and an output such as a light, a buzzer or a motor. It joins up the electrical circuits they build with the programming they do in computing lessons, so that a model can respond to its surroundings without anyone pressing a switch.
Programming and controlling products, explained
The national curriculum asks pupils to apply their understanding of computing to program, monitor and control their products, and to understand and use electrical systems in them. The idea is that a product can have an input, a process and an output. An input is something the product detects or receives, such as a button press or a sensor reading. The process is the program that decides what to do. The output is what happens as a result, such as a light, a sound or a motor turning. Automatic doors, street lights, central heating thermostats and pedestrian crossings all work this way.
Monitoring means collecting information about what is happening, and controlling means using that information to make something happen. A light sensor monitors how bright it is, and a program controls an LED according to what the sensor reports. Sensors do not understand words like “dark” or “warm”. They give numbers, and the designer has to decide which number counts as dark. That decision point is called a threshold, and children find it by testing: they read the numbers in bright light, in dim light and in the dark and pick a sensible value between them.
The programming itself uses the same ideas as in computing lessons. Children plan a sequence of instructions, use selection (if this, then that, otherwise something else), use repetition so that the product keeps checking, and sometimes use variables to store values. Many schools use block-based programming on a screen and a small programmable control board connected to the outputs, although the curriculum does not name any particular software or hardware, and some classes use a simulator. Children usually write the plan first as a flowchart or in plain steps, then turn it into a program.
The electrical side remains important. A programmable board still needs a circuit: an LED or buzzer has to be connected the right way round, the board needs power, and the connections must be secure. When a product does not work, children learn to ask whether the fault is in the hardware (the wiring, the battery, a component the wrong way round) or in the software (the program). A good test is to run the simplest possible program that just switches the output on. If the output comes on, its wiring is fine, so the next things to check are the sensor and the logic of the program.
Design and technology brings the thinking back to a real user. Children write design criteria for what the product must do, test it in the situations it will meet, ask others for their views and improve it. They also learn that technology is made by people. Whether a night light turns on at the right time depends on choices that a designer made, and a mistake in the program is a mistake that can be found and fixed, which is called debugging.
Words your child will hear
- Input and output
- An input is information that goes into a product, such as a button press. An output is what the product does, such as a light or sound.
- Sensor
- A component that measures something, like light, temperature or movement, and gives a number to the program.
- Program
- A set of instructions that tells a device exactly what to do, written so a computer can follow it.
- Selection
- A choice in a program, written as “if… then… else…”.
- Repetition
- Doing something again and again, which in a program is done with a loop.
- Debug
- To find and fix mistakes in a program or in the way a product is built.
- Threshold
- The value at which a program changes what it does, such as the light level that counts as dark.
What the National Curriculum says
The programme of study for Key Stage 2 says:
- When designing and making, pupils should be taught to apply their understanding of computing to program, monitor and control their products
- When designing and making, pupils should be taught to understand and use electrical systems in their products [for example, series circuits incorporating switches, bulbs, buzzers and motors]
Objectives from the National Curriculum in England, © Crown copyright, used under the Open Government Licence v3.0.
Try it: an automatic night light
Plan a night light that switches itself on when a room is dark and off when it is light. Work out what the program should do and how to test it.
- Identify the input, process and output. The input is a light sensor, which gives a number for how bright it is. The output is an LED. The process is the program, which compares the number with a threshold and decides whether the LED is on or off.
- Write the plan as steps. The program must keep checking, so it needs a loop, and it must make a choice each time, so it needs selection.
forever read the light level if light level < 30 turn the LED on else turn the LED off - Find the threshold by monitoring. Read the sensor in bright light, with the curtains half closed and in the dark. On one device these might be about 80, 40 and 10, but the scale differs between devices. Choose a number between the dim reading and the dark reading, such as 30, and write down why.
- Test and debug. Cover the sensor and check the LED lights. Uncover it and check the LED goes off. If nothing happens even in the dark, run a one-line program that just turns the LED on, to see whether the wiring is at fault. If the light flickers at dusk, the readings are hovering around the threshold. Try a different threshold, or add a short pause between readings so the light changes less often.
- Evaluate against the criteria. Does it come on in a dark room? Does it go off in daylight? Does it stay steady? Ask someone who will use it, such as a younger sibling, whether the light is bright enough and in the right place, and make one improvement.
The finished program repeats forever: if the light level is below the threshold, turn the LED on, otherwise turn it off. The threshold of about 30 was chosen by monitoring readings in different conditions and testing. A flicker at dusk can be reduced by choosing the threshold carefully or adding a short pause.
Common mistakes and how to help
Expecting the device to know what you meant
Smart products seem to understand people, so children assume a program only needs a general idea of what they want.
What helps: Play a game where your child gives you exact instructions for a simple task, like making a cup of tea. You follow only what they say, which shows why computers need precise steps.
Assuming the program must be wrong when the product does not work
Children have been told that programming is the hard part, so they look there first.
What helps: Split the problem in two. Run the simplest possible program to test the output wiring, then check the sensor and the logic. Finding out whether the fault is hardware or software saves a lot of time.
Thinking sensors can tell “dark” or “hot” without being told
In daily life, we use words and a sensor seems to do the same.
What helps: Look at the actual numbers the sensor gives. Ask your child to pick a number for “dark” and test it. Different rooms may need a different threshold.
Writing a program that checks only once
The program does what it was told: it reads the sensor once, acts, and then stops. Children expect it to carry on watching.
What helps: Ask “what happens after the light has been checked?” and show how a loop makes the checking happen again and again.
How to help at home
- Be the robot. Ask your child to write step-by-step instructions to get you to the biscuit tin, and follow them exactly. When you end up at the wrong cupboard, they find the bug and fix the instructions. It is a safe way to practise sequencing and debugging.
- Spot inputs and outputs. Look at automatic doors, street lights, a heating thermostat, a pedestrian crossing or a microwave. Ask what the input is, what the output is and what “if” decision the product is making.
- Make a decision flowchart. Draw a flowchart for a family decision, like “if it is raining, take an umbrella, otherwise take sunglasses”. This shows selection without a computer, and children enjoy making the rules more complicated.
- Monitor the temperature. Use a simple room thermometer to record the temperature in a few rooms at the same time each day for a week. Then discuss what number you would use as a threshold for turning the heating on. Collecting readings is what monitoring means.
- Ask them to explain their code. If your child has made a program at school or on a device at home, ask them to talk you through it line by line and say what each part does. Teaching someone else is the best check of understanding, and screens only need to be on for a short time.
Related topics
Builds on
- Key Stage 1: Strong, stiff, stable structures
- Key Stage 1: Levers and sliders
- Key Stage 1: Wheels and axles
Leads on to
- Key Stage 3: Properties of materials
- Key Stage 3: Beams, frames and forces
- Key Stage 3: Gears, levers and mechanisms
- Key Stage 3: Electronic circuits and systems
- Key Stage 3: Sensors, actuators and microcontrollers
More on technical knowledge
- Key Stage 2: Cams, levers and linkages
- Key Stage 2: Series circuits in products
- Key Stage 2: Gears and pulleys
- Key Stage 2: Strengthening and reinforcing structures
Updated .