How does a microcontroller use a program to control inputs and outputs?
Programmable control: the microcontroller as a programmable process sub-system and the use of flowcharts with inputs, decisions, outputs and loops to control a system.
An SQA National 5 Engineering Science answer on programmable control, covering the microcontroller as a programmable process sub-system, why programmable control is flexible, and how a flowchart uses inputs, decisions, outputs, delays and loops to control a system automatically.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this key area is asking
The SQA wants you to understand the microcontroller as a programmable process sub-system and to read and write simple flowcharts that use inputs, decisions, outputs, delays and loops to control a system automatically.
The microcontroller as a process sub-system
In the universal systems model, the microcontroller is the process block: sensors and switches connect to its inputs, and lamps, motors and buzzers connect (usually through transistors) to its outputs. The same hardware can perform completely different tasks just by changing the program.
Flowcharts
A flowchart is the standard way to plan a control program before writing it. It uses agreed symbols:
- Terminal (rounded box): START or STOP.
- Input/Output (parallelogram, or a process box): read a sensor, or switch an output on or off; a delay (wait) is also shown as a process step.
- Decision (diamond): a yes/no test, such as "is the input high?", with two exits.
- Flow lines (arrows): show the order the steps run in, and loops that return to an earlier step to repeat it.
Inputs, decisions, outputs and loops
A control flowchart typically: starts, reads an input, uses a decision to test it, switches an output depending on the result, and then loops back to keep monitoring. Decisions give the program its intelligence; loops let it run continuously.
Why programmable control matters
Programmable control is how modern engineered products work, from washing machines to traffic lights. For the National 5 assignment it lets you build a flexible solution and change its behaviour by editing a flowchart rather than rebuilding hardware, which is why it is examined alongside fixed logic.
Try this
Q1. Which flowchart symbol represents a yes/no decision? [1 mark]
- Cue. A diamond, with two exits.
Q2. State one advantage of programmable control over a fixed logic-gate circuit. [1 mark]
- Cue. The behaviour can be changed by reprogramming rather than rewiring (or: fewer components, smaller and cheaper).
Q3. Why does a continuous monitoring program need a loop in its flowchart? [2 marks]
- Cue. So that after acting on the input it returns to read the input again, repeating forever instead of running once and stopping.
Exam-style practice questions
Practice questions written in the style of SQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
SQA N5 style3 marksA microcontroller controls a warning lamp. The lamp must flash on for 1 second and off for 1 second, repeating forever. Describe, in the order they would appear in a flowchart, the steps the program carries out.Show worked answer →
List the flowchart steps in a repeating loop.
Switch the lamp output on.
Wait (delay) for 1 second.
Switch the lamp output off.
Wait (delay) for 1 second.
Loop back to the first step so the sequence repeats forever.
Markers reward the correct ordered sequence of output, delay, output, delay, and the loop back to the start so the flashing repeats. Missing the loop, or the delays, loses marks.
SQA N5 style2 marksState two advantages of using a programmable microcontroller instead of a fixed circuit of logic gates to control a system.Show worked answer →
Give two genuine advantages of programmability.
The behaviour can be changed by editing the program rather than rewiring the circuit, so it is flexible and easy to update.
One small microcontroller can replace many separate gates and components, making the circuit smaller, cheaper and simpler to build.
Markers reward two valid advantages such as easy to reprogram, fewer components, smaller and cheaper, or able to handle complex sequences and timing.
Related dot points
- Digital logic gates (AND, OR, NOT) and their truth tables, including recognising gate symbols and completing a truth table for a single gate.
An SQA National 5 Engineering Science answer on digital logic gates, covering the AND, OR and NOT gates, their symbols and truth tables, the meaning of logic 1 and logic 0, and how to complete a truth table for a single gate.
- Combinational logic: combining gates to meet a control requirement, completing the truth table of a combined circuit, NAND and NOR gates, and reading a Boolean expression.
An SQA National 5 Engineering Science answer on combinational logic, covering how gates are combined to control an output, completing the truth table of a combined circuit, the NAND and NOR gates as inverted AND and OR, and writing a Boolean expression for a logic system.
- Universal systems diagrams: representing an electronic or control system as input, process and output sub-systems using block diagrams.
An SQA National 5 Engineering Science answer on the universal systems approach, covering input, process and output sub-systems, drawing and interpreting block diagrams, the meaning of feedback, and identifying real components within each block.
- The voltage divider and input transducers: calculating the output voltage of a divider and using the LDR and thermistor to make light- and temperature-sensing circuits.
An SQA National 5 Engineering Science answer on the voltage divider and input transducers, covering the divider equation, how the output voltage splits in proportion to resistance, and how an LDR or thermistor makes a light- or temperature-sensing circuit that produces a changing voltage.