Programming and Controlling Your Products
Many modern products, from automatic doors to washing machines, are controlled by a tiny computer called a microcontroller. Pupils can design and program these too, using devices such as a micro:bit or a similar board.
Input, Process, Output
Every control system follows a pattern:
- Input: a sensor or button collects information, such as light level, temperature or a press.
- Process: the program decides what to do.
- Output: something happens, such as a light, buzzer, motor or screen message.
Examples
| Product | Input | Output |
|---|---|---|
| Automatic night-light | Light sensor detects darkness | LED turns on |
| Pedestrian crossing | Button pressed | Lights change and a buzzer sounds |
| Plant monitor | Moisture sensor | Screen shows "Water me!" |
| Fan | Temperature sensor | Motor spins when it is hot |
Sensing and Selection
A program uses selection, an if... then... else rule:
> IF the light level is less than 30 THEN turn the LED on ELSE turn it off.
A loop such as forever keeps checking the sensor again and again.
Monitoring
Monitoring means collecting data over time, such as recording the temperature every minute. You can then look at the numbers or a graph to see patterns.
Controlling
Controlling means using that data to make something happen, like a heater turning off at 21°C.
Designing, Testing, Debugging
- Write down what the product should do.
- Plan the program with a flowchart or pseudocode.
- Build the program and the model.
- Test. Does it work in different conditions?
- Debug. Find and fix errors, one at a time.
Why It Matters
Programmable systems make our homes safer, our cars smarter and our energy use more efficient, but people still design them and are responsible for how they work.
Curriculum link: National Curriculum in England: Design and technology programmes of study (DfE) — Key Stage 2 Technical knowledge: apply their understanding of computing to program, monitor and control their products