← IGCSE Computer Science Paper 1

Temperature sensor

An input device that measures how hot or cold something is. Used in central heating, ovens, greenhouses and weather stations.

Understanding Temperature sensor in IGCSE Computer Science Paper 1

What it does: The sensor reading is compared with a lower limit, and the heating is switched on when the room is colder than it. The program stores the temperature value captured by the sensor in a variable so it can be logged. A temperature sensor measures how hot or cold something is. Moisture is measured by a moisture sensor. Sensors send data into the computer or microprocessor, so they are input devices. The sensor sends the temperature to the microprocessor, which keeps the oven at the chosen heat. The sensor sends readings so the system can turn heaters or vents on or off. It does not play sound.

Common mistakes: The central heating should switch on when the temperature is too cold. The condition should be temp < 18, not temp > 18. The oven needs a temperature sensor to measure how hot it is. ReadHumidity() reads the wrong sensor. It should be ReadTemperature().

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 283–292) 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
What data does a temperature sensor capture?
How hot or cold something isHow much moisture is in the soil
Matches
A temperature sensor measures how much moisture is in the soil of a greenhouse
↓
This describes a moisture sensor. A temperature sensor measures how hot or cold the greenhouse air is.
Applying
Meanings
Term
temperature sensor
Meaning
An input device that measures how hot or cold something is. Used in central heating, ovens, greenhouses and weather stations.
Practice
temp ← TEMPERATURE_SENSOR()
Testing
Gaps
WHILE temperature 180
Check Answer
Spots
1temp ← ReadTemperature()
2IF temp > 18 THEN

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

The 'Snowy Owl' badge — List Slicer, 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. What data does a temperature sensor capture?
A. How much moisture is in the soil
B. How hot or cold something is ✓
A temperature sensor measures how hot or cold something is. Moisture is measured by a moisture sensor.
2. A temperature sensor is which type of device?
A. An output device
B. An input device ✓
Sensors send data into the computer or microprocessor, so they are input devices.
3. Which system would use a temperature sensor to keep a room at the right warmth?
A. Central heating ✓
B. A barcode scanner at a till
Central heating uses a temperature sensor to check the room temperature and switch the heating on or off.
4. Why does an oven need a temperature sensor?
A. To check the inside is as hot as it should be ✓
B. To count how many items are inside
The sensor sends the temperature to the microprocessor, which keeps the oven at the chosen heat.
5. A greenhouse uses a temperature sensor. What is it used for?
A. Keeping the air warm enough for plants to grow ✓
B. Playing sound to help the plants grow
The sensor sends readings so the system can turn heaters or vents on or off. It does not play sound.

Match the Pairs

temperature sensor → An input device that measures how hot or cold something is
temperature > 25 -> fan ON → A control rule where a temperature reading above a set value turns on a fan, as in a greenhouse
A central heating system uses a temperature sensor to switch the boiler on when a room is too cold → IF roomTemp < 18 THEN boiler ON
A weather station uses a temperature sensor to record the air temperature at regular intervals → airTemp <- readTemperatureSensor()
A temperature sensor measures how much moisture is in the soil of a greenhouse → This describes a moisture sensor. A temperature sensor measures how hot or cold the greenhouse air is.
An oven uses a temperature sensor as an output device to heat the food → A sensor is an input device. It sends temperature readings in, and the heating element is the output that heats the oven.

Key Term

temperature sensor
An input device that measures how hot or cold something is. Used in central heating, ovens, greenhouses and weather stations.

Fill in the Blanks

1. WHILE temperature < 180 oven_heater ← ON ENDWHILE
Hint: Type the comparison operator that means the oven is still colder than the target.
2. IF temperature < 18 THEN heating ← ON ENDIF
Hint: Type the keyword that starts a selection, so the central heating reacts to the sensor reading.
3. IF temperature > 30 THEN window ← OPEN ENDIF
Hint: Type the variable that holds the greenhouse sensor reading.
4. INPUT temperature OUTPUT "Temp: ", temperature
Hint: Type the keyword that reads the weather station's sensor data into the program.
5. IF temperature <= 0 THEN OUTPUT "Frost warning" ENDIF
Hint: Type the keyword that closes the selection statement.

Spot the Error

Question 1
A temp ← ReadTemperature()
B IF temp > 18 THEN
C heating ← ON
D ENDIF
Line B — The central heating should switch on when the temperature is too cold. The condition should be temp < 18, not temp > 18.
Question 2
A ovenTemp ← ReadHumidity()
B IF ovenTemp >= 200 THEN
C heater ← OFF
D ENDIF
Line A — The oven needs a temperature sensor to measure how hot it is. ReadHumidity() reads the wrong sensor. It should be ReadTemperature().
Question 3
A temp ← ReadTemperature()
B IF temp > 30
C window ← OPEN
D ELSE
E window ← CLOSED
F ENDIF
Line B — An IF statement must end the condition with THEN. The line should be IF temp > 30 THEN.
Question 4
A total ← 0
B FOR day ← 1 TO 7
C total ← total + day
D NEXT day
E OUTPUT total / 7
Line C — The weather station should add the temperature reading to the total, not the day number. It should be total ← total + ReadTemp().
Question 5
A target ← 21
B target ← ReadTemperature()
C IF temp < target THEN
D heating ← ON
E ENDIF
Line B — This overwrites the target value and temp is never given a value. The sensor reading should be stored in temp: temp ← ReadTemperature().

Student with a class code? Join your class →