← IGCSE Computer Science Paper 1

Sensors, microprocessor and actuator in a control system

A sensor sends readings to a microprocessor, which compares them with a stored value and signals an actuator, such as a heater, to act. This repeats continuously.

Understanding Sensors, microprocessor and actuator in a control system in IGCSE Computer Science Paper 1

What it does: The ADC changes the analogue sensor signal into a digital value stored in temp so the microprocessor can process it. Sensors measure. Actuators act, for example a heater, a valve or a motor. The sensor keeps taking readings, so the microprocessor can keep checking and adjusting. That is why it is called a loop. The moisture sensor is the input. The valve is an actuator that acts when the soil is too dry. A keyboard is not an actuator. The comparison with the set value of 20 decides whether the heater actuator is switched on. A control system must repeat continuously, so the code should be wrapped in WHILE TRUE ... ENDWHILE.

Common mistakes: A control system repeats continuously in a feedback loop. WHILE FALSE means the loop never runs, so the sensor is never read. It should be WHILE TRUE DO. The heater should switch on when the temperature is below the stored value. t > 18 would switch it on when the greenhouse is already warm. It should be IF t < 18 THEN.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 293–303) and word search (Modules 283–303).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
In a greenhouse control system, which device compares the sensor reading with the stored value?
The actuatorThe microprocessor
Matches
Sensor → Actuator → Microprocessor
↓
The order is wrong. The sensor sends readings to the microprocessor, not straight to the actuator. The microprocessor then signals the actuator.
Applying
Meanings
Term
feedback loop
Meaning
A sensor sends readings to a microprocessor, which compares them with a stored value and signals an actuator, such as a heater, to act. This repeats continuously.
Practice
setPoint ← 20
Testing
Gaps
WHILE DO
Check Answer
Spots
1WHILE FALSE DO
2 t ← READ_SENSOR()

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Butterfly' badge — Branch Hopper, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. In a greenhouse control system, which device compares the sensor reading with the stored value?
A. The actuator
B. The microprocessor ✓
The microprocessor makes the decision by comparing the reading with the stored value. The actuator only carries out the action.
2. Which statement about an actuator in a control system is correct?
A. It acts when the microprocessor signals it, for example by turning on a heater ✓
B. It measures the temperature and sends the readings to the microprocessor
Sensors measure. Actuators act, for example a heater, a valve or a motor.
3. A temperature sensor produces an analogue signal. What must happen before the microprocessor can use it?
A. A DAC converts it to digital data
B. An ADC converts it to digital data ✓
An analogue-to-digital converter (ADC) changes the analogue reading into digital data that the microprocessor can process.
4. In a central heating system, the room is 15°C and the stored value is 20°C. What does the microprocessor do?
A. Signals the heater to switch on ✓
B. Signals the heater to switch off
The reading is below the stored value, so the microprocessor signals the actuator to heat the room.
5. How often does the sensor, microprocessor and actuator process repeat in a feedback loop?
A. Continuously ✓
B. Only once, when the system is switched on
The sensor keeps taking readings, so the microprocessor can keep checking and adjusting. That is why it is called a loop.

Match the Pairs

WHILE TRUE → Keeps the control loop running continuously so the sensor is read again and again
IF temp < 20 THEN heater ← ON → The microprocessor compares the sensor reading with the stored value and switches the actuator on
The sensor reading is analogue, so an ADC converts it to digital before the microprocessor can use it → temp ← ADC(sensor)
The microprocessor compares the reading with a stored value and signals the actuator to turn off when the target is reached → IF temp >= 25 THEN heater ← OFF
Sensor → Actuator → Microprocessor → The order is wrong. The sensor sends readings to the microprocessor, not straight to the actuator. The microprocessor then signals the actuator.
temp ← ADC(sensor) IF temp < 20 THEN heater ← ON END → The program runs once and stops. There is no loop, so the system never checks the sensor again and the feedback loop is broken.

Key Term

feedback loop
A sensor sends readings to a microprocessor, which compares them with a stored value and signals an actuator, such as a heater, to act. This repeats continuously.

Fill in the Blanks

1. WHILE TRUE DO temp ← READ_SENSOR() ENDWHILE
Hint: Type the value that keeps the loop repeating continuously.
2. IF temp < 20 THEN heater ← ON ENDIF
Hint: Type the comparison operator that checks whether the reading is below the set value.
3. IF temp > setValue THEN heater ← OFF ENDIF
Hint: Type the state the microprocessor gives the heater when the reading is above the set value.
4. digital ← ADC(analogue) IF digital < setValue THEN heater ← ON
Hint: Type the abbreviation for the converter that turns the sensor's analogue reading into digital data.
5. IF temp < setValue THEN heater ← ON ENDIF
Hint: Type the variable that holds the stored value the reading is compared with.

Spot the Error

Question 1
A WHILE FALSE DO
B t ← READ_SENSOR()
C IF t < 20 THEN heater ← ON
D ENDWHILE
Line A — A control system repeats continuously in a feedback loop. WHILE FALSE means the loop never runs, so the sensor is never read. It should be WHILE TRUE DO.
Question 2
A WHILE TRUE DO
B t ← READ_SENSOR()
C IF t > 18 THEN
D heater ← ON
E ENDIF
F ENDWHILE
Line C — The heater should switch on when the temperature is below the stored value. t > 18 would switch it on when the greenhouse is already warm. It should be IF t < 18 THEN.
Question 3
A raw ← READ_SENSOR()
B temp ← DAC(raw)
C IF temp < 18 THEN
D heater ← ON
E ENDIF
Line B — Sensor readings are analogue, so the microprocessor needs an ADC (analogue-to-digital converter). A DAC converts the other way. It should be temp ← ADC(raw).
Question 4
A setPoint ← 22
B t ← setPoint
C IF t < setPoint THEN
D heater ← ON
E ENDIF
Line B — The reading must come from the sensor. Copying the stored value means the comparison never reflects the real temperature. It should be t ← READ_SENSOR().
Question 5
A WHILE TRUE DO
B t ← READ_SENSOR()
C IF t > 30 THEN
D sensor ← ON
E ENDIF
F ENDWHILE
Line D — The microprocessor signals an actuator, such as a fan, to act. A sensor only inputs data and cannot cool the greenhouse. It should be fan ← ON.

Student with a class code? Join your class →