Microcontrollers as counters, timers and decision makers
A microcontroller takes input signals, follows a stored program and switches outputs on or off.
What it is
A Microcontroller A small programmable integrated circuit that processes inputs and controls outputs. is a small programmable chip. It is the process stage of a system, between inputs and outputs.
Decision maker
It compares an input with a set value, then chooses an output. For example, if the temperature is above 25 degrees Celsius, switch the fan on.
Greenhouse control system - 1Temperature sensorinput
- 2Microcontrolleris it too hot?
- 3Fanoutput: on or off
Follow the signal from sensor to fan through the decision step.
Counter
It counts pulses from an input, such as people passing a sensor or button presses. It can then act when a set count is reached.
Timer
It can wait a set time before changing an output, or keep an output on for a fixed time. Examples are a hand dryer or a sauna Timer A process that controls how long, or when, an output is switched on or off..
Why use one
It is flexible. Changing the Program A set of instructions stored in a microcontroller that decides what it does. changes how the system behaves, without rebuilding the circuit.
key terms
- Microcontroller
- A small programmable integrated circuit that processes inputs and controls outputs.
- Program
- A set of instructions stored in a microcontroller that decides what it does.
- Counter
- A process that counts events or pulses and acts on the total.
- Timer
- A process that controls how long, or when, an output is switched on or off.
- Decision
- A step where the microcontroller compares an input with a set value and chooses an output.
worked example
A school greenhouse uses a microcontroller. A temperature sensor is the input and a fan is the output. Describe how the microcontroller acts as a decision maker.
- 1Start with the input: the sensor sends a signal for the temperature.
- 2Say what the program does: it compares the reading with a set value, for example 25 degrees Celsius.
- 3State the decision: if the reading is above the set value, it switches the fan on.
- 4Finish the loop: when the temperature drops below it, it switches the fan off.
the answer: The sensor sends a signal representing the temperature to the microcontroller. The program compares it with a set value, such as 25 degrees Celsius. If it is higher, the microcontroller switches the fan on to cool the greenhouse. When it falls below the value, it switches the fan off.
the classic mistake
wrong: The microcontroller senses the temperature and cools the greenhouse.
right: No. The sensor detects the temperature. The fan cools the greenhouse. The microcontroller decides: it compares the reading with a set value, then switches the output.
exam tip
describe
Give the main features or steps (AO4).
For a describe question, walk the chain: input, then what the program compares, then what the output does. The trap is skipping the compare step.
how to make it stick
Cover the diagram and redraw the input, compare, output chain from memory. Then say it out loud without looking.
try one
Which function is the microcontroller carrying out?
test yourself
the real papers
AQA past papers and mark schemesreal papers live on the board's site. ours are original, so nobody can take them down.